From 45067c63d82b2b1b7a070366d673c7751565a02e Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Thu, 15 May 2014 11:37:40 +0200 Subject: [PATCH 001/502] Add delivery date into supplier order list --- htdocs/fourn/commande/liste.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 4da9f5e40c1..47bcb468e84 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; $langs->load("orders"); +$langs->load("sendings"); $search_ref=GETPOST('search_ref'); @@ -83,7 +84,7 @@ $offset = $conf->liste_limit * $page ; */ $sql = "SELECT s.rowid as socid, s.nom, cf.date_commande as dc,"; -$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,"; +$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,cf.date_livraison,"; $sql.= " u.login"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf"; @@ -156,6 +157,7 @@ if ($resql) print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"total_ttc","",$param,$sortfield,$sortorder); print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('DateDeliveryPlanned'),$_SERVER["PHP_SELF"],'cf.date_livraison','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -168,6 +170,7 @@ if ($resql) print ''; print ''; print ' '; + print ' '; print ''; $formorder->selectSupplierOrderStatus($search_status,1,'search_status'); print ''; @@ -226,6 +229,12 @@ if ($resql) } print ''; + // Delivery date + print ''; + print dol_print_date($db->jdate($obj->date_livraison), 'day'); + print ''; + + // Statut print ''.$commandestatic->LibStatut($obj->fk_statut, 5).''; From 2f78446433b2fcbd765be00f61b30592612f4de8 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Thu, 15 May 2014 11:43:55 +0200 Subject: [PATCH 002/502] FIX alert for supplier order wasn't on delivery_date if exist --- htdocs/fourn/class/fournisseur.commande.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 591fce671b1..704e06b2f3b 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1917,7 +1917,7 @@ class CommandeFournisseur extends CommonOrder $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; - $sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut"; + $sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut,c.date_livraison as delivery_date"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -1935,7 +1935,9 @@ class CommandeFournisseur extends CommonOrder while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->fk_statut != 3 && $this->db->jdate($obj->datec) < ($now - $conf->commande->fournisseur->warning_delay)) $this->nbtodolate++; + + $date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date; + if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->fournisseur->warning_delay)) $this->nbtodolate++; } return 1; } From b210d7a00fc73a5af7bd3c2d56dd5517aabbf71c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 18 May 2014 14:59:20 +0200 Subject: [PATCH 003/502] Update commonobject.class.php Hide the margintable if click at the top of it (usefull when customer are just in front of you), reappear when you click again --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0a44be050e7..fe77c21d158 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,8 +3235,8 @@ abstract class CommonObject $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - - print ''; + print "
 
"; + print '
'; print ''; print ''; print ''; From c8067931e317a0cbdc8945d8ea28512a38db8d40 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 19 May 2014 09:32:42 +0200 Subject: [PATCH 004/502] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe77c21d158..2d7ff70aaa9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,8 +3235,8 @@ abstract class CommonObject $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print "
 
"; - print '
'.$langs->trans('Margins').''.$langs->trans('SellingPrice').'
'; + print "
 
"; + print '
'; print ''; print ''; print ''; From 86e0d377f84d8650b7b1e5fbabd6aab26f1957de Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 19 May 2014 09:40:06 +0200 Subject: [PATCH 005/502] Update objectline_view.tpl.php --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 948a61bae2c..ce87aa5e815 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -123,7 +123,7 @@ if (! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?> Date: Tue, 20 May 2014 09:59:42 +0200 Subject: [PATCH 006/502] Adding var mode_reglement_id to facture Adding var mode_reglement_id to facture in order to change the payment method. --- htdocs/webservices/server_invoice.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index c79c862146c..32154776154 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -102,6 +102,7 @@ $server->wsdl->addComplexType( 'total' => array('name'=>'total','type'=>'xsd:double'), 'date_start' => array('name'=>'date_start','type'=>'xsd:date'), 'date_end' => array('name'=>'date_end','type'=>'xsd:date'), + 'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'), // From product 'product_id' => array('name'=>'product_id','type'=>'xsd:int'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), @@ -329,6 +330,7 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='') 'status'=> $invoice->statut, 'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_note' => $invoice->close_note?$invoice->close_note:'', + 'mode_reglement_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', 'lines' => $linesresp )); } @@ -454,6 +456,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) 'status'=> $invoice->statut, 'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_note' => $invoice->close_note?$invoice->close_note:'', + 'mode_reglement_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', 'lines' => $linesresp ); } @@ -518,6 +521,7 @@ function createInvoice($authentication,$invoice) $newobject->statut=0; // We start with status draft $newobject->fk_project=$invoice['project_id']; $newobject->date_creation=$now; + $newobject->mode_reglement_id = $invoice['mode_reglement_id']; // Trick because nusoap does not store data with same structure if there is one or several lines $arrayoflines=array(); From 0d71350c7636991dfd1bf6c80649083dedcc79fc Mon Sep 17 00:00:00 2001 From: guerinaxel Date: Thu, 22 May 2014 08:54:14 +0200 Subject: [PATCH 007/502] Rename mode_reglement_id into payment_mode_id --- htdocs/webservices/server_invoice.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 32154776154..e8c6f166890 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -102,7 +102,7 @@ $server->wsdl->addComplexType( 'total' => array('name'=>'total','type'=>'xsd:double'), 'date_start' => array('name'=>'date_start','type'=>'xsd:date'), 'date_end' => array('name'=>'date_end','type'=>'xsd:date'), - 'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'), + 'payment_mode_id' => array('name'=>'payment_mode_id','type'=>'xsd:string'), // From product 'product_id' => array('name'=>'product_id','type'=>'xsd:int'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), @@ -330,7 +330,7 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='') 'status'=> $invoice->statut, 'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_note' => $invoice->close_note?$invoice->close_note:'', - 'mode_reglement_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', + 'payment_mode_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', 'lines' => $linesresp )); } @@ -456,7 +456,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) 'status'=> $invoice->statut, 'close_code' => $invoice->close_code?$invoice->close_code:'', 'close_note' => $invoice->close_note?$invoice->close_note:'', - 'mode_reglement_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', + 'payment_mode_id' => $invoice->mode_reglement_id?$invoice->mode_reglement_id:'', 'lines' => $linesresp ); } @@ -521,7 +521,7 @@ function createInvoice($authentication,$invoice) $newobject->statut=0; // We start with status draft $newobject->fk_project=$invoice['project_id']; $newobject->date_creation=$now; - $newobject->mode_reglement_id = $invoice['mode_reglement_id']; + $newobject->mode_reglement_id = $invoice['payment_mode_id']; // Trick because nusoap does not store data with same structure if there is one or several lines $arrayoflines=array(); From 1e3b8e56f226e5a8b0fae167738839ea337a5160 Mon Sep 17 00:00:00 2001 From: guerinaxel Date: Thu, 22 May 2014 12:10:40 +0200 Subject: [PATCH 008/502] Add extrafields to productorservice webservice --- .../webservices/server_productorservice.php | 221 ++++++++++++------ 1 file changed, 144 insertions(+), 77 deletions(-) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index c2eba3f9d1b..4d7f8867e65 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php"); +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; @@ -88,6 +89,64 @@ $server->wsdl->addComplexType( ) ); +$productorservice_fields = array( + 'id' => array('name'=>'id','type'=>'xsd:string'), + 'ref' => array('name'=>'ref','type'=>'xsd:string'), + 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), + 'type' => array('name'=>'type','type'=>'xsd:string'), + 'label' => array('name'=>'label','type'=>'xsd:string'), + 'description' => array('name'=>'description','type'=>'xsd:string'), + 'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'), + 'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'), + 'note' => array('name'=>'note','type'=>'xsd:string'), + 'status_tobuy' => array('name'=>'status_tobuy','type'=>'xsd:string'), + 'status_tosell' => array('name'=>'status_tosell','type'=>'xsd:string'), + 'barcode' => array('name'=>'barcode','type'=>'xsd:string'), + 'barcode_type' => array('name'=>'barcode_type','type'=>'xsd:string'), + 'country_id' => array('name'=>'country_id','type'=>'xsd:string'), + 'country_code' => array('name'=>'country_code','type'=>'xsd:string'), + 'customcode' => array('name'=>'customcode','type'=>'xsd:string'), + + 'price_net' => array('name'=>'price_net','type'=>'xsd:string'), + 'price' => array('name'=>'price','type'=>'xsd:string'), + 'price_min_net' => array('name'=>'price_min_net','type'=>'xsd:string'), + 'price_min' => array('name'=>'price_min','type'=>'xsd:string'), + + 'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'), + + 'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:string'), + 'vat_npr' => array('name'=>'vat_npr','type'=>'xsd:string'), + 'localtax1_tx' => array('name'=>'localtax1_tx','type'=>'xsd:string'), + 'localtax2_tx' => array('name'=>'localtax2_tx','type'=>'xsd:string'), + + 'stock_alert' => array('name'=>'stock_alert','type'=>'xsd:string'), + 'stock_real' => array('name'=>'stock_real','type'=>'xsd:string'), + 'stock_pmp' => array('name'=>'stock_pmp','type'=>'xsd:string'), + 'canvas' => array('name'=>'canvas','type'=>'xsd:string'), + 'import_key' => array('name'=>'import_key','type'=>'xsd:string'), + + 'dir' => array('name'=>'dir','type'=>'xsd:string'), + 'images' => array('name'=>'images','type'=>'tns:ImagesArray') +); + +//Retreive all extrafield for product +// fetch optionals attributes and labels +$extrafields=new ExtraFields($db); +$extralabels=$extrafields->fetch_name_optionals_label('product',true); +if (count($extrafields)>0) { + $extrafield_array = array(); +} +foreach($extrafields->attribute_label as $key=>$label) +{ + $type =$extrafields->attribute_type[$key]; + if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';} + else {$type='xsd:string';} + + $extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type); +} + +$productorservice_fields=array_merge($productorservice_fields,$extrafield_array); + // Define other specific objects $server->wsdl->addComplexType( 'product', @@ -95,45 +154,7 @@ $server->wsdl->addComplexType( 'struct', 'all', '', - array( - 'id' => array('name'=>'id','type'=>'xsd:string'), - 'ref' => array('name'=>'ref','type'=>'xsd:string'), - 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), - 'type' => array('name'=>'type','type'=>'xsd:string'), - 'label' => array('name'=>'label','type'=>'xsd:string'), - 'description' => array('name'=>'description','type'=>'xsd:string'), - 'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'), - 'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'), - 'note' => array('name'=>'note','type'=>'xsd:string'), - 'status_tobuy' => array('name'=>'status_tobuy','type'=>'xsd:string'), - 'status_tosell' => array('name'=>'status_tosell','type'=>'xsd:string'), - 'barcode' => array('name'=>'barcode','type'=>'xsd:string'), - 'barcode_type' => array('name'=>'barcode_type','type'=>'xsd:string'), - 'country_id' => array('name'=>'country_id','type'=>'xsd:string'), - 'country_code' => array('name'=>'country_code','type'=>'xsd:string'), - 'customcode' => array('name'=>'customcode','type'=>'xsd:string'), - - 'price_net' => array('name'=>'price_net','type'=>'xsd:string'), - 'price' => array('name'=>'price','type'=>'xsd:string'), - 'price_min_net' => array('name'=>'price_min_net','type'=>'xsd:string'), - 'price_min' => array('name'=>'price_min','type'=>'xsd:string'), - - 'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'), - - 'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:string'), - 'vat_npr' => array('name'=>'vat_npr','type'=>'xsd:string'), - 'localtax1_tx' => array('name'=>'localtax1_tx','type'=>'xsd:string'), - 'localtax2_tx' => array('name'=>'localtax2_tx','type'=>'xsd:string'), - - 'stock_alert' => array('name'=>'stock_alert','type'=>'xsd:string'), - 'stock_real' => array('name'=>'stock_real','type'=>'xsd:string'), - 'stock_pmp' => array('name'=>'stock_pmp','type'=>'xsd:string'), - 'canvas' => array('name'=>'canvas','type'=>'xsd:string'), - 'import_key' => array('name'=>'import_key','type'=>'xsd:string'), - - 'dir' => array('name'=>'dir','type'=>'xsd:string'), - 'images' => array('name'=>'images','type'=>'tns:ImagesArray') - ) + $productorservice_fields ); @@ -357,47 +378,62 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='' if (! empty($product->multilangs[$langs->defaultlang]["label"])) $product->label = $product->multilangs[$langs->defaultlang]["label"]; if (! empty($product->multilangs[$langs->defaultlang]["description"])) $product->description = $product->multilangs[$langs->defaultlang]["description"]; if (! empty($product->multilangs[$langs->defaultlang]["note"])) $product->note = $product->multilangs[$langs->defaultlang]["note"]; - + + $productorservice_result_fields = array( + 'id' => $product->id, + 'ref' => $product->ref, + 'ref_ext' => $product->ref_ext, + 'label' => $product->label, + 'description' => $product->description, + 'date_creation' => dol_print_date($product->date_creation,'dayhourrfc'), + 'date_modification' => dol_print_date($product->date_modification,'dayhourrfc'), + 'note' => $product->note, + 'status_tosell' => $product->status, + 'status_tobuy' => $product->status_buy, + 'type' => $product->type, + 'barcode' => $product->barcode, + 'barcode_type' => $product->barcode_type, + 'country_id' => $product->country_id>0?$product->country_id:'', + 'country_code' => $product->country_code, + 'custom_code' => $product->customcode, + + 'price_net' => $product->price, + 'price' => $product->price_ttc, + 'price_min_net' => $product->price_min, + 'price_min' => $product->price_min_ttc, + 'price_base_type' => $product->price_base_type, + 'vat_rate' => $product->tva_tx, + //! French VAT NPR + 'vat_npr' => $product->tva_npr, + //! Spanish local taxes + 'localtax1_tx' => $product->localtax1_tx, + 'localtax2_tx' => $product->localtax2_tx, + + 'stock_real' => $product->stock_reel, + 'stock_alert' => $product->seuil_stock_alerte, + 'pmp' => $product->pmp, + 'import_key' => $product->import_key, + 'dir' => $pdir, + 'images' => $product->liste_photos($dir,$nbmax=10) + ); + + //Retreive all extrafield for thirdsparty + // fetch optionals attributes and labels + $extrafields=new ExtraFields($db); + $extralabels=$extrafields->fetch_name_optionals_label('product',true); + //Get extrafield values + $product->fetch_optionals($product->id,$extralabels); + + foreach($extrafields->attribute_label as $key=>$label) + { + $productorservice_result_fields=array_merge($productorservice_result_fields,array('options_'.$key => $product->array_options['options_'.$key])); + } + // Create $objectresp = array( 'result'=>array('result_code'=>'OK', 'result_label'=>''), - 'product'=>array( - 'id' => $product->id, - 'ref' => $product->ref, - 'ref_ext' => $product->ref_ext, - 'label' => $product->label, - 'description' => $product->description, - 'date_creation' => dol_print_date($product->date_creation,'dayhourrfc'), - 'date_modification' => dol_print_date($product->date_modification,'dayhourrfc'), - 'note' => $product->note, - 'status_tosell' => $product->status, - 'status_tobuy' => $product->status_buy, - 'type' => $product->type, - 'barcode' => $product->barcode, - 'barcode_type' => $product->barcode_type, - 'country_id' => $product->country_id>0?$product->country_id:'', - 'country_code' => $product->country_code, - 'custom_code' => $product->customcode, - - 'price_net' => $product->price, - 'price' => $product->price_ttc, - 'price_min_net' => $product->price_min, - 'price_min' => $product->price_min_ttc, - 'price_base_type' => $product->price_base_type, - 'vat_rate' => $product->tva_tx, - //! French VAT NPR - 'vat_npr' => $product->tva_npr, - //! Spanish local taxes - 'localtax1_tx' => $product->localtax1_tx, - 'localtax2_tx' => $product->localtax2_tx, - - 'stock_real' => $product->stock_reel, - 'stock_alert' => $product->seuil_stock_alerte, - 'pmp' => $product->pmp, - 'import_key' => $product->import_key, - 'dir' => $pdir, - 'images' => $product->liste_photos($dir,$nbmax=10) - )); + 'product'=>$productorservice_result_fields + ); } else { @@ -497,6 +533,14 @@ function createProductOrService($authentication,$product) }*/ //var_dump($product['ref_ext']); //var_dump($product['lines'][0]['type']); + + $extrafields=new ExtraFields($db); + $extralabels=$extrafields->fetch_name_optionals_label('product',true); + foreach($extrafields->attribute_label as $key=>$label) + { + $key='options_'.$key; + $newobject->array_options[$key]=$product[$key]; + } $db->begin(); @@ -608,6 +652,14 @@ function updateProductOrService($authentication,$product) }*/ //var_dump($product['ref_ext']); //var_dump($product['lines'][0]['type']); + + $extrafields=new ExtraFields($db); + $extralabels=$extrafields->fetch_name_optionals_label('product',true); + foreach($extrafields->attribute_label as $key=>$label) + { + $key='options_'.$key; + $newobject->array_options[$key]=$product[$key]; + } $db->begin(); @@ -875,6 +927,7 @@ function getProductsForCategory($authentication,$id,$lang='') { $obj = new Product($db); $obj->fetch($rec['fk_'.$field]); + $iProduct = 0; if($obj->status > 0 ) { $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); @@ -912,6 +965,20 @@ function getProductsForCategory($authentication,$id,$lang='') 'dir' => $pdir, 'images' => $obj->liste_photos($dir,$nbmax=10) ); + + //Retreive all extrafield for thirdsparty + // fetch optionals attributes and labels + $extrafields=new ExtraFields($db); + $extralabels=$extrafields->fetch_name_optionals_label('product',true); + //Get extrafield values + $product->fetch_optionals($obj->id,$extralabels); + + foreach($extrafields->attribute_label as $key=>$label) + { + $products[$iProduct]=array_merge($products[$iProduct],array('options_'.$key => $product->array_options['options_'.$key])); + } + + $iProduct++; } } From 3d7b6e9a266b9be510dc99ee57cbd68b178df3a8 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 24 May 2014 19:51:05 +0200 Subject: [PATCH 009/502] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2d7ff70aaa9..655d474aef3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,7 +3235,7 @@ abstract class CommonObject $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print "
 
"; + print ""; print '
'.$langs->trans('Margins').''.$langs->trans('SellingPrice').'pa_ht); ?>
pa_ht); ?>
pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?>
'; print ''; print ''; From dce9c2bc76820a1bdd2d934dc4e487dd027a5c91 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 28 May 2014 05:34:10 +0200 Subject: [PATCH 010/502] Fiscal year - 1st step --- htdocs/admin/fiscalyear.php | 315 +++++++++++++++++ htdocs/admin/fiscalyear_card.php | 325 ++++++++++++++++++ htdocs/core/class/fiscalyear.class.php | 272 +++++++++++++++ htdocs/core/menus/init_menu_auguria.sql | 19 +- htdocs/core/menus/standard/eldy.lib.php | 1 + htdocs/core/menus/standard/empty.php | 1 + .../tables/llx_accounting_fiscalyear.sql | 27 ++ htdocs/langs/en_US/admin.lang | 9 +- htdocs/langs/fr_FR/admin.lang | 7 +- 9 files changed, 964 insertions(+), 12 deletions(-) create mode 100644 htdocs/admin/fiscalyear.php create mode 100644 htdocs/admin/fiscalyear_card.php create mode 100644 htdocs/core/class/fiscalyear.class.php create mode 100644 htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql diff --git a/htdocs/admin/fiscalyear.php b/htdocs/admin/fiscalyear.php new file mode 100644 index 00000000000..7929fd5046f --- /dev/null +++ b/htdocs/admin/fiscalyear.php @@ -0,0 +1,315 @@ + + * + * 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 . + */ + +/** + * \file htdocs/admin/fiscalyear.php + * \ingroup fiscal year + * \brief Setup page to configure fiscal year + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; + +$action=GETPOST('action'); + +$langs->load("admin"); +$langs->load("compta"); + +if (! $user->admin) accessforbidden(); + +$error=0; + +// List of statut +static $tmpstatut2label=array( + '0'=>'OpenFiscalYear', + '1'=>'CloseFiscalYear' +); +$statut2label=array(''); +foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val); + +$mesg=''; +$errors=array(); + +$object = new Fiscalyear($db); + +/* + * Actions + */ + +// Add +if ($action == 'add') +{ + if (! GETPOST('cancel','alpha')) + { + $error=0; + + $object->label = GETPOST('label','alpha'); + $object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); + $object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); + $object->statut = 0; + + if (! $object->label) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'
'; + $error++; + } + if (! $object->datestart) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateStart")).'
'; + $error++; + } + if (! $object->dateend) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'
'; + $error++; + } + + if (! $error) + { + $id = $object->create(); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + $mesg=$object->error; + $action='create'; + } + } + else + { + $action='create'; + } + } + else + { + header("Location: index.php"); + exit; + } + + if (! GETPOST('cancel','alpha')) + { + $error=0; + + // Check values + $datestart = dol_mktime(12, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']); + $dateend = dol_mktime(12, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']); + $label = $_POST['label']; + + if (empty($label)) + { + $mesgs[]='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Label")).'
'; + $error++; + //$action='create'; + } + if (empty($datestart) || empty($dateend)) + { + $mesgs[]='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Date")).'
'; + $error++; + //$action='create'; + } + + if (! $error) + { + $this->db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_fiscalyear"; + $sql.= " (label, datestart, dateend, statut, entity)"; + $sql.= " VALUES('".$label."',"; + $sql.= " '".$datestart."',"; + $sql.= " '".$dateend."',"; + $sql.= " ' 0,"; + $sql.= " ".$conf->entity."'"; + $sql.=')'; + + dol_syslog(get_class($this)."::create_label sql=".$sql); + if ($this->db->query($sql)) + { + return 1; + } + else + { + $this->error=$this->db->lasterror(); + $this->errno=$this->db->lasterrno(); + return -1; + } + } + } +} + +// Rename field +if ($action == 'update') +{ + if ($_POST["button"] != $langs->trans("Cancel")) + { + // Check values + if (! GETPOST('type')) + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); + $action = 'create'; + } + if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring) + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring); + $action = 'edit'; + } + if (GETPOST('type')=='int' && $extrasize > $maxsizeint) + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint); + $action = 'edit'; + } + + if (! $error) + { + if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname'])) + { + $result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0)); + if ($result > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + $error++; + $mesg=$extrafields->error; + } + } + else + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); + } + } + } +} + +// Delete attribute +if ($action == 'delete') +{ + if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"])) + { + $result=$extrafields->delete($_GET["attrname"],$elementtype); + if ($result >= 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else $mesg=$extrafields->error; + } + else + { + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); + } +} + +/* + * View + */ + +$form = new Form($db); + +llxHeader('',$title); + +$title = $langs->trans('Accountancysetup'); + +print_fiche_titre($langs->trans('Fiscalyear')); + +dol_htmloutput_errors($mesg); + +$sql = "SELECT f.rowid, f.label, f.datestart, f.dateend, f.statut, f.entity"; +$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f"; +$sql.= " WHERE f.entity = ".$conf->entity; + +$result = $db->query($sql); + +$max=10; + +if ($result) +{ + $var=false; + $num = $db->num_rows($result); + + $i = 0; + + // Load attribute_label + print '
'.$langs->trans('Margins').'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($num) + { + $fiscalyearstatic=new Fiscalyear($db); + + while ($i < $num && $i < $max) + { + $obj = $db->fetch_object($result); + $fiscalyearstatic->ref=$obj->rowid; + $fiscalyearstatic->id=$obj->rowid; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + $var=!$var; + $i++; + } + + } + else + { + print ''; + } + + print '
'.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Statut").'
'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.''.$obj->label.''.dol_print_date($db->jdate($obj->datestart),'day').''.dol_print_date($db->jdate($obj->dateend),'day').''.$fiscalyearstatic->LibStatut($obj->statut,5).'
'.$langs->trans("None").'
'; + print ''; +} +else +{ + dol_print_error($db); +} + +dol_fiche_end(); + +// Buttons +print ''; + +llxFooter(); +$db->close(); \ No newline at end of file diff --git a/htdocs/admin/fiscalyear_card.php b/htdocs/admin/fiscalyear_card.php new file mode 100644 index 00000000000..d18fdbc3ec4 --- /dev/null +++ b/htdocs/admin/fiscalyear_card.php @@ -0,0 +1,325 @@ + + * + * 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 . + */ + +/** + * \file htdocs/admin/fiscalyear_card.php + * \brief Page to show a fiscal yeartrip + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + + +$langs->load("admin"); +$langs->load("compta"); + +// Security check +if (! $user->admin) accessforbidden(); + +$error=0; + +$action = GETPOST('action','alpha'); +$confirm = GETPOST('confirm','alpha'); +$id = GETPOST('id','int'); + +// List of statut +static $tmpstatut2label=array( + '0'=>'OpenFiscalYear', + '1'=>'CloseFiscalYear' +); +$statut2label=array(''); +foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val); + +$mesg = ''; + +$object = new Fiscalyear($db); + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once + +if ($action == 'confirm_delete' && $confirm == "yes") +{ + $result=$object->delete($id); + if ($result >= 0) + { + header("Location: fiscalyear.php"); + exit; + } + else + { + $mesg=$object->error; + } +} + +else if ($action == 'add') +{ + if (! GETPOST('cancel','alpha')) + { + $error=0; + + $object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); + $object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); + $object->label = GETPOST('label','alpha'); + $object->statut = GETPOST('statut','int');; + + /* + if (empty($object->datestart) && empty($object->dateend)) + { + $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")); + $error++; + } + */ + if (empty($object->label)) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'
'; + $error++; + } + + if (! $error) + { + $id = $object->create($user); + + if ($id > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + $mesg=$object->error; + $action='create'; + } + } + else + { + $action='create'; + } + } + else + { + header("Location: fiscalyear.php"); + exit; + } +} + +// Update record +else if ($action == 'update') +{ + if (! GETPOST('cancel','alpha')) + { + $result = $object->fetch($id); + + $object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); + $object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); + $object->label = GETPOST('label','alpha'); + $object->statut = GETPOST('statut','int'); + + $result = $object->update($user); + + if ($result > 0) + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } + else + { + $mesg=$object->error; + } + } + else + { + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + exit; + } +} + +/* + * View + */ + +llxHeader(); + +$form = new Form($db); + +/* + * Action create +*/ +if ($action == 'create') +{ + print_fiche_titre($langs->trans("NewFiscalYear")); + + dol_htmloutput_errors($mesg); + + $datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); + $dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); + + print '
' . "\n"; + print ''; + print ''; + + print ''; + + // Label + print ''; + + // Date start + print ""; + print ''; + + // Date end + print ""; + print ''; + + // Statut + print ''; + print ''; + print ''; + + print '
'.$langs->trans("Label").'
'.$langs->trans("DateStart").''; + print $form->select_date($datestart?$datestart:-1,'','','','','add',1,1); + print '
'.$langs->trans("DateEnd").''; + print $form->select_date($dateend?$dateend:-1,'','','','','add',1,1); + print '
'.$langs->trans("Statut").''.$form->selectarray('statut',$statut2label,GETPOST('statut')).'
'; + + print '
    '; + print ''; +} +else if ($id) +{ + $result = $object->fetch($id); + if ($result > 0) + { + dol_htmloutput_mesg($mesg); + + if ($action == 'edit') + { + print '' . "\n"; + print ''; + print ''; + print ''; + + print ''; + + // Ref + print ""; + print ''; + + // Label + print ''; + + // Date start + print ''; + + // Date end + print ''; + + print '
'.$langs->trans("Ref").''; + print $object->rowid; + print '
'.$langs->trans("Label").''; + print ''; + print '
'.$langs->trans("DateStart").''; + print $form->select_date($object->datestart,'','','','','update'); + print '
'.$langs->trans("DateEnd").''; + print $form->select_date($object->dateend,'','','','','update'); + print '
'; + + print '
  '; + print ''; + print '
'; + + print ''; + + print ''; + } + else + { + /* + * Confirm delete + */ + if ($action == 'delete') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteFiscalYear"),$langs->trans("ConfirmDeleteFiscalYear"),"confirm_delete"); + + } + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Label + print '"; + + // Date start + print ''; + + // Date end + print ''; + + // Statut + print ''; + + print "
'.$langs->trans("Ref").''; + print $object->rowid; + print ''; + print $linkback; + print '
'; + print $form->editfieldkey("Label",'label',$object->label,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'alpha:32'); + print ''; + print $form->editfieldval("Label",'label',$object->label,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'alpha:32'); + print "
'; + print $form->editfieldkey("Date",'datestart',$object->datestart,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker'); + print ''; + print $form->editfieldval("Date",'datestart',$object->datestart,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker'); + print '
'; + print $form->editfieldkey("Date",'dateend',$object->dateend,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker'); + print ''; + print $form->editfieldval("Date",'dateend',$object->dateend,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker'); + print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'

"; + + print ''; + + /* + * Barre d'actions + */ + + print '
'; + + print ''.$langs->trans('Modify').''; + + print ''.$langs->trans('Delete').''; + + print '
'; + } + } + else + { + dol_print_error($db); + } +} + +llxFooter(); +$db->close(); diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php new file mode 100644 index 00000000000..3d48d47a082 --- /dev/null +++ b/htdocs/core/class/fiscalyear.class.php @@ -0,0 +1,272 @@ + + * + * 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 . + */ + +/** + * \file htdocs/core/class/fiscalyear.php + * \ingroup fiscal year + * \brief Page d'administration/configuration + */ + +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; + +/** + * Class to manage fiscal year + */ +class Fiscalyear +{ + public $element='Fiscalyear'; + public $table_element='accounting_fiscalyear'; + public $table_element_line = ''; + public $fk_element = ''; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + var $id; + var $rowid; + + var $label; + var $datestart; + var $dateend; + var $statut; // 0=open, 1=closed + var $entity; + + var $statuts=array(); + var $statuts_short=array(); + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + + $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + + return 1; + } + + /** + * Create object in database + * + * @return int <0 if KO, >0 if OK + */ + function create() + { + global $conf; + + $this->db->begin(); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_fiscalyear ("; + $sql.= " label"; + $sql.= ", datestart"; + $sql.= ", dateend"; + $sql.= ", statut"; + $sql.= ", entity"; + $sql.= ") VALUES ("; + $sql.= " '".$this->label; + $sql.= "', ".$this->db->idate($this->datestart); + $sql.= ", ".$this->db->idate($this->dateend); + $sql.= ", ".$this->statut; + $sql.= ", ".$conf->entity; + $sql.= ")"; + + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } + + if (! $error) + { + $this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_fiscalyear"); + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return $this->rowid; + } + + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_fiscalyear"); + + $result=$this->update($user); + if ($result > 0) + { + $this->db->commit(); + return $this->rowid; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return $result; + } + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -1; + } + } + + /** + * Update record + * + * @param User $user User making update + * @return int <0 if KO, >0 if OK + */ + function update($user) + { + global $langs; + + // Check parameters + if (empty($this->datestart) && empty($this->dateend)) + { + $this->error='ErrorBadParameter'; + return -1; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $sql .= " SET label = ".$this->label; + $sql .= " , datestart = '".$this->db->idate($this->datestart)."'"; + $sql .= " , dateend = '".$this->db->idate($this->dateend)."'"; + $sql .= " , statut = '".$this->statut."'"; + $sql .= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + + /** + * Load an object from database + * + * @param int $id Id of record to load + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + $sql = "SELECT rowid, label, datestart, dateend, statut"; + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear"; + $sql.= " WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ( $result ) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->datestart = $this->db->jdate($obj->datestart); + $this->dateend = $this->db->jdate($obj->dateend); + $this->label = $obj->label; + $this->statut = $obj->statut; + + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + + /** + * Give a label from a status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->statut,$mode); + } + + /** + * Give a label from a status + * + * @param int $statut Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label + */ + function LibStatut($statut,$mode=0) + { + global $langs; + + if ($mode == 0) + { + return $langs->trans($this->statuts[$statut]); + } + if ($mode == 1) + { + return $langs->trans($this->statuts_short[$statut]); + } + if ($mode == 2) + { + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + } + if ($mode == 3) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + } + if ($mode == 4) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + } + if ($mode == 5) + { + if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + } + } + +} \ No newline at end of file diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index f8e5828bbd1..b5e85d7830d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -25,16 +25,17 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 10, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 11, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'Dictionary', 1, 'admin', '', '', 2, 12, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 13, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 11, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 12, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'Dictionary', 1, 'admin', '', '', 2, 13, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 14, __ENTITY__); -- Home - Sytem info insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?leftmenu=admintools', 'SystemTools', 0, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 35b3f78c5e7..29ad35214cd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -501,6 +501,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1); $newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1); $newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1); + $newmenu->add("/admin/fiscalyear.php?mainmenu=home", $langs->trans("Fiscalyear"),1); if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES'))) { if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1); diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index f316d334928..a6063c84d18 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -115,6 +115,7 @@ class MenuManager $this->menu->add("/admin/modules.php", $langs->trans("Modules"),1); $this->menu->add("/admin/menus.php", $langs->trans("Menus"),1); $this->menu->add("/admin/ihm.php", $langs->trans("GUISetup"),1); + $this->menu->add("/admin/fiscalyear.php", $langs->trans("Fiscalyear"),1); $this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1); $this->menu->add("/admin/delais.php",$langs->trans("Alerts"),1); $this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1); diff --git a/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql new file mode 100644 index 00000000000..fe8563d7250 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_accounting_fiscalyear.sql @@ -0,0 +1,27 @@ +-- ============================================================================ +-- Copyright (C) 2014 Alexandre Spangaro +-- +-- 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 . +-- +-- ============================================================================ + +create table llx_accounting_fiscalyear +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(128) NOT NULL, + datestart date, + dateend date, + statut tinyint DEFAULT 0 NOT NULL, + entity integer DEFAULT 1 NOT NULL -- multi company id +)ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d22e27c1cbf..1f3cb7ed0c1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1496,7 +1496,12 @@ TasksNumberingModules=Tasks numbering module TaskModelModule=Tasks reports document model ##### ECM (GED) ##### ECMSetup = GED Setup -ECMAutoTree = Automatic tree folder and document - +ECMAutoTree = Automatic tree folder and document +##### Fiscal Year ##### +Fiscalyear=Fiscal years +OpenFiscalYear=Open fiscal year +CloseFiscalYear=Close fiscal year +Opened=Opened +Closed=Closed Format=Format \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 059e3e4bac2..bc29d977ed2 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1497,6 +1497,11 @@ TaskModelModule=Modèles de document de rapport tâches ##### ECM (GED) ##### ECMSetup = Configuration du module GED ECMAutoTree = L'arborescence automatique est disponible - +##### Fiscal Year ##### +Fiscalyear=Exercices fiscaux +OpenFiscalYear=Exercice fiscal ouvert +CloseFiscalYear=Exercice fiscal fermé +Opened=Ouvert +Closed=Fermé Format=Format From c19eabf71115787a0cd9c5ec96a7ab21d24ac847 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 29 May 2014 14:26:27 +0200 Subject: [PATCH 011/502] Better target emailing status mangement --- htdocs/comm/mailing/cibles.php | 43 ++++++++--- htdocs/comm/mailing/class/mailing.class.php | 64 +++++++++++++++ htdocs/comm/mailing/fiche.php | 2 +- htdocs/core/class/html.formmailing.class.php | 77 +++++++++++++++++++ .../core/modules/mailings/pomme.modules.php | 2 +- 5 files changed, 177 insertions(+), 11 deletions(-) create mode 100644 htdocs/core/class/html.formmailing.class.php diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 93e66c0c497..b4a25e0cedd 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2014 Florian Henry * * 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 @@ -26,6 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -54,6 +56,7 @@ $action=GETPOST("action"); $search_lastname=GETPOST("search_lastname"); $search_firstname=GETPOST("search_firstname"); $search_email=GETPOST("search_email"); +$search_dest_status=GETPOST('search_dest_status'); // Search modules dirs $modulesdir = dolGetModulesDirs('/mailings'); @@ -168,6 +171,7 @@ if ($_POST["button_removefilter"]) llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'); $form = new Form($db); +$formmailing = new FormMailing($db); if ($object->fetch($id) >= 0) { @@ -220,7 +224,7 @@ if ($object->fetch($id) >= 0) $var=!$var; - $allowaddtarget=($object->statut == 0 || $object->statut == 1); + $allowaddtarget=($object->statut == 0); // Show email selectors if ($allowaddtarget && $user->rights->mailing->creer) @@ -357,6 +361,7 @@ if ($object->fetch($id) >= 0) if ($search_lastname) $sql.= " AND mc.lastname LIKE '%".$db->escape($search_lastname)."%'"; if ($search_firstname) $sql.= " AND mc.firstname LIKE '%".$db->escape($search_firstname)."%'"; if ($search_email) $sql.= " AND mc.email LIKE '%".$db->escape($search_email)."%'"; + if (!empty($search_dest_status)) $sql.= " AND mc.statut=".$db->escape($search_dest_status)." "; $sql .= $db->order($sortfield,$sortorder); $sql .= $db->plimit($conf->liste_limit+1, $offset); @@ -376,7 +381,9 @@ if ($object->fetch($id) >= 0) print ''; print ''; - $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; + if ($allowaddtarget) { + $cleartext='
'.$langs->trans("ToClearAllRecipientsClickHere").': '.''; + } print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,''); @@ -399,7 +406,7 @@ if ($object->fetch($id) >= 0) print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder); - // Date sendinf + // Date sending if ($object->statut < 2) { print ' '; @@ -412,6 +419,11 @@ if ($object->fetch($id) >= 0) // Statut print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder); + //Search Icon + print ''; + print ' '; + print ''; + print ''; // Ligne des champs de filtres @@ -433,7 +445,20 @@ if ($object->fetch($id) >= 0) print ' '; print ''; // Source - print ''; + print ''; + print ' '; + print ''; + + // Date sending + print ''; + print ' '; + print ''; + //Statut + print ''; + print $formmailing->select_destinaries_status($search_dest_status,'search_dest_status',1); + print ''; + //Search Icon + print ''; print ''; print '  '; print ''; @@ -495,7 +520,7 @@ if ($object->fetch($id) >= 0) { print ' '; print ''.$langs->trans("MailingStatusNotSent"); - if ($user->rights->mailing->creer) { + if ($user->rights->mailing->creer && $allowaddtarget) { print ''.img_delete($langs->trans("RemoveRecipient")); } print ''; @@ -504,12 +529,12 @@ if ($object->fetch($id) >= 0) { print ''.$obj->date_envoi.''; print ''; - if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error(); - if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); - if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); - if ($obj->statut==3) print $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut5'); + print $object::LibStatutDest($obj->statut,2); print ''; } + + //Sreach Icon + print ''; print ''; $i++; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 99b1a2f4419..ac53567c3ca 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -60,6 +60,9 @@ class Mailing extends CommonObject var $extraparams=array(); + public $statut_dest=array(); + public $statuts=array(); + /** * Constructor @@ -75,6 +78,12 @@ class Mailing extends CommonObject $this->statuts[1] = 'MailingStatusValidated'; $this->statuts[2] = 'MailingStatusSentPartialy'; $this->statuts[3] = 'MailingStatusSentCompletely'; + + $this->statut_dest[-1] = 'MailingStatusError'; + $this->statut_dest[1] = 'MailingStatusSent'; + $this->statut_dest[2] = 'MailingStatusRead'; + $this->statut_dest[3] = 'MailingStatusNotContact'; + } /** @@ -512,5 +521,60 @@ class Mailing extends CommonObject } } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $statut Id statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label + */ + static public function LibStatutDest($statut,$mode=0) + { + global $langs; + $langs->load('mails'); + + if ($mode == 0) + { + return $langs->trans($this->statut_dest[$statut]); + } + if ($mode == 1) + { + return $langs->trans($this->statut_dest[$statut]); + } + if ($mode == 2) + { + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); + if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); + if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + } + if ($mode == 3) + { + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); + if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); + if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + } + if ($mode == 4) + { + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); + if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); + if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + } + if ($mode == 5) + { + if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error(); + if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); + if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); + if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + } + + + + + } + } diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 6a49dd0865b..5d45877e707 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -839,7 +839,7 @@ else { print "\n\n
\n"; - if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer) + if (($object->statut == 0) && $user->rights->mailing->creer) { print ''.$langs->trans("EditMailing").''; } diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php new file mode 100644 index 00000000000..ccb91144a78 --- /dev/null +++ b/htdocs/core/class/html.formmailing.class.php @@ -0,0 +1,77 @@ +. +*/ + +/** + * \file htdocs/core/class/html.formmailing.class.php + * \ingroup core + * \brief File of predefined functions for HTML forms for mailing module + */ +require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; + +/** + * Class to offer components to list and upload files + */ +class FormMailing extends Form +{ + public $db; + public $error; + public $errors=array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + return 1; + } + + public function select_destinaries_status($selectedid='',$htmlname='dest_status', $show_empty=0) { + + global $langs; + $langs->load("mails"); + + require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; + $mailing = new Mailing($this->db); + + + $array = $mailing->statut_dest; + //Cannot use form->selectarray because empty value is defaulted to -1 in this method and we use here status -1... + + $out = ''; + return $out; + } + +} \ No newline at end of file diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index e038cfd3ceb..90818d0c9f3 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -148,7 +148,7 @@ class mailing_pomme extends MailingTargets // La requete doit retourner: id, email, fk_contact, name, firstname $sql = "SELECT u.rowid as id, u.email as email, null as fk_contact,"; - $sql.= " u.lastname as name, u.firstname as firstname, u.civilite as civility_id, u.login, u.office_phone"; + $sql.= " u.lastname, u.firstname as firstname, u.civilite as civility_id, u.login, u.office_phone"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql.= " AND u.entity IN (0,".$conf->entity.")"; From d15c3b2c23d68ab8ba40e9983bb41bdc496dab5f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 29 May 2014 14:30:09 +0200 Subject: [PATCH 012/502] CRLF --- htdocs/core/class/html.formmailing.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index ccb91144a78..dc6c6eda79a 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -73,5 +73,4 @@ class FormMailing extends Form $out .= ''; return $out; } - } \ No newline at end of file From 0cfd4504adeaeaa46372609ed7cf34a1794b45a7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 29 May 2014 14:48:07 +0200 Subject: [PATCH 013/502] add index on llx_mailing_cible --- htdocs/install/mysql/migration/3.5.0-3.6.0.sql | 2 ++ htdocs/install/mysql/tables/llx_mailing_cibles.key.sql | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index 176568def37..c1db2545929 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -1197,3 +1197,5 @@ create table llx_c_type_resource )ENGINE=innodb; ALTER TABLE llx_c_type_resource ADD UNIQUE INDEX uk_c_type_resource_id (label, code); + +ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_fk_mailing_email (fk_mailing,email); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql index 721344355f4..1f005dff052 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql @@ -21,3 +21,5 @@ ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email); ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email); +ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_fk_mailing_email (fk_mailing,email); + From a88491ecc6f7652c7456b10c80e156fb187f0487 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 29 May 2014 14:51:42 +0200 Subject: [PATCH 014/502] reset last commit --- htdocs/install/mysql/tables/llx_mailing_cibles.key.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql index 1f005dff052..721344355f4 100644 --- a/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql +++ b/htdocs/install/mysql/tables/llx_mailing_cibles.key.sql @@ -21,5 +21,3 @@ ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email); ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email); -ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_fk_mailing_email (fk_mailing,email); - From f87772f3ec3c469e91d9069b0cab23abcfbdd77b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 29 May 2014 14:56:55 +0200 Subject: [PATCH 015/502] Add comment for travis --- htdocs/core/class/html.formmailing.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index dc6c6eda79a..14fbea3b0f9 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -43,6 +43,14 @@ class FormMailing extends Form return 1; } + /** + * Output a select with destinaries status + * + * @param string $selectedid the selected id + * @param string $htmlname name of controm + * @param number $show_empty show empty option + * @return string HTML select + */ public function select_destinaries_status($selectedid='',$htmlname='dest_status', $show_empty=0) { global $langs; From 0de66e838ce23ac7f270b70eb4e4810f5e14ca71 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 30 May 2014 12:01:26 +0200 Subject: [PATCH 016/502] camel case --- htdocs/comm/mailing/cibles.php | 4 ++-- htdocs/comm/mailing/class/mailing.class.php | 2 +- htdocs/core/class/html.formmailing.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 613c040b74c..14aea7c89c7 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -457,7 +457,7 @@ if ($object->fetch($id) >= 0) print ''; //Statut print ''; - print $formmailing->select_destinaries_status($search_dest_status,'search_dest_status',1); + print $formmailing->selectDestinariesStatus($search_dest_status,'search_dest_status',1); print ''; //Search Icon print ''; @@ -531,7 +531,7 @@ if ($object->fetch($id) >= 0) { print ''.$obj->date_envoi.''; print ''; - print $object::LibStatutDest($obj->statut,2); + print $object::libStatutDest($obj->statut,2); print ''; } diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index ac53567c3ca..1b2b26d7fd0 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -529,7 +529,7 @@ class Mailing extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - static public function LibStatutDest($statut,$mode=0) + static public function libStatutDest($statut,$mode=0) { global $langs; $langs->load('mails'); diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index 14fbea3b0f9..98a76c84686 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -51,7 +51,7 @@ class FormMailing extends Form * @param number $show_empty show empty option * @return string HTML select */ - public function select_destinaries_status($selectedid='',$htmlname='dest_status', $show_empty=0) { + public function selectDestinariesStatus($selectedid='',$htmlname='dest_status', $show_empty=0) { global $langs; $langs->load("mails"); From 67f05515d9eb152c8a32be0bbeb5341fa2a4c908 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 3 Jun 2014 06:19:24 +0200 Subject: [PATCH 017/502] Add accountancy_code into llx_c_paiement --- htdocs/admin/dict.php | 10 +++++----- htdocs/install/mysql/tables/llx_c_paiement.sql | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d834929d00f..38fdf20d2c4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2013 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2012 Alexandre Spangaro + * Copyright (C) 2011-2014 Alexandre Spangaro * * 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 @@ -144,7 +144,7 @@ $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PRE $tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; -$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; +$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active, accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c"; $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; @@ -202,7 +202,7 @@ $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; -$tabfield[13]= "code,libelle,type"; +$tabfield[13]= "code,libelle,type,accountancy_code"; $tabfield[14]= "code,libelle,price,organization,country_id,country"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle,sortorder"; @@ -231,7 +231,7 @@ $tabfieldvalue[9] = "code,label,unicode"; $tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; -$tabfieldvalue[13]= "code,libelle,type"; +$tabfieldvalue[13]= "code,libelle,type,accountancy_code"; $tabfieldvalue[14]= "code,libelle,price,organization,country"; $tabfieldvalue[15]= "code,libelle,width,height,unit"; $tabfieldvalue[16]= "code,libelle,sortorder"; @@ -260,7 +260,7 @@ $tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage"; -$tabfieldinsert[13]= "code,libelle,type"; +$tabfieldinsert[13]= "code,libelle,type,accountancy_code"; $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; $tabfieldinsert[15]= "code,label,width,height,unit"; $tabfieldinsert[16]= "code,label,sortorder"; diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index 8d78992a4f8..cc2f7500ab1 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -1,6 +1,7 @@ -- ======================================================================== -- Copyright (C) 2001-2004 Rodolphe Quiedeville -- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 @@ -26,12 +27,13 @@ create table llx_c_paiement ( - id integer PRIMARY KEY, - code varchar(6) NOT NULL, - libelle varchar(30), - type smallint, - active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL + id integer PRIMARY KEY, + code varchar(6) NOT NULL, + libelle varchar(30), + type smallint, + active tinyint DEFAULT 1 NOT NULL, + accountancy_code varchar(32) DEFAULT NULL, + module varchar(32) NULL )ENGINE=innodb; From 06690431f2fde4e0f52b20a35bcc477c33fe8b5c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 6 Jun 2014 12:26:05 +0200 Subject: [PATCH 018/502] Update commande.class.php research additionnal models numbering in additional modules folders --- htdocs/commande/class/commande.class.php | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e2b0f5506fb..97ee6714ef0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -131,18 +131,21 @@ class Commande extends CommonOrder if (! empty($conf->global->COMMANDE_ADDON)) { - $mybool=false; - - $file = $conf->global->COMMANDE_ADDON.".php"; - $classname = $conf->global->COMMANDE_ADDON; - - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/commande/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } + $mybool=false; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + $file = $conf->global->COMMANDE_ADDON.".php"; + $classname = $conf->global->COMMANDE_ADDON; + + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot.$reldir."/core/modules/commande/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + } if (! $mybool) { From d0bab2f7e22c970cf097709b7382f0799dc2d115 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 6 Jun 2014 12:29:20 +0200 Subject: [PATCH 019/502] Update propal.class.php research additionnal models numbering in additional modules folders --- htdocs/comm/propal/class/propal.class.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 070f0232215..1b8cac86320 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2535,16 +2535,21 @@ class Propal extends CommonObject { $mybool=false; - $file = $conf->global->PROPALE_ADDON.".php"; - $classname = $conf->global->PROPALE_ADDON; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + $file = $conf->global->PROPALE_ADDON.".php"; + $classname = $conf->global->PROPALE_ADDON; + + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot.$reldir."/core/modules/propale/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + } - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/propale/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } if (! $mybool) { From 37c908aa9960fa404391d76e2e1626408d2adb07 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 6 Jun 2014 15:29:45 +0200 Subject: [PATCH 020/502] Update modules_propale.php don't display specific number of version --- htdocs/core/modules/propale/modules_propale.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 289862c8523..ed2673a1e70 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -138,6 +138,7 @@ abstract class ModeleNumRefPropales if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } From f806b4373a11b287372f011970a682fca57bde3a Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 6 Jun 2014 15:30:33 +0200 Subject: [PATCH 021/502] Update modules_commande.php don't display specific version --- htdocs/core/modules/commande/modules_commande.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index 1146b1cc181..9116205d287 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -142,6 +142,7 @@ abstract class ModeleNumRefCommandes if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } From 174b4ee6a26d9d17d7202bd2e3a3895f19939991 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 8 Jun 2014 14:35:07 +0200 Subject: [PATCH 022/502] add dynamic keypad on cashdesk --- htdocs/cashdesk/include/keypad.php | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 htdocs/cashdesk/include/keypad.php diff --git a/htdocs/cashdesk/include/keypad.php b/htdocs/cashdesk/include/keypad.php new file mode 100644 index 00000000000..e8c3780f348 --- /dev/null +++ b/htdocs/cashdesk/include/keypad.php @@ -0,0 +1,44 @@ + + * + * 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 . + */ + +function genkeypad($keypadname, $formname) +{ + // défine the font size of button + $btnsize=32; + $sz=''."\n"; + $sz.='
'."\n"; + $sz.=''; + return $sz; +} +?> From 2503a69f98484be9df918ed020e7ed168f6ad41f Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 8 Jun 2014 14:35:53 +0200 Subject: [PATCH 023/502] Create keypad.js --- htdocs/cashdesk/javascript/keypad.js | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 htdocs/cashdesk/javascript/keypad.js diff --git a/htdocs/cashdesk/javascript/keypad.js b/htdocs/cashdesk/javascript/keypad.js new file mode 100644 index 00000000000..6de759fc35a --- /dev/null +++ b/htdocs/cashdesk/javascript/keypad.js @@ -0,0 +1,36 @@ +/* Copyright (C) 2014 Charles-FR BENKE + * + * 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 . + */ + +function closekeypad(keypadname) +{ + document.getElementById('keypad'+keypadname).style.display='none'; + document.getElementById('closekeypad'+keypadname).style.display='none'; + document.getElementById('openkeypad'+keypadname).style.display='inline-block'; +} +function openkeypad(keypadname) +{ + document.getElementById('keypad'+keypadname).style.display='inline-block'; + document.getElementById('closekeypad'+keypadname).style.display='inline-block'; + document.getElementById('openkeypad'+keypadname).style.display='none'; +} +function addvalue(keypadname, formname, valueToAdd) +{ + myform=document.forms[formname]; + if (myform.elements[keypadname].value=="0") + myform.elements[keypadname].value=""; + myform.elements[keypadname].value+=valueToAdd; + modif(); +} From 32a1086ff779eda708585ffce33b521e2175d9de Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 8 Jun 2014 14:36:31 +0200 Subject: [PATCH 024/502] Update affIndex.php --- htdocs/cashdesk/affIndex.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/cashdesk/affIndex.php b/htdocs/cashdesk/affIndex.php index df282cd6df1..39f290c9b04 100644 --- a/htdocs/cashdesk/affIndex.php +++ b/htdocs/cashdesk/affIndex.php @@ -25,6 +25,7 @@ */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; +require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/keypad.php'; // Test if already logged if ( $_SESSION['uid'] <= 0 ) @@ -75,4 +76,4 @@ include_once 'affPied.php'; print '
'."\n"; print ''."\n"; -?> \ No newline at end of file +?> From e30fd28b02beb927da7c9601204e0673da04608e Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 8 Jun 2014 14:39:04 +0200 Subject: [PATCH 025/502] Update facturation1.tpl.php --- htdocs/cashdesk/tpl/facturation1.tpl.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index d8e4049f922..27c153b3799 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -28,6 +28,7 @@ $langs->load("cashdesk"); +
trans("Article"); ?> @@ -103,7 +104,9 @@ $langs->load("cashdesk"); trans("VATRate"); ?> - + + + @@ -112,7 +115,9 @@ $langs->load("cashdesk"); currency; ?> - + + + currency; ?> @@ -154,7 +159,9 @@ $langs->load("cashdesk"); - + + + From ae4bd4445e8142331bdc4ae9da63a97e89e7dd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 9 Jun 2014 15:38:43 +0200 Subject: [PATCH 026/502] Moved dol_syslog query log to the database handler and decreased report level to DEBUG --- htdocs/admin/menus/index.php | 1 - htdocs/comm/mailing/liste.php | 1 - htdocs/compta/bank/categ.php | 3 --- htdocs/compta/bank/releve.php | 1 - htdocs/compta/dons/class/don.class.php | 4 ---- htdocs/compta/journal/purchasesjournal.php | 1 - htdocs/compta/journal/sellsjournal.php | 1 - htdocs/compta/paiement/cheque/fiche.php | 1 - htdocs/core/db/mssql.class.php | 2 ++ htdocs/core/db/mysql.class.php | 2 ++ htdocs/core/db/mysqli.class.php | 2 ++ htdocs/core/db/pgsql.class.php | 3 +++ htdocs/core/db/sqlite.class.php | 2 ++ htdocs/core/lib/functions2.lib.php | 3 --- htdocs/core/modules/mailings/contacts3.modules.php | 1 - htdocs/fichinter/class/fichinter.class.php | 1 - htdocs/fourn/class/paiementfourn.class.php | 2 -- htdocs/opensurvey/class/opensurveysondage.class.php | 1 - htdocs/opensurvey/exportcsv.php | 1 - htdocs/opensurvey/public/studs.php | 1 - htdocs/opensurvey/results.php | 4 ---- htdocs/societe/consumption.php | 1 - htdocs/user/perms.php | 1 - scripts/emailings/mailing-send.php | 1 - 24 files changed, 11 insertions(+), 30 deletions(-) diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index e598afe07a3..bade95cdcce 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -304,7 +304,6 @@ if ($conf->use_javascript_ajax) $sql.= " AND fk_menu >= 0"; $sql.= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same) - dol_syslog("sql=".$sql); $res = $db->query($sql); if ($res) { diff --git a/htdocs/comm/mailing/liste.php b/htdocs/comm/mailing/liste.php index 617096561a3..3e06e5af005 100644 --- a/htdocs/comm/mailing/liste.php +++ b/htdocs/comm/mailing/liste.php @@ -82,7 +82,6 @@ else $sql.= $db->plimit($conf->liste_limit +1, $offset); } -dol_syslog("sql=".$sql); //print $sql; $result = $db->query($sql); if ($result) diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 41abab1ace0..5aa72d4c049 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -52,7 +52,6 @@ if (GETPOST('add')) $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog("sql=".$sql); $result = $db->query($sql); if (!$result) { @@ -73,7 +72,6 @@ if (GETPOST('update')) $sql.= " WHERE rowid = '".GETPOST('categid')."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog("sql=".$sql); $result = $db->query($sql); if (!$result) { @@ -92,7 +90,6 @@ if ($action == 'delete') $sql.= " WHERE rowid = '".GETPOST('categid')."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog("sql=".$sql); $result = $db->query($sql); if (!$result) { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 0d0246f28e6..dba271e672b 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -277,7 +277,6 @@ else $sql.= " AND b.fk_account = ba.rowid"; $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day - dol_syslog("sql=".$sql); $result = $db->query($sql); if ($result) { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index f7bd819d969..a37b0433c80 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -535,7 +535,6 @@ class Don extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 1, fk_user_valid = $userid WHERE rowid = $rowid AND fk_statut = 0"; - dol_syslog("sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -571,7 +570,6 @@ class Don extends CommonObject } $sql .= " WHERE rowid = $rowid AND fk_statut = 1"; - dol_syslog("sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -603,7 +601,6 @@ class Don extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2"; - dol_syslog("sql=".$sql); $resql=$this->db->query($sql); if ($resql) { @@ -633,7 +630,6 @@ class Don extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$rowid; - dol_syslog("sql=".$sql); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 52562ed0244..5e481b49dcc 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -117,7 +117,6 @@ if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start // TODO Find a better trick to avoid problem with some mysql installations if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1'); -dol_syslog("sql=".$sql); $result = $db->query($sql); if ($result) { diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 931b8757470..ce8bd9c7944 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -121,7 +121,6 @@ $sql.= " ORDER BY f.rowid"; // TODO Find a better trick to avoid problem with some mysql installations if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1'); -dol_syslog("sql=".$sql); $result = $db->query($sql); if ($result) { diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index fe396976f10..a2bf8a7bede 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -609,7 +609,6 @@ else $sql.= " AND b.fk_bordereau = ".$object->id; $sql.= " ORDER BY $sortfield $sortorder"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index bf67bd7d8b3..52c4fc85de1 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -359,6 +359,8 @@ class DoliDBMssql extends DoliDB $ret = mssql_query($query, $this->db); } + dol_syslog('sql='.$query, LOG_DEBUG); + if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index ab9d6e5850e..00cc3868cd6 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -263,6 +263,8 @@ class DoliDBMysql extends DoliDB $ret = mysql_query($query, $this->db); } + dol_syslog('sql='.$query, LOG_DEBUG); + if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 40061a4fa1a..336780a1a09 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -265,6 +265,8 @@ class DoliDBMysqli extends DoliDB $ret = mysqli_query($this->db,$query); } + dol_syslog('sql='.$query, LOG_DEBUG); + if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 155977cc8d1..b5959df1f63 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -492,6 +492,9 @@ class DoliDBPgsql extends DoliDB } $ret = @pg_query($this->db, $query); + + dol_syslog('sql='.$query, LOG_DEBUG); + //print $query; if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) // Si requete utilisateur, on la sauvegarde ainsi que son resultset { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index ad5c6532c9e..f06a92c401f 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -399,6 +399,8 @@ class DoliDBSqlite extends DoliDB $this->error=$e->getMessage(); } + dol_syslog('sql='.$query, LOG_DEBUG); + if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 917ceaf0e65..2f2a313699a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1582,7 +1582,6 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) // Check loops on each other $sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree." SET ".$fieldfkparent." = 0 WHERE ".$fieldfkparent." = rowid"; // So we update only records linked to themself - dol_syslog("sql=".$sql); $resql = $db->query($sql); if ($resql) { @@ -1623,7 +1622,6 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree; $sql.= " SET ".$fieldfkparent." = 0"; $sql.= " WHERE rowid IN (".join(',',$listofidtoclean).")"; // So we update only records detected wrong - dol_syslog("sql=".$sql); $resql = $db->query($sql); if ($resql) { @@ -1643,7 +1641,6 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent) $sql = "UPDATE ".MAIN_DB_PREFIX.$tabletocleantree; $sql.= " SET ".$fieldfkparent." = 0"; $sql.= " WHERE ".$fieldfkparent." NOT IN (".join(',',$listofid).")"; // So we update only records linked to a non existing parent - dol_syslog("sql=".$sql); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php index 4c6480b8812..2cf5a708056 100644 --- a/htdocs/core/modules/mailings/contacts3.modules.php +++ b/htdocs/core/modules/mailings/contacts3.modules.php @@ -92,7 +92,6 @@ class mailing_contacts3 extends MailingTargets if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; $sql.= " ORDER BY sp.lastname, sp.firstname"; - dol_syslog("sql=".$sql); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index d7bb50682fe..52585d29122 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -875,7 +875,6 @@ class Fichinter extends CommonObject $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog("sql=".$sql); if ($this->db->query($sql)) { $this->fk_contrat = $contractid; diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 627b2de0d84..69912e77cb0 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -286,13 +286,11 @@ class PaiementFourn extends Paiement // Efface la ligne de paiement (dans paiement_facture et paiement) $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn'; $sql.= ' WHERE fk_paiementfourn = '.$this->id; - dol_syslog("sql=".$sql); $resql = $this->db->query($sql); if ($resql) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'paiementfourn'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog("sql=".$sql); $result = $this->db->query($sql); if (! $result) { diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 37c04e50a29..602f5405ca2 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -474,7 +474,6 @@ class Opensurveysondage extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."opensurvey_comments (id_sondage, comment, usercomment)"; $sql.= " VALUES ('".$this->db->escape($this->id_sondage)."','".$this->db->escape($comment)."','".$this->db->escape($comment_user)."')"; $resql = $this->db->query($sql); - dol_syslog("sql=".$sql); if (!$resql) { return false; diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php index 2c31b67f574..fec8174a7ef 100644 --- a/htdocs/opensurvey/exportcsv.php +++ b/htdocs/opensurvey/exportcsv.php @@ -86,7 +86,6 @@ $sql ='SELECT nom, reponses'; $sql.=' FROM '.MAIN_DB_PREFIX."opensurvey_user_studs"; $sql.=" WHERE id_sondage='" . $db->escape($numsondage) . "'"; $sql.=" ORDER BY id_users"; -dol_syslog("sql=".$sql); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index 01bb969df20..f970df5bc4d 100644 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -212,7 +212,6 @@ if ($testmodifier) $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; $sql.= " WHERE id_users = '".$db->escape($idtomodify)."'"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if (! $resql) dol_print_error($db); } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 48c585c0f2e..2d93dfd5de4 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -151,7 +151,6 @@ if ($testmodifier) $sql.= " SET reponses = '".$db->escape($nouveauchoix)."'"; $sql.= " WHERE id_users = '".$db->escape($idtomodify)."'"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if (! $resql) dol_print_error($db); } @@ -172,7 +171,6 @@ if (GETPOST("ajoutercolonne") && GETPOST('nouvellecolonne') && $object->format = $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " SET sujet = '".$db->escape($nouveauxsujets)."'"; $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if (! $resql) dol_print_error($db); else { @@ -258,7 +256,6 @@ if (isset($_POST["ajoutercolonne"]) && $object->format == "D") $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " SET sujet = '".$db->escape($dateinsertion)."'"; $sql.= " WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if (! $resql) dol_print_error($db); else { @@ -340,7 +337,6 @@ for ($i = 0; $i < $nbcolonnes; $i++) // Mise a jour des sujets dans la base $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " SET sujet = '".$db->escape($nouveauxsujets)."' WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog("sql=".$sql); $resql = $db->query($sql); if (! $resql) dol_print_error($db); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 520d003305d..f166369631a 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -245,7 +245,6 @@ print_barre_liste($langs->trans('ProductsIntoElements', $typeElementString.' '.$ if ($sql_select) { - dol_syslog("sql=".$sql); $resql=$db->query($sql); if (!$resql) dol_print_error($db); } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 49bd0877e6e..af7a95af74d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -306,7 +306,6 @@ $sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($fu if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; -dol_syslog("sql=".$sql); $result=$db->query($sql); if ($result) { diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 4f341b7a39b..c271b6dd7a2 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -71,7 +71,6 @@ if ($id != 'all') $sql.= " LIMIT 1"; } -dol_syslog("sql=".$sql); $resql=$db->query($sql); if ($resql) { From 84f1b8c02beaf304cc38f1ba5f9318de70c52f14 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Wed, 11 Jun 2014 12:22:24 +0200 Subject: [PATCH 027/502] Add customers/supplier status fo contact export When you export a contact list it's usefull to know if your contact is a prospect, client or supplier --- htdocs/core/modules/modSociete.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 5284f5ef55b..ef5f73baae5 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -320,9 +320,9 @@ class modSociete extends DolibarrModules $this->export_label[$r]='ExportDataset_company_2'; $this->export_icon[$r]='contact'; $this->export_permission[$r]=array(array("societe","contact","export")); - $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode"); - $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text"); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company"); // We define here only fields that use another picto + $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1'); + $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean"); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto if (empty($conf->fournisseur->enabled)) { unset($this->export_fields_array[$r]['s.code_fournisseur']); From 81e715f34ca2001df4ac364d5d521a0b12622434 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Wed, 11 Jun 2014 12:26:54 +0200 Subject: [PATCH 028/502] Update modSociete.class.php --- htdocs/core/modules/modSociete.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index ef5f73baae5..4bc3bfbd139 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -321,7 +321,7 @@ class modSociete extends DolibarrModules $this->export_icon[$r]='contact'; $this->export_permission[$r]=array(array("societe","contact","export")); $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1'); - $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean"); + $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto if (empty($conf->fournisseur->enabled)) { From 57b4cb08b7d2f69135316e3f296847b075931b52 Mon Sep 17 00:00:00 2001 From: Mickael Desgranges Date: Wed, 11 Jun 2014 13:28:31 +0200 Subject: [PATCH 029/502] Update modSociete.class.php --- htdocs/core/modules/modSociete.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 4bc3bfbd139..ee48e4d7ff7 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -320,7 +320,7 @@ class modSociete extends DolibarrModules $this->export_label[$r]='ExportDataset_company_2'; $this->export_icon[$r]='contact'; $this->export_permission[$r]=array(array("societe","contact","export")); - $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'0 or 1'); + $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1'); $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto if (empty($conf->fournisseur->enabled)) From 9fbd7806f0621d4606b6b2e7ab74ae4da2d35319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 12 Jun 2014 11:31:53 +0200 Subject: [PATCH 030/502] More substitutions --- dev/skeletons/skeleton_class.class.php | 8 +-- dev/skeletons/skeleton_page.php | 2 +- dev/skeletons/skeleton_script.php | 2 +- htdocs/adherents/card_subscriptions.php | 2 +- htdocs/adherents/cartes/carte.php | 2 +- htdocs/adherents/class/adherent.class.php | 38 +++++------ .../adherents/class/adherent_type.class.php | 4 +- htdocs/adherents/class/cotisation.class.php | 8 +-- htdocs/adherents/index.php | 4 +- htdocs/adherents/liste.php | 2 +- htdocs/adherents/stats/byproperties.php | 2 +- htdocs/adherents/stats/geo.php | 2 +- htdocs/admin/barcode.php | 2 +- htdocs/admin/boxes.php | 10 +-- htdocs/admin/const.php | 2 +- htdocs/admin/dict.php | 8 +-- htdocs/admin/external_rss.php | 2 +- htdocs/admin/tools/listevents.php | 2 +- htdocs/barcode/codeinit.php | 2 +- htdocs/bookmarks/class/bookmark.class.php | 8 +-- htdocs/cashdesk/class/Facturation.class.php | 2 +- htdocs/cashdesk/facturation.php | 2 +- htdocs/cashdesk/facturation_dhtml.php | 2 +- htdocs/categories/class/categorie.class.php | 16 ++--- htdocs/comm/action/class/actioncomm.class.php | 14 ++-- .../comm/action/class/cactioncomm.class.php | 4 +- htdocs/comm/action/index.php | 4 +- htdocs/comm/action/listactions.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/comm/mailing/class/mailing.class.php | 14 ++-- htdocs/comm/mailing/fiche.php | 8 +-- htdocs/comm/propal/class/propal.class.php | 16 ++--- htdocs/commande/class/commande.class.php | 30 ++++----- htdocs/compta/bank/account.php | 4 +- htdocs/compta/bank/class/account.class.php | 28 ++++---- htdocs/compta/bank/class/bankcateg.class.php | 8 +-- htdocs/compta/bank/ligne.php | 2 +- htdocs/compta/bank/releve.php | 4 +- htdocs/compta/charges/index.php | 2 +- .../deplacement/class/deplacement.class.php | 10 +-- htdocs/compta/dons/class/don.class.php | 6 +- .../facture/class/facture-rec.class.php | 4 +- htdocs/compta/facture/class/facture.class.php | 36 +++++------ .../facture/class/paymentterm.class.php | 10 +-- .../compta/localtax/class/localtax.class.php | 10 +-- .../cheque/class/remisecheque.class.php | 16 ++--- .../compta/paiement/class/paiement.class.php | 8 +-- htdocs/compta/payment_sc/fiche.php | 2 +- .../class/bonprelevement.class.php | 64 +++++++++---------- htdocs/compta/resultat/clientfourn.php | 18 +++--- htdocs/compta/resultat/index.php | 18 +++--- .../salaries/class/paymentsalary.class.php | 8 +-- .../sociales/class/chargesociales.class.php | 14 ++-- .../class/paymentsocialcontribution.class.php | 12 ++-- htdocs/compta/stats/cabyprodserv.php | 2 +- htdocs/compta/stats/casoc.php | 2 +- htdocs/compta/tva/class/tva.class.php | 10 +-- htdocs/contact/class/contact.class.php | 20 +++--- htdocs/contact/list.php | 2 +- htdocs/contrat/class/contrat.class.php | 34 +++++----- htdocs/contrat/index.php | 2 +- htdocs/contrat/services.php | 2 +- htdocs/core/boxes/box_actions.php | 2 +- htdocs/core/boxes/box_clients.php | 2 +- htdocs/core/boxes/box_comptes.php | 2 +- htdocs/core/boxes/box_prospect.php | 2 +- htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/core/class/commonobject.class.php | 62 +++++++++--------- htdocs/core/class/cpays.class.php | 8 +-- htdocs/core/class/ctypent.class.php | 8 +-- htdocs/core/class/discount.class.php | 20 +++--- htdocs/core/class/events.class.php | 8 +-- htdocs/core/class/extrafields.class.php | 8 +-- htdocs/core/class/html.form.class.php | 28 ++++---- htdocs/core/class/html.formcompany.class.php | 8 +-- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/core/class/html.formorder.class.php | 2 +- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/core/class/html.formpropal.class.php | 2 +- .../class/html.formsocialcontrib.class.php | 2 +- htdocs/core/class/infobox.class.php | 6 +- htdocs/core/class/link.class.php | 6 +- htdocs/core/class/menubase.class.php | 10 +-- htdocs/core/class/notify.class.php | 6 +- htdocs/core/class/stats.class.php | 12 ++-- htdocs/core/db/mysql.class.php | 2 +- htdocs/core/db/mysqli.class.php | 2 +- htdocs/core/db/sqlite.class.php | 4 +- htdocs/core/lib/admin.lib.php | 14 ++-- htdocs/core/lib/company.lib.php | 12 ++-- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/functions2.lib.php | 8 +-- htdocs/core/lib/invoice2.lib.php | 4 +- htdocs/core/lib/price.lib.php | 2 +- htdocs/core/lib/sendings.lib.php | 2 +- htdocs/core/lib/tax.lib.php | 6 +- htdocs/core/login/functions_dolibarr.php | 2 +- htdocs/core/login/functions_openid.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 44 ++++++------- htdocs/core/modules/action/rapport.pdf.php | 2 +- .../modules/commande/mod_commande_marbre.php | 2 +- .../modules/contract/mod_contract_serpis.php | 2 +- .../expedition/mod_expedition_safor.php | 2 +- .../core/modules/facture/mod_facture_mars.php | 4 +- .../modules/facture/mod_facture_terre.php | 4 +- .../modules/import/import_csv.modules.php | 2 +- .../modules/livraison/mod_livraison_jade.php | 2 +- .../core/modules/mailings/fraise.modules.php | 2 +- .../modules/project/mod_project_simple.php | 2 +- .../modules/project/task/mod_task_simple.php | 2 +- .../modules/propale/mod_propale_marbre.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../modules/societe/mod_codeclient_monkey.php | 2 +- .../mod_facture_fournisseur_cactus.php | 4 +- ..._50_modNotification_Notification.class.php | 2 +- htdocs/cron/class/cronjob.class.php | 12 ++-- htdocs/ecm/class/ecmdirectory.class.php | 16 ++--- htdocs/expedition/class/expedition.class.php | 20 +++--- .../class/expeditionbatch.class.php | 8 +-- htdocs/expedition/shipment.php | 2 +- htdocs/exports/class/export.class.php | 8 +-- htdocs/fichinter/class/fichinter.class.php | 30 ++++----- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- htdocs/fourn/class/fournisseur.class.php | 2 +- .../class/fournisseur.commande.class.php | 32 +++++----- .../fourn/class/fournisseur.facture.class.php | 30 ++++----- .../fourn/class/fournisseur.product.class.php | 12 ++-- htdocs/fourn/class/paiementfourn.class.php | 2 +- htdocs/fourn/product/liste.php | 2 +- htdocs/ftp/admin/ftpclient.php | 2 +- htdocs/holiday/class/holiday.class.php | 30 ++++----- htdocs/imports/class/import.class.php | 6 +- htdocs/install/upgrade.php | 6 +- htdocs/install/upgrade2.php | 36 +++++------ htdocs/livraison/class/livraison.class.php | 12 ++-- .../class/opensurveysondage.class.php | 12 ++-- htdocs/product/class/product.class.php | 24 +++---- htdocs/product/class/productbatch.class.php | 12 ++-- htdocs/product/liste.php | 2 +- htdocs/product/stock/class/entrepot.class.php | 16 ++--- .../stock/class/mouvementstock.class.php | 10 +-- htdocs/product/stock/index.php | 2 +- htdocs/projet/class/task.class.php | 30 ++++----- htdocs/projet/liste.php | 2 +- htdocs/resource/class/resource.class.php | 24 +++---- htdocs/societe/ajaxcompanies.php | 2 +- htdocs/societe/class/address.class.php | 2 +- .../class/companybankaccount.class.php | 2 +- htdocs/societe/class/societe.class.php | 28 ++++---- htdocs/societe/soc.php | 2 +- htdocs/user/class/user.class.php | 24 +++---- htdocs/user/class/usergroup.class.php | 10 +-- htdocs/user/fiche.php | 2 +- htdocs/user/perms.php | 4 +- .../webservices/server_productorservice.php | 2 +- htdocs/webservices/server_thirdparty.php | 2 +- scripts/emailings/mailing-send.php | 4 +- 158 files changed, 715 insertions(+), 715 deletions(-) diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index c36dad4b4b5..53f6d0a66f3 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -91,7 +91,7 @@ class Skeleton_Class extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -149,7 +149,7 @@ class Skeleton_Class extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."mytable as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch"); $resql=$this->db->query($sql); if ($resql) { @@ -204,7 +204,7 @@ class Skeleton_Class extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update"); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -278,7 +278,7 @@ class Skeleton_Class extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."mytable"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete"); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index bf63a769af7..00222bcce61 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -139,7 +139,7 @@ if ($action == 'list') print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder); print ''; - dol_syslog($script_file." sql=".$sql, LOG_DEBUG); + dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php index b10b57a730a..877a420d6af 100644 --- a/dev/skeletons/skeleton_script.php +++ b/dev/skeletons/skeleton_script.php @@ -119,7 +119,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."skeleton"; $sql.= " WHERE field3 = 'xxx'"; $sql.= " ORDER BY field1 ASC"; -dol_syslog($script_file." sql=".$sql, LOG_DEBUG); +dol_syslog($script_file, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 0fcedb8e96d..e120ea96360 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -307,7 +307,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ $sql ="UPDATE ".MAIN_DB_PREFIX."cotisation SET fk_bank=".$insertid; $sql.=" WHERE rowid=".$crowid; - dol_syslog("card_subscriptions::cotisation sql=".$sql); + dol_syslog("card_subscriptions::cotisation", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index dbccbdb4f01..ade8f059810 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -72,7 +72,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'"; $sql.= " ORDER BY d.rowid ASC"; - dol_syslog("Search members sql=".$sql); + dol_syslog("Search members", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 77cbff2918a..7dcb131b7df 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -310,7 +310,7 @@ class Adherent extends CommonObject $sql.= ", ".(! empty($this->import_key) ? "'".$this->import_key."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -335,7 +335,7 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; $sql.= " fk_member = '".$this->id."'"; $sql.= " WHERE rowid = ".$this->user_id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -455,7 +455,7 @@ class Adherent extends CommonObject $sql.= ", fk_user_mod=".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update update member sql=".$sql); + dol_syslog(get_class($this)."::update update member", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -501,14 +501,14 @@ class Adherent extends CommonObject { dol_syslog(get_class($this)."::update update link to user"); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; } // If there is a user linked to this member if ($this->user_id > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".$this->id." WHERE rowid = ".$this->user_id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; } } @@ -650,7 +650,7 @@ class Adherent extends CommonObject $sql.= " WHERE fk_adherent='".$this->id."'"; $sql.= " ORDER by dateadh DESC"; // Sort by start subscription date - dol_syslog(get_class($this)."::update_end_date sql=".$sql); + dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -663,7 +663,7 @@ class Adherent extends CommonObject $sql.= " datefin=".($datefin != '' ? "'".$this->db->idate($datefin)."'" : "null"); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update_end_date sql=".$sql); + dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -711,7 +711,7 @@ class Adherent extends CommonObject // Remove category $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member WHERE fk_member = ".$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -726,7 +726,7 @@ class Adherent extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE fk_adherent = ".$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -769,7 +769,7 @@ class Adherent extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -846,7 +846,7 @@ class Adherent extends CommonObject $sql.= " WHERE rowid = ".$this->id; //dol_syslog("Adherent::Password sql=hidden"); - dol_syslog(get_class($this)."::setPassword sql=".$sql); + dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -922,7 +922,7 @@ class Adherent extends CommonObject // If user is linked to this member, remove old link to this member $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".$this->id; - dol_syslog(get_class($this)."::setUserId sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::setUserId", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -1; } @@ -931,7 +931,7 @@ class Adherent extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".$this->id; $sql.= " WHERE rowid = ".$userid; - dol_syslog(get_class($this)."::setUserId sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::setUserId", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -2; } } @@ -960,7 +960,7 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = null"; $sql.= " WHERE fk_soc = '".$thirdpartyid."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::setThirdPartyId sql=".$sql); + dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG); $resql = $this->db->query($sql); } @@ -968,7 +968,7 @@ class Adherent extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = ".($thirdpartyid>0 ? $thirdpartyid : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::setThirdPartyId sql=".$sql); + dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1088,7 +1088,7 @@ class Adherent extends CommonObject $sql.= " AND d.ref_ext='".$this->db->escape($ref_ext)."'"; } - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1198,7 +1198,7 @@ class Adherent extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c"; $sql.= " WHERE c.fk_adherent = ".$this->id; $sql.= " ORDER BY c.dateadh"; - dol_syslog(get_class($this)."::fetch_subscriptions sql=".$sql); + dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -1356,7 +1356,7 @@ class Adherent extends CommonObject $sql.= ", fk_user_valid=".$user->id; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::validate sql=".$sql); + dol_syslog(get_class($this)."::validate", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1902,7 +1902,7 @@ class Adherent extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.'adherent as a'; $sql.= ' WHERE a.rowid = '.$id; - dol_syslog(get_class($this)."::info sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::info", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index e861af709b8..78e046978e9 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -76,7 +76,7 @@ class AdherentType extends CommonObject $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog("Adherent_type::create sql=".$sql); + dol_syslog("Adherent_type::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -188,7 +188,7 @@ class AdherentType extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql .= " WHERE d.rowid = ".$rowid; - dol_syslog("Adherent_type::fetch sql=".$sql); + dol_syslog("Adherent_type::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 1fc0994b54a..712205c3a0d 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -82,7 +82,7 @@ class Cotisation extends CommonObject $sql.= " '".$this->db->idate($this->datef)."',"; $sql.= " ".$this->amount.",'".$this->db->escape($this->note)."')"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -113,7 +113,7 @@ class Cotisation extends CommonObject $sql.=" FROM ".MAIN_DB_PREFIX."cotisation"; $sql.=" WHERE rowid=".$rowid; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -168,7 +168,7 @@ class Cotisation extends CommonObject $sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null'); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -207,7 +207,7 @@ class Cotisation extends CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index e64466ce9a6..0aaafa461fb 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -68,7 +68,7 @@ $sql.= " AND d.entity IN (".getEntity().")"; $sql.= " WHERE t.entity IN (".getEntity().")"; $sql.= " GROUP BY t.rowid, t.libelle, t.cotisation, d.statut"; -dol_syslog("index.php::select nb of members by type sql=".$sql, LOG_DEBUG); +dol_syslog("index.php::select nb of members by type", LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -106,7 +106,7 @@ $sql.= " AND d.statut = 1 AND d.datefin >= '".$db->idate($now)."'"; $sql.= " AND t.rowid = d.fk_adherent_type"; $sql.= " GROUP BY d.fk_adherent_type"; -dol_syslog("index.php::select nb of uptodate members by type sql=".$sql, LOG_DEBUG); +dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index a5fbe1dc5c9..c1dfb9d2302 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -158,7 +158,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); -dol_syslog("get list sql=".$sql); +dol_syslog("get list", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index e8355cbb941..fdb9153ba88 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -74,7 +74,7 @@ $sql.=" GROUP BY d.morphy"; $foundphy=$foundmor=0; // Define $data array -dol_syslog("Count member sql=".$sql); +dol_syslog("Count member", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 1cb98f353b6..ecf27f78465 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -138,7 +138,7 @@ if ($mode) //print $langsen->trans("Country"."FI");exit; // Define $data array - dol_syslog("Count member sql=".$sql); + dol_syslog("Count member", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 988b49efd07..78c99916910 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -203,7 +203,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; $sql.= " WHERE entity = ".$conf->entity; $sql.= " ORDER BY code"; -dol_syslog("admin/barcode.php sql=".$sql); +dol_syslog("admin/barcode.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index d58a1576a31..bc140735c61 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -66,7 +66,7 @@ if ($action == 'add') $sql.= " WHERE param = 'MAIN_BOXES_".$db->escape(GETPOST("pos","alpha"))."' AND value = '1'"; $sql.= " AND entity = ".$conf->entity; $resql = $db->query($sql); - dol_syslog("boxes.php search fk_user to activate box for sql=".$sql); + dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG); if ($resql) { $num = $db->num_rows($resql); @@ -93,7 +93,7 @@ if ($action == 'add') { $nbboxonleft=$nbboxonright=0; $sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity; - dol_syslog("boxes.php activate box sql=".$sql); + dol_syslog("boxes.php activate box", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -112,7 +112,7 @@ if ($action == 'add') $sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity; $sql.= ")"; - dol_syslog("boxes.php activate box sql=".$sql); + dol_syslog("boxes.php activate box", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { @@ -235,7 +235,7 @@ $sql.= " AND b.box_id = bd.rowid"; $sql.= " AND b.fk_user=0"; $sql.= " ORDER by b.position, b.box_order"; -dol_syslog("Search available boxes sql=".$sql, LOG_DEBUG); +dol_syslog("Search available boxes", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -271,7 +271,7 @@ if ($resql) $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND LENGTH(box_order) <= 2"; - dol_syslog("Execute requests to renumber box order sql=".$sql); + dol_syslog("Execute requests to renumber box order", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index eb9cae41917..48e637fb8a3 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -233,7 +233,7 @@ if (empty($user->entity) && $debug) {} // to force for superadmin elseif ($user->entity || empty($conf->multicompany->enabled)) $sql.= " AND visible = 1"; $sql.= " ORDER BY entity, name ASC"; -dol_syslog("Const::listConstant sql=".$sql); +dol_syslog("Const::listConstant", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d834929d00f..6120e94f4ac 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -528,7 +528,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } $sql.=",1)"; - dol_syslog("actionadd sql=".$sql); + dol_syslog("actionadd", LOG_DEBUG); $result = $db->query($sql); if ($result) // Add is ok { @@ -576,7 +576,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; - dol_syslog("actionmodify sql=".$sql); + dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); if (! $resql) @@ -599,7 +599,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'"; - dol_syslog("delete sql=".$sql); + dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); if (! $result) { @@ -826,7 +826,7 @@ if ($id) print ''; // List of available values in database - dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG); + dol_syslog("htdocs/admin/dict", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 0b9534689d0..1944521a581 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -229,7 +229,7 @@ $sql ="SELECT rowid, file, note FROM ".MAIN_DB_PREFIX."boxes_def"; $sql.=" WHERE file = 'box_external_rss.php'"; $sql.=" ORDER BY note"; -dol_syslog("select rss boxes sql=".$sql,LOG_DEBUG); +dol_syslog("select rss boxes", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 10bd42d9590..c2671f698a4 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -78,7 +78,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin) $sql = "DELETE FROM ".MAIN_DB_PREFIX."events"; $sql.= " WHERE entity = ".$conf->entity; - dol_syslog("listevents purge sql=".$sql); + dol_syslog("listevents purge", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) { diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index d6ca6a7d66f..a5d207b5339 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -126,7 +126,7 @@ if ($action == 'initbarcodeproducts') $sql.=$db->order("datec","ASC"); $sql.=$db->plimit($maxperinit); - dol_syslog("codeinit sql=".$sql, LOG_DEBUG); + dol_syslog("codeinit", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 2aa86c5db20..aa92d2bedb9 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -65,7 +65,7 @@ class Bookmark $sql.= " WHERE rowid = ".$id; $sql.= " AND entity = ".$conf->entity; - dol_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG); + dol_syslog("Bookmark::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -123,7 +123,7 @@ class Bookmark if ($this->fk_soc) $sql.=",".$this->fk_soc; $sql.= ")"; - dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG); + dol_syslog("Bookmark::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -173,7 +173,7 @@ class Bookmark $sql.= " ,position = '".$this->position."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG); + dol_syslog("Bookmark::update", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -196,7 +196,7 @@ class Bookmark $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark"; $sql .= " WHERE rowid = ".$id; - dol_syslog("Bookmark::remove sql=".$sql, LOG_DEBUG); + dol_syslog("Bookmark::remove", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index b2bb87a0bb2..296ced0f172 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -103,7 +103,7 @@ class Facturation $sql.= " FROM ".MAIN_DB_PREFIX."c_tva"; $sql.= " WHERE rowid = ".$this->tva(); - dol_syslog("ajoutArticle sql=".$sql); + dol_syslog("ajoutArticle", LOG_DEBUG); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 4d442c0dbd3..2f3da75d977 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -65,7 +65,7 @@ if ( GETPOST('filtre') ) { else $sql.= ")"; $sql.= " ORDER BY label"; - dol_syslog("facturation.php sql=".$sql); + dol_syslog("facturation.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 88a22f7865a..e481fcbecf6 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -62,7 +62,7 @@ if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at l } $sql.= " ORDER BY label"; - dol_syslog("facturation_dhtml.php sql=".$sql); + dol_syslog("facturation_dhtml.php", LOG_DEBUG); $result = $db->query($sql); if ($result) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8d2c4ceed46..2d657dc6e1c 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -87,7 +87,7 @@ class Categorie extends CommonObject if ($label) $sql.= " WHERE label = '".$this->db->escape($label)."' AND entity=".$conf->entity;; } - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -278,7 +278,7 @@ class Categorie extends CommonObject $sql .= ", fk_parent = ".$this->fk_parent; $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); if ($this->db->query($sql)) { @@ -488,7 +488,7 @@ class Categorie extends CommonObject $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie'; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::add_type sql=".$sql); + dol_syslog(get_class($this)."::add_type", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -626,7 +626,7 @@ class Categorie extends CommonObject $sql.= " AND c.fk_categorie = ".$this->id; $sql.= " AND c.fk_".$field." = o.rowid"; - dol_syslog(get_class($this)."::getObjectsInCateg sql=".$sql); + dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -679,7 +679,7 @@ class Categorie extends CommonObject } $sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $category_table; $sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $field . " = " . $object_id; - dol_syslog(get_class($this)."::containsObject sql=".$sql); + dol_syslog(get_class($this)."::containsObject", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { return $this->db->fetch_object($resql)->nb; @@ -737,7 +737,7 @@ class Categorie extends CommonObject $sql.= " WHERE fk_parent != 0"; $sql.= " AND entity IN (".getEntity('category',1).")"; - dol_syslog(get_class($this)."::load_motherof sql=".$sql); + dol_syslog(get_class($this)."::load_motherof", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -788,7 +788,7 @@ class Categorie extends CommonObject $sql.= " WHERE c.entity IN (".getEntity('category',1).")"; $sql.= " AND c.type = ".$type; - dol_syslog(get_class($this)."::get_full_arbo get category list sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -982,7 +982,7 @@ class Categorie extends CommonObject $sql.= " AND c.fk_parent = ".$this->fk_parent; $sql.= " AND c.label = '".$this->db->escape($this->label)."'"; - dol_syslog(get_class($this)."::already_exists sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::already_exists", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ee9e4c032ee..03d3f7b8025 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -202,7 +202,7 @@ class ActionComm extends CommonObject $sql.= $conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::add sql=".$sql); + dol_syslog(get_class($this)."::add", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -292,7 +292,7 @@ class ActionComm extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; $sql.= " WHERE a.id=".$id." AND a.fk_action=c.id"; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -369,7 +369,7 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm"; $sql.= " WHERE id=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); if ($res < 0) { $this->error=$this->db->lasterror(); @@ -477,7 +477,7 @@ class ActionComm extends CommonObject $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); $sql.= " WHERE id=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); if ($this->db->query($sql)) { @@ -558,7 +558,7 @@ class ActionComm extends CommonObject } if (! empty($filter)) $sql.= $filter; - dol_syslog(get_class()."::getActions sql=".$sql); + dol_syslog(get_class()."::getActions", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -644,7 +644,7 @@ class ActionComm extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $sql.= ' WHERE a.id = '.$id; - dol_syslog(get_class($this)."::info sql=".$sql); + dol_syslog(get_class($this)."::info", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -930,7 +930,7 @@ class ActionComm extends CommonObject $sql.= " ORDER by datep"; //print $sql;exit; - dol_syslog(get_class($this)."::build_exportfile select events sql=".$sql); + dol_syslog(get_class($this)."::build_exportfile select events", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 68960c5a6c0..8908b4e2a46 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -64,7 +64,7 @@ class CActionComm if (is_numeric($id)) $sql.= " WHERE id=".$id; else $sql.= " WHERE code='".$id."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -117,7 +117,7 @@ class CActionComm if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; $sql.= " ORDER BY module, position"; - dol_syslog(get_class($this)."::liste_array sql=".$sql); + dol_syslog(get_class($this)."::liste_array", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 92b87d94ad1..2c3791c4c1b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -361,7 +361,7 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0) $sql.= ' ORDER BY datep'; //print $sql; -dol_syslog("comm/action/index.php sql=".$sql, LOG_DEBUG); +dol_syslog("comm/action/index.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -472,7 +472,7 @@ if ($showbirthday) } $sql.= ' ORDER BY birthday'; - dol_syslog("comm/action/index.php sql=".$sql, LOG_DEBUG); + dol_syslog("comm/action/index.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index e6944f4c829..56a9efa5589 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -183,7 +183,7 @@ $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); //print $sql; -dol_syslog("comm/action/listactions.php sql=".$sql); +dol_syslog("comm/action/listactions.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 78f1ca24827..f34678787fa 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -89,7 +89,7 @@ $sql.= " ORDER BY year DESC, month DESC, df DESC"; $sql.= $db->plimit($limit+1,$offset); //print $sql; -dol_syslog("select sql=".$sql); +dol_syslog("select", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 99b1a2f4419..2cb298bff3f 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -109,7 +109,7 @@ class Mailing extends CommonObject $this->titre = $langs->trans("NoTitle"); } - dol_syslog("Mailing::Create sql=".$sql); + dol_syslog("Mailing::Create", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -157,7 +157,7 @@ class Mailing extends CommonObject $sql .= ", bgimage = '".($this->bgimage?$this->bgimage:null)."'"; $sql .= " WHERE rowid = ".$this->id; - dol_syslog("Mailing::Update sql=".$sql); + dol_syslog("Mailing::Update", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -192,7 +192,7 @@ class Mailing extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql.= " WHERE m.rowid = ".$rowid; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -325,7 +325,7 @@ class Mailing extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles "; $sql.= " WHERE fk_mailing = ".$fromid; - dol_syslog(get_class($this)."::createFromClone sql=".$sql); + dol_syslog(get_class($this)."::createFromClone", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -384,7 +384,7 @@ class Mailing extends CommonObject $sql .= " SET statut = 1, date_valid = '".$this->db->idate($now)."', fk_user_valid=".$user->id; $sql .= " WHERE rowid = ".$this->id; - dol_syslog("Mailing::valid sql=".$sql, LOG_DEBUG); + dol_syslog("Mailing::valid", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -409,7 +409,7 @@ class Mailing extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing"; $sql.= " WHERE rowid = ".$rowid; - dol_syslog("Mailing::delete sql=".$sql, LOG_DEBUG); + dol_syslog("Mailing::delete", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -436,7 +436,7 @@ class Mailing extends CommonObject $sql.= " SET statut = 0"; $sql.= " WHERE fk_mailing = ".$this->id; - dol_syslog("Mailing::reset_targets_status sql=".$sql, LOG_DEBUG); + dol_syslog("Mailing::reset_targets_status", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index d803de28357..b08eb746a09 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -173,7 +173,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id; - dol_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG); + dol_syslog("fiche.php: select targets", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -295,7 +295,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') { //Update status communication of thirdparty prospect $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")"; - dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG); + dol_syslog("fiche.php: set prospect thirdparty status", LOG_DEBUG); $resql2=$db->query($sql); if (! $resql2) { @@ -304,7 +304,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') //Update status communication of contact prospect $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; - dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG); + dol_syslog("fiche.php: set prospect contact status", LOG_DEBUG); $resql2=$db->query($sql); if (! $resql2) @@ -363,7 +363,7 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes') } $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id; - dol_syslog("comm/mailing/fiche.php: update global status sql=".$sql, LOG_DEBUG); + dol_syslog("comm/mailing/fiche.php: update global status", LOG_DEBUG); $resql2=$db->query($sql); if (! $resql2) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 070f0232215..5122bd15f51 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -749,7 +749,7 @@ class Propal extends CommonObject $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -760,7 +760,7 @@ class Propal extends CommonObject $this->ref='(PROV'.$this->id.')'; $sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $error++; @@ -1075,7 +1075,7 @@ class Propal extends CommonObject if ($ref) $sql.= " AND p.ref='".$ref."'"; else $sql.= " AND p.rowid=".$rowid; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1410,7 +1410,7 @@ class Propal extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'"; $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; - dol_syslog(get_class($this)."::set_date sql=".$sql); + dol_syslog(get_class($this)."::set_date", LOG_DEBUG); if ($this->db->query($sql) ) { $this->date = $date; @@ -1667,7 +1667,7 @@ class Propal extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::reopen sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::reopen", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -1993,7 +1993,7 @@ class Propal extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")"; - dol_syslog(get_class($this)."::InvoiceArrayList sql=".$sql); + dol_syslog(get_class($this)."::InvoiceArrayList", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -2974,7 +2974,7 @@ class PropaleLigne extends CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid; - dol_syslog("PropaleLigne::delete sql=".$sql, LOG_DEBUG); + dol_syslog("PropaleLigne::delete", LOG_DEBUG); if ($this->db->query($sql) ) { @@ -3085,7 +3085,7 @@ class PropaleLigne extends CommonObject $sql.= " , date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null"); $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e2b0f5506fb..5af12ef11bb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -229,7 +229,7 @@ class Commande extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::valid() sql=".$sql); + dol_syslog(get_class($this)."::valid()", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -352,7 +352,7 @@ class Commande extends CommonOrder $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it @@ -424,7 +424,7 @@ class Commande extends CommonOrder $sql.= ' SET fk_statut=1, facture=0'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_reopen sql=".$sql); + dol_syslog(get_class($this)."::set_reopen", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -535,7 +535,7 @@ class Commande extends CommonOrder $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = 1"; - dol_syslog(get_class($this)."::cancel sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::cancel", LOG_DEBUG); if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it @@ -672,7 +672,7 @@ class Commande extends CommonOrder $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1327,7 +1327,7 @@ class Commande extends CommonOrder if ($ref_ext) $sql.= " AND c.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND c.ref_int='".$this->db->escape($ref_int)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1511,7 +1511,7 @@ class Commande extends CommonOrder if ($only_product) $sql .= ' AND p.fk_product_type = 0'; $sql .= ' ORDER BY l.rang'; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1638,7 +1638,7 @@ class Commande extends CommonOrder $sql.= ' GROUP BY cd.rowid, cd.fk_product'; //print $sql; - dol_syslog(get_class($this)."::loadExpeditions sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::loadExpeditions", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1938,7 +1938,7 @@ class Commande extends CommonOrder $sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2206,7 +2206,7 @@ class Commande extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1'; $sql.= ' WHERE rowid = '.$this->id.' AND fk_statut > 0'; - dol_syslog(get_class($this)."::classifyBilled sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::classifyBilled", LOG_DEBUG); if ($this->db->query($sql)) { // Appel des triggers @@ -2445,7 +2445,7 @@ class Commande extends CommonOrder { // Delete order details $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { dol_syslog(get_class($this)."::delete error", LOG_ERR); @@ -2454,7 +2454,7 @@ class Commande extends CommonOrder // Delete order $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { dol_syslog(get_class($this)."::delete error", LOG_ERR); @@ -3156,7 +3156,7 @@ class OrderLine extends CommonOrderLine $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';"; - dol_syslog("OrderLine::delete sql=".$sql); + dol_syslog("OrderLine::delete", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3269,7 +3269,7 @@ class OrderLine extends CommonOrderLine $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null"); $sql.= ')'; - dol_syslog(get_class($this)."::insert sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::insert", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3379,7 +3379,7 @@ class OrderLine extends CommonOrderLine if (! empty($this->rang)) $sql.= ", rang=".$this->rang; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 27690ae7093..ecc1443d838 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -241,7 +241,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND ba.entity = ".$conf->entity; $sql.= $sql_rech; - dol_syslog("account.php count transactions - sql=".$sql, LOG_DEBUG); + dol_syslog("account.php count transactions -", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -485,7 +485,7 @@ if ($id > 0 || ! empty($ref)) $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day $sql.= $db->plimit($limitsql, 0); - dol_syslog("account.php get transactions - sql=".$sql, LOG_DEBUG); + dol_syslog("account.php get transactions -", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8bcabf7f17b..0179149e69f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -146,7 +146,7 @@ class Account extends CommonObject $sql.= ", '".$type."'"; $sql.= ")"; - dol_syslog(get_class($this)."::add_url_line sql=".$sql); + dol_syslog(get_class($this)."::add_url_line", LOG_DEBUG); if ($this->db->query($sql)) { $rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url"); @@ -189,7 +189,7 @@ class Account extends CommonObject } $sql.= " ORDER BY type, label"; - dol_syslog(get_class($this)."::get_url sql=".$sql); + dol_syslog(get_class($this)."::get_url", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -302,7 +302,7 @@ class Account extends CommonObject $sql.= ", ".($banque?"'".$this->db->escape($banque)."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::addline sql=".$sql); + dol_syslog(get_class($this)."::addline", LOG_DEBUG); if ($this->db->query($sql)) { $rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank"); @@ -404,7 +404,7 @@ class Account extends CommonObject $sql.= ", ".$this->country_id; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -513,7 +513,7 @@ class Account extends CommonObject $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -617,7 +617,7 @@ class Account extends CommonObject if ($id) $sql.= " AND ba.rowid = ".$id; if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -691,7 +691,7 @@ class Account extends CommonObject $sql.= " WHERE rowid = ".$this->rowid; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { return 1; @@ -1091,7 +1091,7 @@ class AccountLine extends CommonObject else if ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'"; else $sql.= " AND b.rowid=".$rowid; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1166,12 +1166,12 @@ class AccountLine extends CommonObject } $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if (! $result) $nbko++; $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if (! $result) $nbko++; @@ -1208,7 +1208,7 @@ class AccountLine extends CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid; - dol_syslog(get_class($this)."::delete_urls sql=".$sql); + dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG); $result = $this->db->query($sql); if (! $result) $nbko++; @@ -1242,7 +1242,7 @@ class AccountLine extends CommonObject $sql.= " dateo='".$this->db->idate($this->dateo)."'"; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1276,7 +1276,7 @@ class AccountLine extends CommonObject $sql.= ", fk_user_rappro = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update_conciliation sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1290,7 +1290,7 @@ class AccountLine extends CommonObject $sql.= ", ".$cat; $sql.= ")"; - dol_syslog(get_class($this)."::update_conciliation sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG); $resql = $this->db->query($sql); // No error check. Can fail if category already affected diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index c4066bae655..1bcadc4eb1a 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -84,7 +84,7 @@ class BankCateg // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -142,7 +142,7 @@ class BankCateg // extends CommonObject $sql.= " WHERE t.rowid = ".$id; $sql.= " AND t.entity = ".$conf->entity; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -192,7 +192,7 @@ class BankCateg // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -249,7 +249,7 @@ class BankCateg // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index fee53c412b8..1ebc99a344d 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -175,7 +175,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == else $sql.=", rappro = ".$rappro; $sql.= " WHERE rowid = ".$rowid; - dol_syslog("ligne.php sql=".$sql, LOG_DEBUG); + dol_syslog("ligne.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index dba271e672b..172140c2c64 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -189,7 +189,7 @@ else $sql.= " AND b.fk_account = ".$acct->id; $sql.= " ORDER BY b.num_releve DESC"; - dol_syslog("htdocs/compta/bank/releve.php sql=".$sql); + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -211,7 +211,7 @@ else $sql.= " AND b.fk_account = ".$acct->id; $sql.= " ORDER BY b.num_releve ASC"; - dol_syslog("htdocs/compta/bank/releve.php sql=".$sql); + dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f38f7e72aa2..e4286157617 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -207,7 +207,7 @@ if ($conf->tax->enabled) //$sql.= $db->plimit($limit+1,$offset); //print $sql; - dol_syslog("compta/charges/index.php: select payment sql=".$sql); + dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index f47046e2bdd..d46585c300d 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -120,7 +120,7 @@ class Deplacement extends CommonObject $sql.= ", ".($this->fk_soc > 0? $this->fk_soc : "null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -203,7 +203,7 @@ class Deplacement extends CommonObject $sql .= " , fk_projet = ".($this->fk_project>0?$this->fk_project:0); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -230,7 +230,7 @@ class Deplacement extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; $sql.= " WHERE rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ( $result ) { @@ -271,7 +271,7 @@ class Deplacement extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = ".$id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -381,7 +381,7 @@ class Deplacement extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees"; $sql.= " WHERE active = ".$active; - dol_syslog(get_class($this)."::listOfTypes sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::listOfTypes", LOG_DEBUG); $result = $this->db->query($sql); if ( $result ) { diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a37b0433c80..df99859e663 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -354,7 +354,7 @@ class Don extends CommonObject $sql.= ", '".$this->db->escape($this->phone_mobile)."'"; $sql.= ")"; - dol_syslog("Don::create sql=".$sql, LOG_DEBUG); + dol_syslog("Don::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -414,7 +414,7 @@ class Don extends CommonObject $sql .= ",fk_statut=".$this->statut; $sql .= " WHERE rowid = $this->id"; - dol_syslog("Don::update sql=".$sql); + dol_syslog("Don::update", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -478,7 +478,7 @@ class Don extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_paiement"; $sql.= " WHERE d.rowid = ".$rowid." AND d.entity = ".$conf->entity; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 7147f51c613..f87e640d78e 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -216,7 +216,7 @@ class FactureRec extends Facture $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'"; $sql.= ' WHERE f.rowid='.$rowid; - dol_syslog("FactureRec::Fetch rowid=".$rowid." sql=".$sql, LOG_DEBUG); + dol_syslog("FactureRec::Fetch rowid=".$rowid."", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -497,7 +497,7 @@ class FactureRec extends Facture $sql.= ", ".$rang; $sql.= ", ".$special_code.")"; - dol_syslog(get_class($this)."::addline sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::addline", LOG_DEBUG); if ($this->db->query($sql)) { $this->id=$facid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 81bf47715e6..48d6e4d34e8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -263,7 +263,7 @@ class Facture extends CommonInvoice $sql.= ",".$this->mode_reglement_id; $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -273,7 +273,7 @@ class Facture extends CommonInvoice $this->ref='(PROV'.$this->id.')'; $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $error++; @@ -846,7 +846,7 @@ class Facture extends CommonInvoice if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1089,7 +1089,7 @@ class Facture extends CommonInvoice $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -1311,7 +1311,7 @@ class Facture extends CommonInvoice $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL'; $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')'; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->error()." sql=".$sql; @@ -1501,7 +1501,7 @@ class Facture extends CommonInvoice if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1557,7 +1557,7 @@ class Facture extends CommonInvoice $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_unpaid sql=".$sql); + dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1767,7 +1767,7 @@ class Facture extends CommonInvoice } $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::validate sql=".$sql); + dol_syslog(get_class($this)."::validate", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1907,7 +1907,7 @@ class Facture extends CommonInvoice $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -2321,7 +2321,7 @@ class Facture extends CommonInvoice $sql.= ' SET fk_facture_line = NULL'; $sql.= ' WHERE fk_facture_line = '.$rowid; - dol_syslog(get_class($this)."::deleteline sql=".$sql); + dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); $result = $this->db->query($sql); if (! $result) { @@ -2461,7 +2461,7 @@ class Facture extends CommonInvoice $sql.= ' AND p.fk_paiement = t.id'; if ($filtertype) $sql.=" AND t.code='PRE'"; - dol_syslog(get_class($this)."::getListOfPayments sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2857,7 +2857,7 @@ class Facture extends CommonInvoice if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; $sql.= " ORDER BY f.facnumber"; - dol_syslog(get_class($this)."::list_qualified_avoir_invoices sql=".$sql); + dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2906,7 +2906,7 @@ class Facture extends CommonInvoice $sql.= ' WHERE fk_facture = '.$this->id; $sql.= ' AND traite = 0'; - dol_syslog(get_class($this)."::demande_prelevement sql=".$sql); + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2937,7 +2937,7 @@ class Facture extends CommonInvoice $sql .= ",'".$bac->number."'"; $sql .= ",'".$bac->cle_rib."')"; - dol_syslog(get_class($this)."::demande_prelevement sql=".$sql); + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -3569,7 +3569,7 @@ class FactureLigne extends CommonInvoiceLine $sql.= " ".price2num($this->total_localtax2); $sql.= ')'; - dol_syslog(get_class($this)."::insert sql=".$sql); + dol_syslog(get_class($this)."::insert", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3732,7 +3732,7 @@ class FactureLigne extends CommonInvoiceLine if (! empty($this->rang)) $sql.= ", rang=".$this->rang; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3783,7 +3783,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql) ) { // Appel des triggers @@ -3831,7 +3831,7 @@ class FactureLigne extends CommonInvoiceLine $sql.= ",total_ttc=".price2num($this->total_ttc).""; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update_total sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 62ebcbacdbd..b137c0da85c 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -119,7 +119,7 @@ class PaymentTerm // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -185,7 +185,7 @@ class PaymentTerm // extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -235,7 +235,7 @@ class PaymentTerm // extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql.= " WHERE t.code = 'RECEP'"; - dol_syslog(get_class($this)."::getDefaultId sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getDefaultId", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -301,7 +301,7 @@ class PaymentTerm // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -357,7 +357,7 @@ class PaymentTerm // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index b500a701254..5580cbe70a3 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -95,7 +95,7 @@ class Localtax extends CommonObject $sql.= " '".$this->fk_user_modif."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -152,7 +152,7 @@ class Localtax extends CommonObject $sql.= " fk_user_modif='".$this->fk_user_modif."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -202,7 +202,7 @@ class Localtax extends CommonObject $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); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -253,7 +253,7 @@ class Localtax extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -488,7 +488,7 @@ class Localtax extends CommonObject $sql.=", '".$user->id."', NULL"; $sql.= ")"; - dol_syslog(get_class($this)."::addPayment sql=".$sql); + dol_syslog(get_class($this)."::addPayment", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 917c88e0743..e6f8963b3e9 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -73,7 +73,7 @@ class RemiseCheque extends CommonObject 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); + dol_syslog("RemiseCheque::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -155,7 +155,7 @@ class RemiseCheque extends CommonObject $sql.= ", ''"; $sql.= ")"; - dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::Create", LOG_DEBUG); $resql = $this->db->query($sql); if ( $resql ) { @@ -172,7 +172,7 @@ class RemiseCheque extends CommonObject $sql.= " SET number='(PROV".$this->id.")'"; $sql.= " WHERE rowid='".$this->id."';"; - dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::Create", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -192,7 +192,7 @@ class RemiseCheque extends CommonObject $sql.= " AND b.fk_account='".$account_id."'"; if ($limit) $sql.= $this->db->plimit($limit); - dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::Create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -225,7 +225,7 @@ class RemiseCheque extends CommonObject $sql.= " SET fk_bordereau = ".$this->id; $sql.= " WHERE rowid = ".$lineid; - dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::Create", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { @@ -351,7 +351,7 @@ class RemiseCheque extends CommonObject $sql.= " AND entity = ".$conf->entity; $sql.= " AND statut = 0"; - dol_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::Validate", LOG_DEBUG); $resql = $this->db->query($sql); if ( $resql ) { @@ -410,7 +410,7 @@ class RemiseCheque extends CommonObject $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND number not like '(%'"; - dol_syslog("Remisecheque::getNextNumber sql=".$sql); + dol_syslog("Remisecheque::getNextNumber", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -510,7 +510,7 @@ class RemiseCheque extends CommonObject $sql.= " AND bc.entity = ".$conf->entity; $sql.= " ORDER BY b.dateo ASC, b.rowid ASC"; - dol_syslog("RemiseCheque::generatePdf sql=".$sql, LOG_DEBUG); + dol_syslog("RemiseCheque::generatePdf", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 93f5f017c44..71c9dc44d81 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -81,7 +81,7 @@ class Paiement extends CommonObject $sql.= ' WHERE p.fk_paiement = c.id'; $sql.= ' AND p.rowid = '.$id; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) @@ -161,7 +161,7 @@ class Paiement extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)"; $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")"; - dol_syslog(get_class($this)."::Create insert paiement sql=".$sql); + dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -581,7 +581,7 @@ class Paiement extends CommonObject $sql.= " SET datep = '".$this->db->idate($date)."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update_date sql=".$sql); + dol_syslog(get_class($this)."::update_date", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -613,7 +613,7 @@ class Paiement extends CommonObject $sql.= " SET num_paiement = '".$this->db->escape($num)."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update_num sql=".$sql); + dol_syslog(get_class($this)."::update_num", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 3a010bcae37..5c6562b6fc0 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -211,7 +211,7 @@ $sql.= ' WHERE pf.fk_charge = f.rowid AND f.fk_type = pc.id'; $sql.= ' AND f.entity = '.$conf->entity; $sql.= ' AND pf.rowid = '.$paiement->id; -dol_syslog("compta/payment_sc/fiche.php sql=".$sql); +dol_syslog("compta/payment_sc/fiche.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 6840fcf139d..3d224bbe274 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -279,7 +279,7 @@ class BonPrelevement extends CommonObject $sql.= " WHERE p.rowid = ".$rowid; $sql.= " AND p.entity = ".$conf->entity; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -779,7 +779,7 @@ class BonPrelevement extends CommonObject //if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; //if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -896,7 +896,7 @@ class BonPrelevement extends CommonObject $sql.= " WHERE ref LIKE '".$ref."%'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -922,7 +922,7 @@ class BonPrelevement extends CommonObject $sql.= ", '".$this->db->idate($now)."'"; $sql.= ")"; - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -983,7 +983,7 @@ class BonPrelevement extends CommonObject $sql.= ", fk_prelevement_bons = ".$prev_id; $sql.= " WHERE rowid = ".$fac[1]; - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1040,7 +1040,7 @@ class BonPrelevement extends CommonObject $sql.= " WHERE rowid = ".$prev_id; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1411,32 +1411,32 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$CrLf); fputs($this->file, ''.$CrLf); - $sql = "SELECT pl.amount"; - $sql.= " FROM"; - $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; - $sql.= " ".MAIN_DB_PREFIX."facture as f,"; - $sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; - $sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; - $sql.= " AND pf.fk_facture = f.rowid"; - - //Lines - $i = 0; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - $this->total = $this->total + $obj->amount; - $i++; - } - } - else - { - $result = -2; + $sql = "SELECT pl.amount"; + $sql.= " FROM"; + $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; + $sql.= " ".MAIN_DB_PREFIX."facture as f,"; + $sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf"; + $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; + $sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; + $sql.= " AND pf.fk_facture = f.rowid"; + + //Lines + $i = 0; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $this->total = $this->total + $obj->amount; + $i++; + } + } + else + { + $result = -2; } } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index d68aa528122..5dcd09814ad 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -190,7 +190,7 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY s.nom, s.rowid"; $sql.= " ORDER BY s.nom, s.rowid"; -dol_syslog("get customer invoices sql=".$sql); +dol_syslog("get customer invoices", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -235,7 +235,7 @@ if ($modecompta != 'CREANCES-DETTES') $sql.= " GROUP BY nom, idp"; $sql.= " ORDER BY nom"; - dol_syslog("get old customer payments not linked to invoices sql=".$sql); + dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -320,7 +320,7 @@ print ''.$langs->trans("SuppliersInvoices").''; $subtotal_ht = 0; $subtotal_ttc = 0; -dol_syslog("get suppliers invoices sql=".$sql); +dol_syslog("get suppliers invoices", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -401,7 +401,7 @@ $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, c.id"; $sql.= " ORDER BY c.libelle, c.id"; -dol_syslog("get social contributions deductible=0 sql=".$sql); +dol_syslog("get social contributions deductible=0", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; @@ -478,7 +478,7 @@ else $sql.= " ORDER BY c.libelle, c.id"; } -dol_syslog("get social contributions deductible=1 sql=".$sql); +dol_syslog("get social contributions deductible=1", LOG_DEBUG); $result=$db->query($sql); $subtotal_ht = 0; $subtotal_ttc = 0; @@ -564,7 +564,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get vat to pay sql=".$sql); + dol_syslog("get vat to pay", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -609,7 +609,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get vat received back sql=".$sql); + dol_syslog("get vat received back", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -653,7 +653,7 @@ else $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get vat really paid sql=".$sql); + dol_syslog("get vat really paid", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -694,7 +694,7 @@ else $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get vat really received back sql=".$sql); + dol_syslog("get vat really received back", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index b3a42d85a6b..c61c8b76e08 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -123,7 +123,7 @@ $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; //print $sql; -dol_syslog("get customers invoices sql=".$sql); +dol_syslog("get customers invoices", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -157,7 +157,7 @@ if ($modecompta != 'CREANCES-DETTES') $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; - dol_syslog("get old customers payments not linked to invoices sql=".$sql); + dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -208,7 +208,7 @@ $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND f.fk_soc = ".$socid; $sql.= " GROUP BY dm"; -dol_syslog("get suppliers invoices sql=".$sql); +dol_syslog("get suppliers invoices", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -249,7 +249,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " AND f.entity = ".$conf->entity; $sql.= " GROUP BY dm"; - dol_syslog("get vat to pay sql=".$sql); + dol_syslog("get vat to pay", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -280,7 +280,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " AND f.entity = ".$conf->entity; $sql.= " GROUP BY dm"; - dol_syslog("get vat to receive back sql=".$sql); + dol_syslog("get vat to receive back", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -311,7 +311,7 @@ else { $sql.= " AND t.entity = ".$conf->entity; $sql.= " GROUP BY dm"; - dol_syslog("get vat really paid sql=".$sql); + dol_syslog("get vat really paid", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -340,7 +340,7 @@ else { $sql.= " AND t.entity = ".$conf->entity; $sql.= " GROUP BY dm"; - dol_syslog("get vat really received back sql=".$sql); + dol_syslog("get vat really received back", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -390,7 +390,7 @@ else $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; -dol_syslog("get social contributions deductible=0 sql=".$sql); +dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); @@ -440,7 +440,7 @@ else $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; -dol_syslog("get social contributions paid deductible=1 sql=".$sql); +dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index ecf4b16212b..76a781bfe9b 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -114,7 +114,7 @@ class PaymentSalary extends CommonObject $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -174,7 +174,7 @@ class PaymentSalary extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql.= " WHERE s.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -230,7 +230,7 @@ class PaymentSalary extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -355,7 +355,7 @@ class PaymentSalary extends CommonObject $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6404d9f26c8..09e4ebaef0c 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -74,7 +74,7 @@ class ChargeSociales extends CommonObject $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -137,7 +137,7 @@ class ChargeSociales extends CommonObject $sql.= " ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -192,7 +192,7 @@ class ChargeSociales extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge where fk_charge='".$this->id."'"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -204,7 +204,7 @@ class ChargeSociales extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$this->id."'"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -243,7 +243,7 @@ class ChargeSociales extends CommonObject $sql.= " periode='".$this->db->idate($this->periode)."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -419,7 +419,7 @@ class ChargeSociales extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.$table; $sql.= ' WHERE '.$field.' = '.$this->id; - dol_syslog(get_class($this)."::getSommePaiement sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -449,7 +449,7 @@ class ChargeSociales extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; $sql.= " WHERE e.rowid = ".$id; - dol_syslog(get_class($this)."::info sql=".$sql); + dol_syslog(get_class($this)."::info", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index e89f2a273f8..95e796f98a0 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -116,7 +116,7 @@ class PaymentSocialContribution extends CommonObject $sql.= " ".$this->paiementtype.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($this->note)."', ".$user->id.","; $sql.= " 0)"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -173,7 +173,7 @@ class PaymentSocialContribution extends CommonObject $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid'; $sql.= " WHERE t.rowid = ".$id." AND t.fk_typepaiement = pt.id"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -263,7 +263,7 @@ class PaymentSocialContribution extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -321,7 +321,7 @@ class PaymentSocialContribution extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; $sql.= " WHERE type='payment_sc' AND url_id=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } @@ -331,7 +331,7 @@ class PaymentSocialContribution extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } @@ -560,7 +560,7 @@ class PaymentSocialContribution extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update_fk_bank sql=".$sql); + dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 2b2ad5be02f..1bc88e176d9 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -212,7 +212,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " GROUP BY p.rowid"; $sql.= " ORDER BY p.ref"; - dol_syslog("cabyprodserv sql=".$sql); + dol_syslog("cabyprodserv", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index fd4afbfdf01..3535db5594a 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -250,7 +250,7 @@ $sql.= " GROUP BY s.rowid, s.nom"; $sql.= " ORDER BY s.rowid"; //echo $sql; -dol_syslog("casoc sql=".$sql); +dol_syslog("casoc", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index c605c97fed9..386158d1c7e 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -115,7 +115,7 @@ class Tva extends CommonObject $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -178,7 +178,7 @@ class Tva extends CommonObject $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -233,7 +233,7 @@ class Tva extends CommonObject $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); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -286,7 +286,7 @@ class Tva extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -539,7 +539,7 @@ class Tva extends CommonObject $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::addPayment sql=".$sql); + dol_syslog(get_class($this)."::addPayment", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4187de7136c..727fa6486a9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -155,7 +155,7 @@ class Contact extends CommonObject $sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -276,7 +276,7 @@ class Contact extends CommonObject $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0"); $sql .= " WHERE rowid=".$this->db->escape($id); - dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -444,7 +444,7 @@ class Contact extends CommonObject if ($user) $sql .= ", fk_user_modif=".$user->id; $sql.= " WHERE rowid=".$this->db->escape($id); - dol_syslog(get_class($this)."::update_perso this->birthday=".$this->birthday." - sql=".$sql); + dol_syslog(get_class($this)."::update_perso this->birthday=".$this->birthday." -", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -523,7 +523,7 @@ class Contact extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; $sql.= " WHERE c.rowid = ". $id; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -664,7 +664,7 @@ class Contact extends CommonObject $sql.=" AND fk_socpeople = ". $this->id; $sql.=" GROUP BY tc.element"; - dol_syslog(get_class($this)."::load_ref_elements sql=".$sql); + dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -716,7 +716,7 @@ class Contact extends CommonObject $sql.= " WHERE ec.fk_socpeople=".$this->id; $sql.= " AND ec.fk_c_type_contact=tc.rowid"; $sql.= " AND tc.source='external'"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -751,7 +751,7 @@ class Contact extends CommonObject { // Remove category $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -766,7 +766,7 @@ class Contact extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; $sql .= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if (! $result) { @@ -866,7 +866,7 @@ class Contact extends CommonObject $sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'"; $sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes - dol_syslog(get_class($this)."::getNbOfEMailings sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getNbOfEMailings", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1070,7 +1070,7 @@ class Contact extends CommonObject $sql.= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); - dol_syslog(get_class($this)."::setstatus sql=".$sql); + dol_syslog(get_class($this)."::setstatus", LOG_DEBUG); if ($result) { // Appel des triggers diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 8e1d54944c0..5c2b2f04938 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -239,7 +239,7 @@ else } //print $sql; -dol_syslog("contact/list.php sql=".$sql); +dol_syslog("contact/list.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index daf22e0af7c..140d64c2daf 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -154,7 +154,7 @@ class Contrat extends CommonObject $sql.= " commentaire = '".$this->db->escape($comment)."'"; $sql.= " WHERE rowid = ".$line_id . " AND (statut = 0 OR statut = 3 OR statut = 5)"; - dol_syslog(get_class($this)."::active_line sql=".$sql); + dol_syslog(get_class($this)."::active_line", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -315,7 +315,7 @@ class Contrat extends CommonObject //$sql.= ", fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; $sql .= " WHERE rowid = ".$this->id . " AND statut = 0"; - dol_syslog(get_class($this)."::validate sql=".$sql); + dol_syslog(get_class($this)."::validate", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -416,7 +416,7 @@ class Contrat extends CommonObject } else $sql.= " WHERE rowid=".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -505,7 +505,7 @@ class Contrat extends CommonObject $sql.= " WHERE d.fk_contrat = ".$this->id ." AND d.fk_product = p.rowid"; $sql.= " ORDER by d.rowid ASC"; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -794,7 +794,7 @@ class Contrat extends CommonObject } else { - $this->error=$langs->trans("UnknownError: ".$this->db->error()." - sql=".$sql); + $this->error=$langs->trans("UnknownError: ".$this->db->error()." -", LOG_DEBUG); dol_syslog(get_class($this)."::create - 10 - ".$this->error, LOG_ERR); $this->db->rollback(); @@ -840,7 +840,7 @@ class Contrat extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."contratdet_log as cdl, ".MAIN_DB_PREFIX."contratdet as cd"; $sql.= " WHERE cdl.fk_contratdet=cd.rowid AND cd.fk_contrat=".$this->id; - dol_syslog(get_class($this)."::delete contratdet_log sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete contratdet_log", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -861,7 +861,7 @@ class Contrat extends CommonObject $sql= "DELETE FROM ".MAIN_DB_PREFIX."contratdet_log "; $sql.= " WHERE ".MAIN_DB_PREFIX."contratdet_log.rowid IN (".implode(",",$tab_resql).")"; - dol_syslog(get_class($this)."::delete contratdet_log sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete contratdet_log", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -877,7 +877,7 @@ class Contrat extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet"; $sql.= " WHERE fk_contrat=".$this->id; - dol_syslog(get_class($this)."::delete contratdet sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete contratdet", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -892,7 +892,7 @@ class Contrat extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."contrat"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete contrat sql=".$sql); + dol_syslog(get_class($this)."::delete contrat", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1067,7 +1067,7 @@ class Contrat extends CommonObject if ($date_end > 0) { $sql.= ",'".$this->db->idate($date_end)."'"; } $sql.= ")"; - dol_syslog(get_class($this)."::addline sql=".$sql); + dol_syslog(get_class($this)."::addline", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -1214,7 +1214,7 @@ class Contrat extends CommonObject else { $sql.=",date_cloture=null"; } $sql .= " WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::updateline sql=".$sql); + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1258,7 +1258,7 @@ class Contrat extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet"; $sql.= " WHERE rowid=".$idline; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -1468,7 +1468,7 @@ class Contrat extends CommonObject $sql.= " WHERE fk_contrat =".$this->id; if ($statut >= 0) $sql.= " AND statut = '$statut'"; - dol_syslog(get_class($this)."::array_detail() sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::array_detail()", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1504,7 +1504,7 @@ class Contrat extends CommonObject $sql.= " WHERE fk_soc =".$this->socid; if ($option == 'others') $sql.= " AND c.rowid != ".$this->id; - dol_syslog(get_class($this)."::getOtherContracts() sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::getOtherContracts()", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1944,7 +1944,7 @@ class ContratLigne if ($id) $sql.= " WHERE t.rowid = ".$id; if ($ref) $sql.= " WHERE t.rowid = '".$ref."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2099,7 +2099,7 @@ class ContratLigne $sql.= " commentaire='".$this->db->escape($this->commentaire)."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2147,7 +2147,7 @@ class ContratLigne $sql.= ",total_ttc=".price2num($this->total_ttc,'MT').""; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update_total sql=".$sql); + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 772b0e1ecdc..680ea9c201f 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -312,7 +312,7 @@ $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.statut, s.nom, s.rowid"; $sql.= " ORDER BY c.tms DESC"; $sql.= " LIMIT ".$max; -dol_syslog("contrat/index.php sql=".$sql, LOG_DEBUG); +dol_syslog("contrat/index.php", LOG_DEBUG); $result=$db->query($sql); if ($result) { diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 382dcad5e93..2f656d14211 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -113,7 +113,7 @@ $sql .= $db->order($sortfield,$sortorder); $sql .= $db->plimit($limit + 1, $offset); //print $sql; -dol_syslog("contrat/services.php sql=".$sql); +dol_syslog("contrat/services.php", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index ff63927b526..9dcfc76016a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -77,7 +77,7 @@ class box_actions extends ModeleBoxes $sql.= " ORDER BY a.datec DESC"; $sql.= $db->plimit($max, 0); - dol_syslog("Box_actions::loadBox sql=".$sql, LOG_DEBUG); + dol_syslog("Box_actions::loadBox", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index b2ad0a6b718..12145294d64 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -73,7 +73,7 @@ class box_clients extends ModeleBoxes $sql.= " ORDER BY s.tms DESC"; $sql.= $db->plimit($max, 0); - dol_syslog(get_class($this)."::loadBox sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 8fdc4aff39e..c66326b27fb 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -90,7 +90,7 @@ class box_comptes extends ModeleBoxes $sql.= " ORDER BY label"; $sql.= $db->plimit($max, 0); - dol_syslog(get_class($this)."::loadBox sql=".$sql); + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 9c7a666bc4a..c0234f97dc3 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -73,7 +73,7 @@ class box_prospect extends ModeleBoxes $sql.= " ORDER BY s.tms DESC"; $sql.= $db->plimit($max, 0); - dol_syslog(get_class($this)."::loadBox sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 80d719decae..0bea45832e6 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -47,7 +47,7 @@ abstract class CommonInvoice extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.$table; $sql.= ' WHERE '.$field.' = '.$this->id; - dol_syslog(get_class($this)."::getSommePaiement sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e2b79448ea8..2eb63db6d9b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -78,7 +78,7 @@ abstract class CommonObject return -1; } - dol_syslog(get_class()."::isExistingObject sql=".$sql); + dol_syslog(get_class()."::isExistingObject", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -212,7 +212,7 @@ abstract class CommonObject $sql.= "'".$this->db->idate($datecreate)."'"; $sql.= ", 4, '". $id_type_contact . "' "; $sql.= ")"; - dol_syslog(get_class($this)."::add_contact sql=".$sql); + dol_syslog(get_class($this)."::add_contact", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -316,7 +316,7 @@ abstract class CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; $sql.= " WHERE rowid =".$rowid; - dol_syslog(get_class($this)."::delete_contact sql=".$sql); + dol_syslog(get_class($this)."::delete_contact", LOG_DEBUG); if ($this->db->query($sql)) { if (! $notrigger) @@ -361,7 +361,7 @@ abstract class CommonObject $sql.= " WHERE element_id =".$this->id; $sql.= " AND fk_c_type_contact IN (".$listId.")"; - dol_syslog(get_class($this)."::delete_linked_contact sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete_linked_contact", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -406,7 +406,7 @@ abstract class CommonObject if ($statut >= 0) $sql.= " AND ec.statut = '".$statut."'"; $sql.=" ORDER BY t.lastname ASC"; - dol_syslog(get_class($this)."::liste_contact sql=".$sql); + dol_syslog(get_class($this)."::liste_contact", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -461,7 +461,7 @@ abstract class CommonObject $sql.= " AND ec.fk_c_type_contact=tc.rowid"; $sql.= " AND tc.element = '".$this->element."'"; - dol_syslog(get_class($this)."::swapContactStatus sql=".$sql); + dol_syslog(get_class($this)."::swapContactStatus", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -563,7 +563,7 @@ abstract class CommonObject $sql.= " AND tc.active = 1"; if ($status) $sql.= " AND ec.statut = ".$status; - dol_syslog(get_class($this)."::getIdContact sql=".$sql); + dol_syslog(get_class($this)."::getIdContact", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -805,7 +805,7 @@ abstract class CommonObject if (is_object($user)) $sql.=", fk_user_modif = ".$user->id; $sql.= " WHERE ".$id_field." = ".$id; - dol_syslog(get_class($this)."::".__FUNCTION__." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -931,7 +931,7 @@ abstract class CommonObject else $sql.= ' SET fk_projet = NULL'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setProject sql=".$sql); + dol_syslog(get_class($this)."::setProject", LOG_DEBUG); if ($this->db->query($sql)) { $this->fk_project = $projectid; @@ -1075,7 +1075,7 @@ abstract class CommonObject // if ($this->element == 'facture') $sql.= " AND fk_statut < 2"; // if ($this->element == 'propal') $sql.= " AND fk_statut = 0"; - dol_syslog(get_class($this)."::setDocModel sql=".$sql); + dol_syslog(get_class($this)."::setDocModel", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1119,7 +1119,7 @@ abstract class CommonObject if (! $renum) $sql.= ' AND rang = 0'; if ($renum) $sql.= ' AND rang <> 0'; - dol_syslog(get_class($this)."::line_order sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::line_order", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1139,7 +1139,7 @@ abstract class CommonObject if ($fk_parent_line) $sql.= ' AND fk_parent_line IS NULL'; $sql.= ' ORDER BY rang ASC, rowid '.$rowidorder; - dol_syslog(get_class($this)."::line_order search all parent lines sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::line_order search all parent lines", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1191,7 +1191,7 @@ abstract class CommonObject $sql.= ' AND fk_parent_line = '.$id; $sql.= ' ORDER BY rang ASC'; - dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getChildrenOfLine search children lines for line ".$id."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1259,7 +1259,7 @@ abstract class CommonObject $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET rang = '.$rang; $sql.= ' WHERE rowid = '.$rowid; - dol_syslog(get_class($this)."::updateRangOfLine sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::updateRangOfLine", LOG_DEBUG); if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -1353,7 +1353,7 @@ abstract class CommonObject $sql = 'SELECT rang FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE rowid ='.$rowid; - dol_syslog(get_class($this)."::getRangOfLine sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getRangOfLine", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1396,7 +1396,7 @@ abstract class CommonObject $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; $sql.= ' AND fk_parent_line = '.$fk_parent_line; - dol_syslog(get_class($this)."::line_max sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::line_max", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1417,7 +1417,7 @@ abstract class CommonObject $sql = 'SELECT max(rang) FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; - dol_syslog(get_class($this)."::line_max sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::line_max", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1445,7 +1445,7 @@ abstract class CommonObject $sql.= " SET ref_ext = '".$this->db->escape($ref_ext)."'"; $sql.= " WHERE ".(isset($this->table_rowid)?$this->table_rowid:'rowid')." = ". $this->id; - dol_syslog(get_class($this)."::update_ref_ext sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update_ref_ext", LOG_DEBUG); if ($this->db->query($sql)) { $this->ref_ext = $ref_ext; @@ -1483,7 +1483,7 @@ abstract class CommonObject $sql.= " SET note".$suffix." = ".(!empty($note)?("'".$this->db->escape($note)."'"):"NULL"); $sql.= " WHERE rowid =". $this->id; - dol_syslog(get_class($this)."::update_note sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update_note", LOG_DEBUG); if ($this->db->query($sql)) { if ($suffix == '_public') $this->note_public = $note; @@ -1558,7 +1558,7 @@ abstract class CommonObject } $sql.= ' ORDER by rowid'; // We want to be sure to always use same order of line to not change lines differently when option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND is used - dol_syslog(get_class($this)."::update_price sql=".$sql); + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1658,7 +1658,7 @@ abstract class CommonObject $sql .= ' WHERE rowid = '.$this->id; //print "xx".$sql; - dol_syslog(get_class($this)."::update_price sql=".$sql); + dol_syslog(get_class($this)."::update_price", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1710,7 +1710,7 @@ abstract class CommonObject $sql.= ", '".$this->element."'"; $sql.= ")"; - dol_syslog(get_class($this)."::add_object_linked sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG); if ($this->db->query($sql)) { $this->db->commit(); @@ -1787,7 +1787,7 @@ abstract class CommonObject $sql .= ' ORDER BY sourcetype'; //print $sql; - dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql); + dol_syslog(get_class($this)."::fetchObjectLink", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1912,7 +1912,7 @@ abstract class CommonObject $sql.= " AND sourcetype = '".$this->element."'"; } - dol_syslog(get_class($this)."::updateObjectLinked sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -1966,7 +1966,7 @@ abstract class CommonObject $sql.= " (fk_target = ".$this->id." AND targettype = '".$this->element."')"; } - dol_syslog(get_class($this)."::deleteObjectLinked sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -2001,7 +2001,7 @@ abstract class CommonObject $sql.= " SET ".$fieldstatus." = ".$status; $sql.= " WHERE rowid=".$elementId; - dol_syslog(get_class($this)."::setStatut sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); if ($this->db->query($sql)) { $this->db->commit(); @@ -2110,7 +2110,7 @@ abstract class CommonObject $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields"; $sql.= " WHERE fk_object = ".$rowid; - dol_syslog(get_class($this)."::fetch_optionals sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_optionals", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2258,7 +2258,7 @@ abstract class CommonObject } $sql.=")"; - dol_syslog(get_class($this)."::insertExtraFields insert sql=".$sql); + dol_syslog(get_class($this)."::insertExtraFields insert", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -2527,7 +2527,7 @@ abstract class CommonObject $sql.= " SET extraparams = ".(! empty($extraparams) ? "'".$this->db->escape($extraparams)."'" : "null"); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::setExtraParameters sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::setExtraParameters", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -3328,7 +3328,7 @@ abstract class CommonObject $sql.= ", '".$mandatory."'"; $sql.= ")"; - dol_syslog(get_class($this)."::add_element_resource sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::add_element_resource", LOG_DEBUG); if ($this->db->query($sql)) { $this->db->commit(); @@ -3359,7 +3359,7 @@ abstract class CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; $sql.= " WHERE rowid =".$rowid; - dol_syslog(get_class($this)."::delete_resource sql=".$sql); + dol_syslog(get_class($this)."::delete_resource", LOG_DEBUG); if ($this->db->query($sql)) { if (! $notrigger) diff --git a/htdocs/core/class/cpays.class.php b/htdocs/core/class/cpays.class.php index e6db8e4b2e9..5e32b9bad22 100644 --- a/htdocs/core/class/cpays.class.php +++ b/htdocs/core/class/cpays.class.php @@ -97,7 +97,7 @@ class Cpays // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -158,7 +158,7 @@ class Cpays // extends CommonObject if ($id) $sql.= " WHERE t.rowid = ".$id; elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -217,7 +217,7 @@ class Cpays // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -273,7 +273,7 @@ class Cpays // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 33070f83412..057e23892b4 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -102,7 +102,7 @@ class Ctypent // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -163,7 +163,7 @@ class Ctypent // extends CommonObject if ($id) $sql.= " WHERE t.id = ".$id; elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -222,7 +222,7 @@ class Ctypent // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -278,7 +278,7 @@ class Ctypent // extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 23ce9f97f6d..6d45f1034f4 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -85,7 +85,7 @@ class DiscountAbsolute if ($rowid) $sql.= " sr.rowid=".$rowid; if ($fk_facture_source) $sql.= " sr.fk_facture_source=".$fk_facture_source; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -159,7 +159,7 @@ class DiscountAbsolute $sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -195,7 +195,7 @@ class DiscountAbsolute $sql.=" AND fk_facture_source = ".$this->fk_facture_source; //$sql.=" AND rowid != ".$this->id; - dol_syslog(get_class($this)."::delete Check if we can remove discount sql=".$sql); + dol_syslog(get_class($this)."::delete Check if we can remove discount", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -222,7 +222,7 @@ class DiscountAbsolute $sql.= " AND (fk_facture_line IS NULL"; // Not used as absolute simple discount $sql.= " AND fk_facture IS NULL)"; // Not used as credit note and not used as deposit - dol_syslog(get_class($this)."::delete Delete discount sql=".$sql); + dol_syslog(get_class($this)."::delete Delete discount", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -233,7 +233,7 @@ class DiscountAbsolute $sql.=" set paye=0, fk_statut=1"; $sql.=" WHERE (type = 2 or type = 3) AND rowid=".$this->fk_facture_source; - dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut sql=".$sql); + dol_syslog(get_class($this)."::delete Update credit note or deposit invoice statut", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -291,7 +291,7 @@ class DiscountAbsolute if ($rowidinvoice) $sql.=" SET fk_facture = ".$rowidinvoice; $sql.=" WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::link_to_invoice sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::link_to_invoice", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -320,7 +320,7 @@ class DiscountAbsolute $sql.=" SET fk_facture_line = NULL, fk_facture = NULL"; $sql.=" WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::unlink_invoice sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::unlink_invoice", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -355,7 +355,7 @@ class DiscountAbsolute if ($filter) $sql.=' AND ('.$filter.')'; if ($maxvalue) $sql.=' AND rc.amount_ttc <= '.price2num($maxvalue); - dol_syslog(get_class($this)."::getAvailableDiscounts sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::getAvailableDiscounts", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -384,7 +384,7 @@ class DiscountAbsolute $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql.= ' AND f.type = 2'; - dol_syslog(get_class($this)."::getSumCreditNotesUsed sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -410,7 +410,7 @@ class DiscountAbsolute $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql.= ' AND f.type = 3'; - dol_syslog(get_class($this)."::getSumDepositsUsed sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index b344a0c4059..98e4b101669 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -132,7 +132,7 @@ class Events // extends CommonObject $sql.= " '".$this->db->escape($this->description)."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -174,7 +174,7 @@ class Events // extends CommonObject $sql.= " description='".$this->db->escape($this->description)."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -209,7 +209,7 @@ class Events // extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."events as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -252,7 +252,7 @@ class Events // extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."events"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index df302f0ffad..df6d16767d6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -255,7 +255,7 @@ class ExtraFields $sql.= " '".$params."'"; $sql.=')'; - dol_syslog(get_class($this)."::create_label sql=".$sql); + dol_syslog(get_class($this)."::create_label", LOG_DEBUG); if ($this->db->query($sql)) { return 1; @@ -318,7 +318,7 @@ class ExtraFields $sql.= " AND entity IN (0,".$conf->entity.')'; $sql.= " AND elementtype = '".$elementtype."'"; - dol_syslog(get_class($this)."::delete_label sql=".$sql); + dol_syslog(get_class($this)."::delete_label", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -480,7 +480,7 @@ class ExtraFields $sql.= " '".$pos."',"; $sql.= " '".$param."'"; $sql.= ")"; - dol_syslog(get_class($this)."::update_label sql=".$sql); + dol_syslog(get_class($this)."::update_label", LOG_DEBUG); $resql2=$this->db->query($sql); if ($resql1 && $resql2) @@ -537,7 +537,7 @@ class ExtraFields if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'"; $sql.= " ORDER BY pos"; - dol_syslog(get_class($this)."::fetch_name_optionals_label sql=".$sql); + dol_syslog(get_class($this)."::fetch_name_optionals_label", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bd4783282f2..c83bbf6864c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -486,7 +486,7 @@ class Form $sql.= " WHERE active = 1"; //$sql.= " ORDER BY code ASC"; - dol_syslog(get_class($this)."::select_country sql=".$sql); + dol_syslog(get_class($this)."::select_country", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -795,7 +795,7 @@ class Form $sql.=$this->db->order("nom","ASC"); if ($limit > 0) $sql.=$this->db->plimit($limit); - dol_syslog(get_class($this)."::select_thirdparty_list sql=".$sql); + dol_syslog(get_class($this)."::select_thirdparty_list", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -889,7 +889,7 @@ class Form if ($filter) $sql.= " AND ".$filter; $sql.= " ORDER BY re.description ASC"; - dol_syslog(get_class($this)."::select_remises sql=".$sql); + dol_syslog(get_class($this)."::select_remises", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -995,7 +995,7 @@ class Form if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0 "; $sql.= " ORDER BY sp.lastname ASC"; - dol_syslog(get_class($this)."::select_contacts sql=".$sql); + dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1162,7 +1162,7 @@ class Form if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 "; $sql.= " ORDER BY u.lastname ASC"; - dol_syslog(get_class($this)."::select_dolusers sql=".$sql); + dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1412,7 +1412,7 @@ class Form $sql.= $db->plimit($limit); // Build output string - dol_syslog(get_class($this)."::select_produits_list search product sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::select_produits_list search product", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -1435,7 +1435,7 @@ class Form $sql.= " WHERE fk_product_price=".$objp->price_rowid; $sql.= " ORDER BY quantity ASC"; - dol_syslog(get_class($this)."::select_produits_list search price by qty sql=".$sql); + dol_syslog(get_class($this)."::select_produits_list search price by qty", LOG_DEBUG); $result2 = $this->db->query($sql); if ($result2) { @@ -1775,7 +1775,7 @@ class Form // Build output string - dol_syslog(get_class($this)."::select_produits_fournisseurs_list sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::select_produits_fournisseurs_list", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -1921,7 +1921,7 @@ class Form $sql.= " AND p.rowid = ".$productid; $sql.= " ORDER BY s.nom, pfp.ref_fourn DESC"; - dol_syslog(get_class($this)."::select_product_fourn_price sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::select_product_fourn_price", LOG_DEBUG); $result=$this->db->query($sql); if ($result) @@ -2005,7 +2005,7 @@ class Form $sql .= " WHERE a.fk_soc = ".$socid; $sql .= " ORDER BY a.label ASC"; - dol_syslog(get_class($this)."::select_address sql=".$sql); + dol_syslog(get_class($this)."::select_address", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2167,7 +2167,7 @@ class Form $sql.= " FROM ".MAIN_DB_PREFIX.'c_input_reason'; $sql.= " WHERE active=1"; $sql.= " ORDER BY rowid"; - dol_syslog(get_class($this)."::loadCacheInputReason sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::loadCacheInputReason", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2248,7 +2248,7 @@ class Form $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE active > 0"; $sql.= " ORDER BY id"; - dol_syslog(get_class($this)."::load_cache_types_paiements sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::load_cache_types_paiements", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2437,7 +2437,7 @@ class Form if ($filtre) $sql.=" AND ".$filtre; $sql.= " ORDER BY label"; - dol_syslog(get_class($this)."::select_comptes sql=".$sql); + dol_syslog(get_class($this)."::select_comptes", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -4224,7 +4224,7 @@ class Form if (is_array($include) && $includeGroups) $sql.= " AND ug.rowid IN ('".$includeGroups."')"; $sql.= " ORDER BY ug.nom ASC"; - dol_syslog(get_class($this)."::select_dolgroups sql=".$sql); + dol_syslog(get_class($this)."::select_dolgroups", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a22f0b38c10..2f1be6d7d56 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -229,7 +229,7 @@ class FormCompany if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND p.code = '".$country_codeid."'"; $sql .= " ORDER BY p.code, d.code_departement"; - dol_syslog(get_class($this)."::select_departement sql=".$sql); + dol_syslog(get_class($this)."::select_departement", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -306,7 +306,7 @@ class FormCompany $sql.= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1"; $sql.= " ORDER BY p.code, p.libelle ASC"; - dol_syslog(get_class($this)."::select_region sql=".$sql); + dol_syslog(get_class($this)."::select_region", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -369,7 +369,7 @@ class FormCompany $sql = "SELECT rowid, code, civilite as civility_label, active FROM ".MAIN_DB_PREFIX."c_civilite"; $sql.= " WHERE active = 1"; - dol_syslog("Form::select_civility sql=".$sql); + dol_syslog("Form::select_civility", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -447,7 +447,7 @@ class FormCompany if ($filter) $sql .= " ".$filter; $sql .= " ORDER BY p.code"; - dol_syslog(get_class($this)."::select_juridicalstatus sql=".$sql); + dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index cfc5be29b92..e0d550b4205 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -67,7 +67,7 @@ class FormContract if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; else $sql.= " AND c.fk_soc = ".$socid; - dol_syslog(get_class($this)."::select_contract sql=".$sql); + dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 6bc626b13f3..5ea5b33c1f4 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -116,7 +116,7 @@ class FormOrder $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method"; $sql.= " WHERE active = 1"; - dol_syslog(get_class($this)."::selectInputMethod sql=".$sql); + dol_syslog(get_class($this)."::selectInputMethod", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index b6065909ade..35ebe48e168 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1122,7 +1122,7 @@ class FormOther $sql.= " FROM ".MAIN_DB_PREFIX.$dictionarytable; $sql.= " ORDER BY ".$labelfield; - dol_syslog(get_class($this)."::select_dictionary sql=".$sql); + dol_syslog(get_class($this)."::select_dictionary", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 2c371d4afcd..1ea498e19dd 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -79,7 +79,7 @@ class FormProjets if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; $sql.= " ORDER BY p.title ASC"; - dol_syslog(get_class($this)."::select_projects sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::select_projects", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index fcbe46ab51b..df0f2d644dd 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -56,7 +56,7 @@ class FormPropal $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; $sql .= " WHERE active = 1"; - dol_syslog(get_class($this)."::selectProposalStatus sql=".$sql); + dol_syslog(get_class($this)."::selectProposalStatus", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index f84f14c1446..b3c5a4c7d9c 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -79,7 +79,7 @@ class FormSocialContrib $sql.= " ORDER BY c.libelle ASC"; } - dol_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG); + dol_syslog("Form::select_type_socialcontrib", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index c01d2d1f0f5..43c057ac859 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -73,7 +73,7 @@ class InfoBox } } - dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -212,7 +212,7 @@ class InfoBox $sql.= " AND fk_user = ".$userid; $sql.= " AND position = ".$zone; - dol_syslog(get_class()."::saveboxorder sql=".$sql); + dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -243,7 +243,7 @@ class InfoBox $sql.= " ".$conf->entity; $sql.= ")"; - dol_syslog(get_class()."::saveboxorder sql=".$sql); + dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); $result = $db->query($sql); if ($result < 0) { diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 08d520d519e..e92aa273105 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -93,7 +93,7 @@ class Link extends CommonObject $sql .= ", '" . $this->objecttype . "'"; $sql .= ", " . $this->objectid . ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "links"); @@ -256,7 +256,7 @@ class Link extends CommonObject $sql .= " ORDER BY " . $sortfield . " " . $sortorder; } - dol_syslog(get_class($this)."::fetchAll sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -305,7 +305,7 @@ class Link extends CommonObject $sql .= " WHERE rowid = " . $rowid; if($conf->entity != 0) $sql .= " AND entity = " . $conf->entity; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 966b9ac7f77..60375f8c283 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -162,7 +162,7 @@ class Menubase $sql.= " '".$this->user."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -232,7 +232,7 @@ class Menubase $sql.= " usertype='".$this->user."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -277,7 +277,7 @@ class Menubase $sql.= " FROM ".MAIN_DB_PREFIX."menu as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -330,7 +330,7 @@ class Menubase $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -516,7 +516,7 @@ class Menubase //$tmp1=dol_microtime_float(); //print '>>> 1 0
'; - dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)." sql=".$sql); + dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 317b00dd33a..03e2a641828 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -99,7 +99,7 @@ class Notify $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND s.rowid = ".$socid; - dol_syslog("Notify.class::countDefinedNotifications ".$action.", ".$socid." sql=".$sql); + dol_syslog("Notify.class::countDefinedNotifications ".$action.", ".$socid."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -147,7 +147,7 @@ class Notify else $sql.= " AND a.code = '".$action."'"; // New usage $sql .= " AND s.rowid = ".$socid; - dol_syslog("Notify::send sql=".$sql); + dol_syslog("Notify::send", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -226,7 +226,7 @@ class Notify $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_contact, objet_type, objet_id, email)"; $sql.= " VALUES ('".$this->db->idate($now)."', ".$actiondefid.", ".$obj->cid.", '".$objet_type."', ".$objet_id.", '".$this->db->escape($obj->email)."')"; - dol_syslog("Notify::send sql=".$sql); + dol_syslog("Notify::send", LOG_DEBUG); if (! $this->db->query($sql) ) { dol_print_error($this->db); diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 5018d63cecf..b2e85b3113a 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -334,7 +334,7 @@ abstract class Stats { $result = array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -364,7 +364,7 @@ abstract class Stats { $result = array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -400,7 +400,7 @@ abstract class Stats $result=array(); $res=array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -451,7 +451,7 @@ abstract class Stats $result=array(); $res=array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -499,7 +499,7 @@ abstract class Stats $result=array(); $res=array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -548,7 +548,7 @@ abstract class Stats $result=array(); $res=array(); - dol_syslog(get_class($this).'::'.__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this).'::'.__FUNCTION__."", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 00cc3868cd6..5e5b4c360d0 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -849,7 +849,7 @@ class DoliDBMysql extends DoliDB $sql="FLUSH Privileges"; - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); $resql=$this->query($sql); if (! $resql) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 336780a1a09..16915dcd22d 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -853,7 +853,7 @@ class DoliDBMysqli extends DoliDB $sql="FLUSH Privileges"; - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); $resql=$this->query($sql); if (! $resql) { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index f06a92c401f..45c1bbd182f 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -981,7 +981,7 @@ class DoliDBSqlite extends DoliDB $sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_name)."','".addslashes($dolibarr_main_db_user)."'"; $sql.= ",'Y','Y','Y','Y','Y','Y','Y','Y','Y')"; - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); $resql=$this->query($sql); if (! $resql) { @@ -991,7 +991,7 @@ class DoliDBSqlite extends DoliDB $sql="FLUSH Privileges"; - dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql); + dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); $resql=$this->query($sql); if (! $resql) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 2f5e217641f..9040d6a1caf 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -393,7 +393,7 @@ function dolibarr_del_const($db, $name, $entity=1) $sql.= ")"; if ($entity >= 0) $sql.= " AND entity = ".$entity; - dol_syslog("admin.lib::dolibarr_del_const sql=".$sql); + dol_syslog("admin.lib::dolibarr_del_const", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -427,7 +427,7 @@ function dolibarr_get_const($db, $name, $entity=1) $sql.= " WHERE name = ".$db->encrypt($name,1); $sql.= " AND entity = ".$entity; - dol_syslog("admin.lib::dolibarr_get_const sql=".$sql); + dol_syslog("admin.lib::dolibarr_get_const", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -474,7 +474,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not $sql.= " WHERE name = ".$db->encrypt($name,1); if ($entity >= 0) $sql.= " AND entity = ".$entity; - dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG); + dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG); $resql=$db->query($sql); if (strcmp($value,'')) // true if different. Must work for $value='0' or $value=0 @@ -487,7 +487,7 @@ function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $not //print "sql".$value."-".pg_escape_string($value)."-".$sql;exit; //print "xx".$db->escape($value); - dol_syslog("admin.lib::dolibarr_set_const sql=".$sql, LOG_DEBUG); + dol_syslog("admin.lib::dolibarr_set_const", LOG_DEBUG); $resql=$db->query($sql); } @@ -1041,7 +1041,7 @@ function form_constantes($tableau,$strictw3c=0) $sql.= " ORDER BY name ASC, entity DESC"; $result = $db->query($sql); - dol_syslog("List params sql=".$sql); + dol_syslog("List params", LOG_DEBUG); if ($result) { $obj = $db->fetch_object($result); // Take first result of select @@ -1215,7 +1215,7 @@ function addDocumentModel($name, $type, $label='', $description='') $sql.= (! empty($description)?"'".$db->escape($description)."'":"null"); $sql.= ")"; - dol_syslog("admin.lib::addDocumentModel sql=".$sql); + dol_syslog("admin.lib::addDocumentModel", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1248,7 +1248,7 @@ function delDocumentModel($name, $type) $sql.= " AND type = '".$type."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog("admin.lib::delDocumentModel sql=".$sql); + dol_syslog("admin.lib::delDocumentModel", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0851fb0b7c1..9bf8bead072 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -267,7 +267,7 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv= elseif (! empty($searchkey)) $sql.= " WHERE code='".$db->escape($searchkey)."'"; else $sql.= " WHERE libelle='".$db->escape($searchlabel)."'"; - dol_syslog("Company.lib::getCountry sql=".$sql); + dol_syslog("Company.lib::getCountry", LOG_DEBUG); $resql=$dbtouse->query($sql); if ($resql) { @@ -317,7 +317,7 @@ function getState($id,$withcode='',$dbtouse=0) $sql = "SELECT rowid, code_departement as code, nom as label FROM ".MAIN_DB_PREFIX."c_departements"; $sql.= " WHERE rowid=".$id; - dol_syslog("Company.lib::getState sql=".$sql); + dol_syslog("Company.lib::getState", LOG_DEBUG); $resql=$dbtouse->query($sql); if ($resql) { @@ -394,7 +394,7 @@ function getFormeJuridiqueLabel($code) $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_forme_juridique"; $sql.= " WHERE code='$code'"; - dol_syslog("Company.lib::getFormeJuridiqueLabel sql=".$sql); + dol_syslog("Company.lib::getFormeJuridiqueLabel", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -953,7 +953,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; $sql.= " ORDER BY a.datep DESC, a.id DESC"; - dol_syslog("company.lib::show_actions_todo sql=".$sql); + dol_syslog("company.lib::show_actions_todo", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -1089,7 +1089,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; $sql.= " ORDER BY a.datep DESC, a.id DESC"; - dol_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG); + dol_syslog("company.lib::show_actions_done", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1141,7 +1141,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $sql.= " AND mc.fk_mailing=m.rowid"; $sql.= " ORDER BY mc.date_envoi DESC, m.rowid DESC"; - dol_syslog("company.lib::show_actions_done sql=".$sql, LOG_DEBUG); + dol_syslog("company.lib::show_actions_done", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a22c38834cf..1cd4f582494 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2934,7 +2934,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; $sql .= " AND t.taux = ".$tva." AND t.active = 1"; - dol_syslog("get_localtax sql=".$sql); + dol_syslog("get_localtax", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 2f2a313699a..606589971a9 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -744,7 +744,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m if ($sqlwhere) $sql.=' AND '.$sqlwhere; //print $sql.'
'; - dol_syslog("functions2::get_next_value mode=".$mode." sql=".$sql, LOG_DEBUG); + dol_syslog("functions2::get_next_value mode=".$mode."", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -783,7 +783,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; - dol_syslog("functions2::get_next_value sql=".$sql); + dol_syslog("functions2::get_next_value", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1168,7 +1168,7 @@ function dol_set_user_param($db, $conf, &$user, $tab) $i++; } $sql.= ")"; - dol_syslog("functions2.lib::dol_set_user_param sql=".$sql, LOG_DEBUG); + dol_syslog("functions2.lib::dol_set_user_param", LOG_DEBUG); $resql=$db->query($sql); if (! $resql) @@ -1187,7 +1187,7 @@ function dol_set_user_param($db, $conf, &$user, $tab) $sql.= " VALUES (".$user->id.",".$conf->entity.","; $sql.= " '".$key."','".$db->escape($value)."')"; - dol_syslog("functions2.lib::dol_set_user_param sql=".$sql, LOG_DEBUG); + dol_syslog("functions2.lib::dol_set_user_param", LOG_DEBUG); $result=$db->query($sql); if (! $result) { diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 9309d083187..39405db4468 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -128,7 +128,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte if ($sqlorder) $sql.=$sqlorder; //print $sql; exit; - dol_syslog("scripts/invoices/rebuild_merge.php: sql=".$sql); + dol_syslog("scripts/invoices/rebuild_merge.php:", LOG_DEBUG); if ($usestdout) print '--- start'."\n"; @@ -139,7 +139,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte $result = 0; $files = array() ; // liste les fichiers - dol_syslog("scripts/invoices/rebuild_merge.php sql=".$sql); + dol_syslog("scripts/invoices/rebuild_merge.php", LOG_DEBUG); if ( $resql=$db->query($sql) ) { $num = $db->num_rows($resql); diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index ac9845f22a1..00144db74e5 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -111,7 +111,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv"; $sql.= " WHERE cv.taux = ".$txtva; $sql.= " AND cv.fk_pays = ".$countryid; - dol_syslog("calcul_price_total search vat information sql=".$sql); + dol_syslog("calcul_price_total search vat information", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 2bfb2ba7c17..d2f3bf563c6 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -171,7 +171,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $sql.= " ORDER BY obj.fk_product"; - dol_syslog("show_list_sending_receive sql=".$sql, LOG_DEBUG); + dol_syslog("show_list_sending_receive", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index a52aeb37345..164d346ac1c 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -194,7 +194,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($sql == 'TODO') return -2; if ($sql != 'TODO') { - dol_syslog("Tax.lib:thirdparty sql=".$sql); + dol_syslog("Tax.lib:thirdparty", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -366,7 +366,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($sql == 'TODO') return -2; if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); + dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG); $resql = $db->query($sql); if ($resql) @@ -531,7 +531,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, if ($sql == 'TODO') return -2; // -2 = Feature not yet available if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::vat_by_date sql=".$sql); + dol_syslog("Tax.lib.php::vat_by_date", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 400b5765719..d1555678313 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -58,7 +58,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= $sql.=' WHERE '.$usernamecol." = '".$db->escape($usertotest)."'"; $sql.=' AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")"; - dol_syslog("functions_dolibarr::check_user_password_dolibarr sql=".$sql); + dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php index e183bc40795..3abb69be4f2 100644 --- a/htdocs/core/login/functions_openid.php +++ b/htdocs/core/login/functions_openid.php @@ -79,7 +79,7 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest) $sql.=" WHERE openid = '".$db->escape($_GET['openid_identity'])."'"; $sql.=" AND entity IN (0," . ($_SESSION["dol_entity"] ? $_SESSION["dol_entity"] : 1) . ")"; - dol_syslog("functions_openid::check_user_password_openid sql=".$sql); + dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index e25f4d0c715..9809c418f0c 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -113,7 +113,7 @@ abstract class DolibarrModules // Add current entity id $sql=str_replace('__ENTITY__', $conf->entity, $sql); - dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror." sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror."", LOG_DEBUG); $result=$this->db->query($sql, $ignoreerror); if (! $result) { @@ -373,7 +373,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->const_name."'"; $sql.= " AND entity IN (0, ".$entity.")"; - dol_syslog(get_class($this)."::_active sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::_active", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $err++; @@ -382,7 +382,7 @@ abstract class DolibarrModules $sql.= ",".$this->db->encrypt('1',1); $sql.= ",0,".$entity.")"; - dol_syslog(get_class($this)."::_active sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::_active", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $err++; @@ -408,7 +408,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." = '".$this->const_name."'"; $sql.= " AND entity IN (0, ".$entity.")"; - dol_syslog(get_class($this)."::_unactive sql=".$sql); + dol_syslog(get_class($this)."::_unactive", LOG_DEBUG); $this->db->query($sql); return $err; @@ -540,7 +540,7 @@ abstract class DolibarrModules $sql.= " AND entity = ".$conf->entity; if ($note) $sql.=" AND note ='".$this->db->escape($note)."'"; - dol_syslog(get_class($this)."::insert_boxes sql=".$sql); + dol_syslog(get_class($this)."::insert_boxes", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -557,7 +557,7 @@ abstract class DolibarrModules $sql.= $note?"'".$this->db->escape($note)."'":"null"; $sql.= ")"; - dol_syslog(get_class($this)."::insert_boxes sql=".$sql); + dol_syslog(get_class($this)."::insert_boxes", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $err++; @@ -575,7 +575,7 @@ abstract class DolibarrModules $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (box_id,position,box_order,fk_user,entity)"; $sql.= " VALUES (".$lastid.", ".$key2.", '0', 0, ".$conf->entity.")"; - dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2." sql=".$sql); + dol_syslog(get_class($this)."::insert_boxes onto page ".$key2."=".$val2."", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $err++; } @@ -634,7 +634,7 @@ abstract class DolibarrModules $sql.= " AND ".MAIN_DB_PREFIX."boxes_def.file = '".$this->db->escape($file)."'"; $sql.= " AND ".MAIN_DB_PREFIX."boxes.entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_boxes sql=".$sql); + dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -647,7 +647,7 @@ abstract class DolibarrModules $sql.= " WHERE file = '".$this->db->escape($file)."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_boxes sql=".$sql); + dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -676,7 +676,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." like '".$this->const_name."_TABS_%'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_tabs sql=".$sql); + dol_syslog(get_class($this)."::delete_tabs", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->lasterror(); @@ -722,7 +722,7 @@ abstract class DolibarrModules $sql.= ", ".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."::insert_tabs sql=".$sql); + dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG); $resql=$this->db->query($sql); /* Allow duplicate key if (! $resql) @@ -784,7 +784,7 @@ abstract class DolibarrModules $sql.= ")"; - dol_syslog(get_class($this)."::insert_const sql=".$sql); + dol_syslog(get_class($this)."::insert_const", LOG_DEBUG); if (! $this->db->query($sql) ) { dol_syslog(get_class($this)."::insert_const ".$this->db->lasterror(), LOG_ERR); @@ -826,7 +826,7 @@ abstract class DolibarrModules $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE ".$this->db->decrypt('name')." = '".$name."'"; $sql.= " AND entity in (0, ".$conf->entity.")"; - dol_syslog(get_class($this)."::delete_const sql=".$sql); + dol_syslog(get_class($this)."::delete_const", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->lasterror(); @@ -904,7 +904,7 @@ abstract class DolibarrModules $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")"; } - dol_syslog(get_class($this)."::insert_permissions sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::insert_permissions", LOG_DEBUG); $resqlinsert=$this->db->query($sql,1); if (! $resqlinsert) { @@ -927,7 +927,7 @@ abstract class DolibarrModules require DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; } $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 1"; - dol_syslog(get_class($this)."::insert_permissions Search all admin users sql=".$sql); + dol_syslog(get_class($this)."::insert_permissions Search all admin users", LOG_DEBUG); $resqlseladmin=$this->db->query($sql,1); if ($resqlseladmin) { @@ -982,7 +982,7 @@ abstract class DolibarrModules $sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def"; $sql.= " WHERE module = '".$this->rights_class."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_permissions sql=".$sql); + dol_syslog(get_class($this)."::delete_permissions", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->lasterror(); @@ -1113,7 +1113,7 @@ abstract class DolibarrModules $sql.= " WHERE module = '".$this->db->escape($this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_menus sql=".$sql); + dol_syslog(get_class($this)."::delete_menus", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -1201,7 +1201,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." = '".$name."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::insert_dirs sql=".$sql); + dol_syslog(get_class($this)."::insert_dirs", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -1212,7 +1212,7 @@ abstract class DolibarrModules $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,type,value,note,visible,entity)"; $sql.= " VALUES (".$this->db->encrypt($name,1).",'chaine',".$this->db->encrypt($dir,1).",'Directory for module ".$this->name."','0',".$conf->entity.")"; - dol_syslog(get_class($this)."::insert_dirs sql=".$sql); + dol_syslog(get_class($this)."::insert_dirs", LOG_DEBUG); $resql=$this->db->query($sql); } } @@ -1242,7 +1242,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_DIR_%'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::delete_dirs sql=".$sql); + dol_syslog(get_class($this)."::delete_dirs", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->lasterror(); @@ -1319,7 +1319,7 @@ abstract class DolibarrModules $sql.= ", ".$entity; $sql.= ")"; - dol_syslog(get_class($this)."::insert_const_".$key." sql=".$sql); + dol_syslog(get_class($this)."::insert_const_".$key."", LOG_DEBUG); $resql=$this->db->query($sql,1); if (! $resql) { @@ -1362,7 +1362,7 @@ abstract class DolibarrModules $sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'"; $sql.= " AND entity = ".$entity; - dol_syslog(get_class($this)."::delete_const_".$key." sql=".$sql); + dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG); if (! $this->db->query($sql)) { $this->error=$this->db->lasterror(); diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index b864205f2c9..7b539f92494 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -186,7 +186,7 @@ class CommActionRapport $sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'"; $sql.= " ORDER BY a.datep DESC"; - dol_syslog(get_class($this)."::_page sql=".$sql); + dol_syslog(get_class($this)."::_page", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 8075099cdd6..92c8f55581c 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -119,7 +119,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes } else { - dol_syslog("mod_commande_marbre::getNextValue sql=".$sql); + dol_syslog("mod_commande_marbre::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index a07f3261133..61ca01ae419 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -116,7 +116,7 @@ class mod_contract_serpis extends ModelNumRefContracts } else { - dol_syslog("mod_contract_serpis::getNextValue sql=".$sql); + dol_syslog("mod_contract_serpis::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index ba779658051..581657c6547 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -116,7 +116,7 @@ class mod_expedition_safor extends ModelNumRefExpedition } else { - dol_syslog("mod_expedition_safor::getNextValue sql=".$sql); + dol_syslog("mod_expedition_safor::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index f1a46913e25..100b9193fd5 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -144,7 +144,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); @@ -168,7 +168,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 9a8b5feaed7..6270bb9ae9c 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -160,7 +160,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); @@ -184,7 +184,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index e83f812e8c4..cd3d82576ff 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -621,7 +621,7 @@ class ImportCsv extends ModeleImports } if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$user->id; $sql.=')'; - dol_syslog("import_csv.modules sql=".$sql); + dol_syslog("import_csv.modules", LOG_DEBUG); //print '> '.join(',',$arrayrecord); //print 'sql='.$sql; diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 77ca85f8e6c..e7cd8c926ac 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -118,7 +118,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); - dol_syslog("mod_livraison_jade::getNextValue sql=".$sql); + dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 0e79a1f6e91..a9df6300f80 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -180,7 +180,7 @@ class mailing_fraise extends MailingTargets //print $sql; // Add targets into table - dol_syslog(get_class($this)."::add_to_target sql=".$sql); + dol_syslog(get_class($this)."::add_to_target", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index da1c914f484..17ae9f29ddf 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -122,7 +122,7 @@ class mod_project_simple extends ModeleNumRefProjects } else { - dol_syslog("mod_project_simple::getNextValue sql=".$sql); + dol_syslog("mod_project_simple::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index afc17d663c0..eb8928d3b8f 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -122,7 +122,7 @@ class mod_task_simple extends ModeleNumRefTask } else { - dol_syslog("mod_task_simple::getNextValue sql=".$sql); + dol_syslog("mod_task_simple::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index aa2959691e6..ff38bc5f9cb 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -124,7 +124,7 @@ class mod_propale_marbre extends ModeleNumRefPropales } else { - dol_syslog("mod_propale_marbre::getNextValue sql=".$sql); + dol_syslog("mod_propale_marbre::getNextValue", LOG_DEBUG); return -1; } diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index d0defd260dd..78e8998f7d6 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -156,7 +156,7 @@ class pdf_paiement if (! empty($socid)) $sql .= " AND s.rowid = ".$socid; $sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC"; - dol_syslog(get_class($this)."::write_file sql=".$sql); + dol_syslog(get_class($this)."::write_file", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 8b31e581e26..8e2baa28c9f 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -225,7 +225,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $sql.= " AND entity IN (".getEntity('societe', 1).")"; if ($soc->id > 0) $sql.= " AND rowid <> ".$soc->id; - dol_syslog(get_class($this)."::verif_dispo sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::verif_dispo", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index 049c312e1ef..82961405825 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -118,7 +118,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); @@ -142,7 +142,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::getNextValue sql=".$sql); + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index c035acac207..aff6e526b93 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -238,7 +238,7 @@ class InterfaceNotification $sql = "SELECT rowid, code, label, description, elementtype"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger"; $sql.= $this->db->order("elementtype, code"); - dol_syslog("Get list of notifications sql=".$sql); + dol_syslog("Get list of notifications", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index f1fc788a198..8b9704cfb83 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -224,7 +224,7 @@ class Cronjob extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -309,7 +309,7 @@ class Cronjob extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -429,7 +429,7 @@ class Cronjob extends CommonObject $sql.= " WHERE ".implode(' AND ',$sqlwhere); } - dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -609,7 +609,7 @@ class Cronjob extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -683,7 +683,7 @@ class Cronjob extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } @@ -816,7 +816,7 @@ class Cronjob extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; $sql.= " WHERE f.rowid = ".$this->id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index ea29d822102..d5b46b90c08 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -142,7 +142,7 @@ class EcmDirectory // extends CommonObject $sql.= " '".$this->fk_user_c."'"; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -210,7 +210,7 @@ class EcmDirectory // extends CommonObject $sql.= " description='".$this->db->escape($this->description)."'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -257,7 +257,7 @@ class EcmDirectory // extends CommonObject $sql.= " cachenbofdoc = cachenbofdoc ".$sign." 1"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::changeNbOfFiles sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::changeNbOfFiles", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -291,7 +291,7 @@ class EcmDirectory // extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."ecm_directories as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -348,7 +348,7 @@ class EcmDirectory // extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_directories"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { @@ -499,7 +499,7 @@ class EcmDirectory // extends CommonObject $sql.= " WHERE fk_parent != 0"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::load_motherof sql=".$sql); + dol_syslog(get_class($this)."::load_motherof", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -563,7 +563,7 @@ class EcmDirectory // extends CommonObject $sql.= " AND c.entity = ".$conf->entity; $sql.= " ORDER BY c.label, c.rowid"; - dol_syslog(get_class($this)."::get_full_arbo sql=".$sql); + dol_syslog(get_class($this)."::get_full_arbo", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -688,7 +688,7 @@ class EcmDirectory // extends CommonObject $sql.= " WHERE entity = ".$conf->entity; } - dol_syslog(get_class($this)."::refreshcachenboffile sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::refreshcachenboffile", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5cf09642c68..585fb9f8a88 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -227,7 +227,7 @@ class Expedition extends CommonObject $sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -237,7 +237,7 @@ class Expedition extends CommonObject $sql.= " SET ref = '(PROV".$this->id.")'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); if ($this->db->query($sql)) { // Insertion des lignes @@ -334,7 +334,7 @@ class Expedition extends CommonObject $sql.= ", ".$qty; $sql.= ")"; - dol_syslog(get_class($this)."::create_line sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_line", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -399,7 +399,7 @@ class Expedition extends CommonObject if ($ref_ext) $sql.= " AND e.ref_ext='".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql.= " AND e.ref_int='".$this->db->escape($ref_int)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -545,7 +545,7 @@ class Expedition extends CommonObject $sql.= ", fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::valid update expedition sql=".$sql); + dol_syslog(get_class($this)."::valid update expedition", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -569,7 +569,7 @@ class Expedition extends CommonObject $sql.= " WHERE ed.fk_expedition = ".$this->id; $sql.= " AND cd.rowid = ed.fk_origin_line"; - dol_syslog(get_class($this)."::valid select details sql=".$sql); + dol_syslog(get_class($this)."::valid select details", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -846,7 +846,7 @@ class Expedition extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -922,7 +922,7 @@ class Expedition extends CommonObject $sql.= " WHERE ed.fk_expedition = ".$this->id; $sql.= " AND cd.rowid = ed.fk_origin_line"; - dol_syslog(get_class($this)."::delete select details sql=".$sql); + dol_syslog(get_class($this)."::delete select details", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1062,7 +1062,7 @@ class Expedition extends CommonObject $sql.= " WHERE ed.fk_expedition = ".$this->id; $sql.= " AND ed.fk_origin_line = cd.rowid"; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1324,7 +1324,7 @@ class Expedition extends CommonObject $sql.= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 7bbd99706bd..a0a22fefdd6 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -69,7 +69,7 @@ class ExpeditionLigneBatch extends CommonObject $sql.= MAIN_DB_PREFIX."product_stock as e on t.fk_product_stock=e.rowid "; $sql.= " WHERE t.rowid = ".(int) $id_stockdluo; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -123,7 +123,7 @@ class ExpeditionLigneBatch extends CommonObject $sql.= " ".(! isset($this->fk_origin_stock)?'NULL':$this->fk_origin_stock); $sql.= ")"; - dol_syslog(__METHOD__ ." sql=".$sql, LOG_DEBUG); + dol_syslog(__METHOD__ ."", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -157,7 +157,7 @@ class ExpeditionLigneBatch extends CommonObject $sql="DELETE FROM ".MAIN_DB_PREFIX.self::$_table_element; $sql.=" WHERE fk_expeditiondet in (SELECT rowid FROM ".MAIN_DB_PREFIX."expeditiondet WHERE fk_expedition=".$id_expedition.")"; - dol_syslog(__METHOD__ ." sql=".$sql, LOG_DEBUG); + dol_syslog(__METHOD__ ."", LOG_DEBUG); if ( $db->query($sql) ) { return 1; @@ -185,7 +185,7 @@ class ExpeditionLigneBatch extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element; $sql.= " WHERE fk_expeditiondet=".(int) $id_line_expdet; - dol_syslog(__METHOD__ ." sql=".$sql, LOG_DEBUG); + dol_syslog(__METHOD__ ."", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index fce9c3bf6a5..d44a7d5f4a4 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -363,7 +363,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " ORDER BY cd.rang, cd.rowid"; //print $sql; - dol_syslog("shipment.php sql=".$sql, LOG_DEBUG); + dol_syslog("shipment.php", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index fda062952d1..3c7f9a14902 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -519,7 +519,7 @@ class Export // Run the sql $this->sqlusedforexport=$sql; - dol_syslog(get_class($this)."::".__FUNCTION__." sql=".$sql); + dol_syslog(get_class($this)."::".__FUNCTION__."", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -628,7 +628,7 @@ class Export $sql.= (! empty($filter)?"'".$filter."'":"null"); $sql.= ")"; - dol_syslog("Export::create sql=".$sql, LOG_DEBUG); + dol_syslog("Export::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -657,7 +657,7 @@ class Export $sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em'; $sql.= ' WHERE em.rowid = '.$id; - dol_syslog("Export::fetch sql=".$sql, LOG_DEBUG); + dol_syslog("Export::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -706,7 +706,7 @@ class Export $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 52585d29122..72d20443d8f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -151,7 +151,7 @@ class Fichinter extends CommonObject $sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -162,7 +162,7 @@ class Fichinter extends CommonObject $this->ref='(PROV'.$this->id.')'; $sql = 'UPDATE '.MAIN_DB_PREFIX."fichinter SET ref='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $error++; } @@ -234,7 +234,7 @@ class Fichinter extends CommonObject $sql.= ", note_public = ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); if ($this->db->query($sql)) { @@ -280,7 +280,7 @@ class Fichinter extends CommonObject if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'"; else $sql.= " WHERE f.rowid=".$rowid; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -350,7 +350,7 @@ class Fichinter extends CommonObject $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog("Fichinter::setDraft sql=".$sql); + dol_syslog("Fichinter::setDraft", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -405,7 +405,7 @@ class Fichinter extends CommonObject $sql.= " AND entity = ".$conf->entity; $sql.= " AND fk_statut = 0"; - dol_syslog(get_class($this)."::setValid sql=".$sql); + dol_syslog(get_class($this)."::setValid", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -723,14 +723,14 @@ class Fichinter extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet"; $sql.= " WHERE fk_fichinter = ".$this->id; - dol_syslog("Fichinter::delete sql=".$sql); + dol_syslog("Fichinter::delete", LOG_DEBUG); if ( $this->db->query($sql) ) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter"; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog("Fichinter::delete sql=".$sql); + dol_syslog("Fichinter::delete", LOG_DEBUG); if ( $this->db->query($sql) ) { @@ -982,7 +982,7 @@ class Fichinter extends CommonObject $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet'; $sql.= ' WHERE fk_fichinter = '.$this->id; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1057,7 +1057,7 @@ class FichinterLigne $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql.= ' WHERE ft.rowid = '.$rowid; - dol_syslog("FichinterLigne::fetch sql=".$sql); + dol_syslog("FichinterLigne::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1125,7 +1125,7 @@ class FichinterLigne $sql.= ' '.$rangToUse; $sql.= ')'; - dol_syslog("FichinterLigne::insert sql=".$sql); + dol_syslog("FichinterLigne::insert", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1188,7 +1188,7 @@ class FichinterLigne $sql.= ",rang='".$this->rang."'"; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog("FichinterLigne::update sql=".$sql); + dol_syslog("FichinterLigne::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1246,7 +1246,7 @@ class FichinterLigne $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet"; $sql.= " WHERE fk_fichinter=".$this->fk_fichinter; - dol_syslog("FichinterLigne::update_total sql=".$sql); + dol_syslog("FichinterLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1259,7 +1259,7 @@ class FichinterLigne $sql.= " WHERE rowid = ".$this->fk_fichinter; $sql.= " AND entity = ".$conf->entity; - dol_syslog("FichinterLigne::update_total sql=".$sql); + dol_syslog("FichinterLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1301,7 +1301,7 @@ class FichinterLigne $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid; $resql = $this->db->query($sql); - dol_syslog(get_class($this)."::deleteline sql=".$sql); + dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); if ($resql) { diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index bbe3aeba4dc..fc891af53a3 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -58,7 +58,7 @@ if (! empty($idprod)) $sql.= " AND s.fournisseur = 1"; $sql.= " ORDER BY s.nom, pfp.ref_fourn DESC"; - dol_syslog("Ajax::getSupplierPrices sql=".$sql, LOG_DEBUG); + dol_syslog("Ajax::getSupplierPrices", LOG_DEBUG); $result=$db->query($sql); if ($result) diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index f557573fdfc..71942a27f97 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -157,7 +157,7 @@ class Fournisseur extends Societe $sql.= " VALUES "; $sql.= " ('".$this->db->escape($name)."',1,1)"; - dol_syslog("Fournisseur::CreateCategory sql=".$sql); + dol_syslog("Fournisseur::CreateCategory", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 591fce671b1..a9b4a5b90b1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -138,7 +138,7 @@ class CommandeFournisseur extends CommonOrder if ($ref) $sql.= " AND c.ref='".$ref."'"; else $sql.= " AND c.rowid=".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -207,7 +207,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " ORDER BY l.rowid"; //print $sql; - dol_syslog(get_class($this)."::fetch get lines sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::fetch get lines", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -288,7 +288,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ($comment?"'".$this->db->escape($comment)."'":'null'); $sql.= ")"; - dol_syslog("FournisseurCommande::log sql=".$sql, LOG_DEBUG); + dol_syslog("FournisseurCommande::log", LOG_DEBUG); if ( $this->db->query($sql) ) { return 1; @@ -756,7 +756,7 @@ class CommandeFournisseur extends CommonOrder $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".$statut; $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::cancel sql=".$sql); + dol_syslog(get_class($this)."::cancel", LOG_DEBUG); if ($this->db->query($sql)) { $result = 0; @@ -815,7 +815,7 @@ class CommandeFournisseur extends CommonOrder $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = 3, fk_input_method=".$methode.",date_commande=".$this->db->idate("$date"); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::commande sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::commande", LOG_DEBUG); if ($this->db->query($sql)) { $result = 1; @@ -889,7 +889,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'null'); $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); if ($this->db->query($sql)) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur"); @@ -928,7 +928,7 @@ class CommandeFournisseur extends CommonOrder $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET ref='(PROV".$this->id.")'"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); if ($this->db->query($sql)) { // On logue creation pour historique @@ -1198,7 +1198,7 @@ class CommandeFournisseur extends CommonOrder $sql.= "'".price2num($total_ttc)."'"; $sql.= ")"; - dol_syslog(get_class($this)."::addline sql=".$sql); + dol_syslog(get_class($this)."::addline", LOG_DEBUG); $resql=$this->db->query($sql); //print $sql; if ($resql) @@ -1269,7 +1269,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " (fk_commande,fk_product, qty, fk_entrepot, fk_user, datec) VALUES "; $sql.= " ('".$this->id."','".$product."','".$qty."',".($entrepot>0?"'".$entrepot."'":"null").",'".$user->id."','".$this->db->idate($now)."')"; - dol_syslog(get_class($this)."::DispatchProduct sql=".$sql); + dol_syslog(get_class($this)."::DispatchProduct", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1342,7 +1342,7 @@ class CommandeFournisseur extends CommonOrder $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid = ".$idline; $resql=$this->db->query($sql); - dol_syslog(get_class($this)."::deleteline sql=".$sql); + dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); if (!$notrigger && $resql) { @@ -1390,14 +1390,14 @@ class CommandeFournisseur extends CommonOrder $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE fk_commande =". $this->id ; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql) ) { $error++; } $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE rowid =".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($resql = $this->db->query($sql) ) { if ($this->db->affected_rows($resql) < 1) @@ -1540,7 +1540,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut IN (3,4)"; // Process running or Partially received - dol_syslog(get_class($this)."::Livraison sql=".$sql); + dol_syslog(get_class($this)."::Livraison", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1586,7 +1586,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1666,7 +1666,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ' SET fk_statut='.$status; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setStatus sql=".$sql); + dol_syslog(get_class($this)."::setStatus", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1781,7 +1781,7 @@ class CommandeFournisseur extends CommonOrder $sql.= ",product_type=".$type; $sql.= " WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::updateline sql=".$sql); + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); $result = $this->db->query($sql); if ($result > 0) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a9619a33902..a5eb09f43f7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -196,7 +196,7 @@ class FactureFournisseur extends CommonInvoice $sql.= $this->date_echeance!=''?"'".$this->db->idate($this->date_echeance)."'":"null"; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -206,7 +206,7 @@ class FactureFournisseur extends CommonInvoice $this->ref='(PROV'.$this->id.')'; $sql = 'UPDATE '.MAIN_DB_PREFIX."facture_fourn SET ref='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $error++; @@ -226,7 +226,7 @@ class FactureFournisseur extends CommonInvoice $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; $sql .= ' VALUES ('.$this->id.');'; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql_insert=$this->db->query($sql); if ($resql_insert) { @@ -350,7 +350,7 @@ class FactureFournisseur extends CommonInvoice if ($id) $sql.= " WHERE t.rowid=".$id; if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -453,7 +453,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid'; $sql.= ' WHERE fk_facture_fourn='.$this->id; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql_rows = $this->db->query($sql); if ($resql_rows) { @@ -591,7 +591,7 @@ class FactureFournisseur extends CommonInvoice $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -647,12 +647,12 @@ class FactureFournisseur extends CommonInvoice $this->db->begin(); $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';'; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE rowid = '.$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql2 = $this->db->query($sql); if (! $resql2) { $error++; @@ -763,7 +763,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ' SET paye = 1, fk_statut=2'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog("FactureFournisseur::set_paid sql=".$sql); + dol_syslog("FactureFournisseur::set_paid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -813,7 +813,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; $sql.= ' WHERE rowid = '.$this->id; - dol_syslog("FactureFournisseur::set_unpaid sql=".$sql); + dol_syslog("FactureFournisseur::set_unpaid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -891,7 +891,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::validate sql=".$sql); + dol_syslog(get_class($this)."::validate", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1011,7 +1011,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " SET fk_statut = 0"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -1110,7 +1110,7 @@ class FactureFournisseur extends CommonInvoice $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; $sql.= ' VALUES ('.$this->id.')'; - dol_syslog(get_class($this)."::addline sql=".$sql); + dol_syslog(get_class($this)."::addline", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -1241,7 +1241,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ", info_bits = ".$info_bits; $sql.= " WHERE rowid = ".$id; - dol_syslog(get_class($this)."::updateline sql=".$sql); + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1306,7 +1306,7 @@ class FactureFournisseur extends CommonInvoice // Supprime ligne $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det '; $sql.= ' WHERE rowid = '.$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index b642926f802..d72291c6038 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -83,7 +83,7 @@ class ProductFournisseur extends Product $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn; - dol_syslog(get_class($this)."::remove_fournisseur sql=".$sql); + dol_syslog(get_class($this)."::remove_fournisseur", LOG_DEBUG); $resql2=$this->db->query($sql); if (! $resql2) { @@ -120,7 +120,7 @@ class ProductFournisseur extends Product $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::remove_product_fournisseur_price sql=".$sql); + dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -263,7 +263,7 @@ class ProductFournisseur extends Product $sql.= $conf->entity; $sql.=")"; - dol_syslog(get_class($this)."::update_buyprice sql=".$sql); + dol_syslog(get_class($this)."::update_buyprice", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -340,7 +340,7 @@ class ProductFournisseur extends Product $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; - dol_syslog(get_class($this)."::fetch_product_fournisseur_price sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -399,7 +399,7 @@ class ProductFournisseur extends Product $sql.= " AND pfp.fk_product = ".$prodid; if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price"; else $sql.= $this->db->order($sortfield,$sortorder); - dol_syslog(get_class($this)."::list_product_fournisseur_price sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::list_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -488,7 +488,7 @@ class ProductFournisseur extends Product $sql.= " ORDER BY pfp.unitprice"; $sql.= $this->db->plimit(1); - dol_syslog(get_class($this)."::find_min_price_product_fournisseur sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 69912e77cb0..3daee072886 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -149,7 +149,7 @@ class PaiementFourn extends Paiement $sql.= " VALUES ('".$this->db->idate($now)."',"; $sql.= " '".$this->db->idate($this->datepaye)."', '".$this->total."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.", 0)"; - dol_syslog("PaiementFourn::create sql=".$sql); + dol_syslog("PaiementFourn::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index ffd413cbf2f..ec186cd8339 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -121,7 +121,7 @@ if ($fourn_id > 0) $sql .= " ORDER BY ".$sortfield." ".$sortorder; $sql .= $db->plimit($limit + 1, $offset); -dol_syslog("fourn/product/liste.php: sql=".$sql); +dol_syslog("fourn/product/liste.php:", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 1ff142f7be7..3e9d2bfd590 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -218,7 +218,7 @@ else $sql.=" WHERE name like 'FTP_SERVER_%'"; $sql.=" ORDER BY name"; - dol_syslog("ftpclient select ftp setup sql=".$sql,LOG_DEBUG); + dol_syslog("ftpclient select ftp setup", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index dfa0e0d9b32..995f33e62ff 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -137,7 +137,7 @@ class Holiday extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -200,7 +200,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -294,7 +294,7 @@ class Holiday extends CommonObject $sql.= $order; } - dol_syslog(get_class($this)."::fetchByUser sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchByUser", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -405,7 +405,7 @@ class Holiday extends CommonObject $sql.= $order; } - dol_syslog(get_class($this)."::fetchAll sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -544,7 +544,7 @@ class Holiday extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -591,7 +591,7 @@ class Holiday extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -787,7 +787,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as u"; $sql.= " ORDER BY u.rowid"; - dol_syslog(get_class($this)."::selectUserGroup sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::selectUserGroup", LOG_DEBUG); $result = $this->db->query($sql); // Si pas d'erreur SQL @@ -1071,7 +1071,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE statut > 0"; - dol_syslog(get_class($this)."::fetchUsers sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -1109,7 +1109,7 @@ class Holiday extends CommonObject $sql = "SELECT u.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as u"; - dol_syslog(get_class($this)."::fetchUsers sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -1153,7 +1153,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE statut > 0"; - dol_syslog(get_class($this)."::fetchUsers sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -1193,7 +1193,7 @@ class Holiday extends CommonObject $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE cpu.fk_user = u.rowid"; - dol_syslog(get_class($this)."::fetchUsers sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchUsers", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -1369,7 +1369,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."holiday_events as cpe"; - dol_syslog(get_class($this)."::fetchEventsCP sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchEventsCP", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL @@ -1434,7 +1434,7 @@ class Holiday extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::createEventCP sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::createEventCP", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -1627,7 +1627,7 @@ class Holiday extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::addLogCP sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::addLogCP", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -1690,7 +1690,7 @@ class Holiday extends CommonObject $sql.= $order; } - dol_syslog(get_class($this)."::fetchLog sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchLog", LOG_DEBUG); $resql=$this->db->query($sql); // Si pas d'erreur SQL diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index b1fa3552d9a..ff23bc12cc8 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -233,7 +233,7 @@ class Import $sql.= ')'; $sql.= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->datatoimport."', '".$this->hexa."')"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -262,7 +262,7 @@ class Import $sql.= ' FROM '.MAIN_DB_PREFIX.'import_model as em'; $sql.= ' WHERE em.rowid = '.$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -306,7 +306,7 @@ class Import $this->db->begin(); - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 9b15d36ffe9..875f5974dd7 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -203,7 +203,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $filles=array(); $sql = "SELECT fk_categorie_mere, fk_categorie_fille"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_association"; - dolibarr_install_syslog("upgrade: search duplicate sql=".$sql); + dolibarr_install_syslog("upgrade: search duplicate", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -231,7 +231,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) // We delete all $sql="DELETE FROM ".MAIN_DB_PREFIX."categorie_association"; - dolibarr_install_syslog("upgrade: delete association sql=".$sql); + dolibarr_install_syslog("upgrade: delete association", LOG_DEBUG); $resqld=$db->query($sql); if ($resqld) { @@ -240,7 +240,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) { $sql ="INSERT INTO ".MAIN_DB_PREFIX."categorie_association(fk_categorie_mere,fk_categorie_fille)"; $sql.=" VALUES(".$val['mere'].", ".$val['fille'].")"; - dolibarr_install_syslog("upgrade: insert association sql=".$sql); + dolibarr_install_syslog("upgrade: insert association", LOG_DEBUG); $resqli=$db->query($sql); if (! $resqli) $error++; } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 736346d0f72..23c9c311650 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -413,7 +413,7 @@ function migrate_paiements($db,$langs,$conf) $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_paiements sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_paiements", LOG_DEBUG); if ($resql) { $i = 0; @@ -513,7 +513,7 @@ function migrate_paiements_orphelins_1($db,$langs,$conf) $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_paiements_orphelins_1 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_paiements_orphelins_1", LOG_DEBUG); $row = array(); if ($resql) { @@ -639,7 +639,7 @@ function migrate_paiements_orphelins_2($db,$langs,$conf) $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_paiements_orphelins_2 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_paiements_orphelins_2", LOG_DEBUG); $row = array(); if ($resql) { @@ -779,7 +779,7 @@ function migrate_contracts_det($db,$langs,$conf) $sql.= " WHERE cd.rowid IS NULL AND p.rowid IS NOT NULL"; $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_contracts_det sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_det", LOG_DEBUG); if ($resql) { $i = 0; @@ -875,7 +875,7 @@ function migrate_links_transfert($db,$langs,$conf) $sql.= " AND bu.fk_bank IS NULL"; $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_links_transfert sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_links_transfert", LOG_DEBUG); if ($resql) { $i = 0; @@ -899,7 +899,7 @@ function migrate_links_transfert($db,$langs,$conf) $sql.= ")"; print $sql.'
'; - dolibarr_install_syslog("migrate_links_transfert sql=".$sql); + dolibarr_install_syslog("migrate_links_transfert", LOG_DEBUG); if (! $db->query($sql)) { @@ -950,7 +950,7 @@ function migrate_contracts_date1($db,$langs,$conf) print ''.$langs->trans('MigrationContractsEmptyDatesUpdate')."
\n"; $sql="update llx_contrat set date_contrat=tms where date_contrat is null"; - dolibarr_install_syslog("upgrade2::migrate_contracts_date1 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_date1", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) @@ -959,7 +959,7 @@ function migrate_contracts_date1($db,$langs,$conf) print $langs->trans('MigrationContractsEmptyDatesNothingToUpdate')."
\n"; $sql="update llx_contrat set datec=tms where datec is null"; - dolibarr_install_syslog("upgrade2::migrate_contracts_date1 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_date1", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) @@ -989,7 +989,7 @@ function migrate_contracts_date2($db,$langs,$conf) $sql.= " GROUP BY c.rowid, c.date_contrat"; $resql = $db->query($sql); - dolibarr_install_syslog("upgrade2::migrate_contracts_date2 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_date2", LOG_DEBUG); if ($resql) { $i = 0; @@ -1050,7 +1050,7 @@ function migrate_contracts_date3($db,$langs,$conf) print ''.$langs->trans('MigrationContractsIncoherentCreationDateUpdate')."
\n"; $sql="update llx_contrat set datec=date_contrat where datec is null or datec > date_contrat"; - dolibarr_install_syslog("upgrade2::migrate_contracts_date3 sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_date3", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) @@ -1078,7 +1078,7 @@ function migrate_contracts_open($db,$langs,$conf) $sql = "SELECT c.rowid as cref FROM llx_contrat as c, llx_contratdet as cd"; $sql.= " WHERE cd.statut = 4 AND c.statut=2 AND c.rowid=cd.fk_contrat"; - dolibarr_install_syslog("upgrade2::migrate_contracts_open sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_contracts_open", LOG_DEBUG); $resql = $db->query($sql); if (! $resql) dol_print_error($db); if ($db->affected_rows($resql) > 0) { @@ -1264,7 +1264,7 @@ function migrate_price_facture($db,$langs,$conf) $sql.= " AND (((fd.total_ttc = 0 AND fd.remise_percent != 100) or fd.total_ttc IS NULL) or f.total_ttc IS NULL)"; //print $sql; - dolibarr_install_syslog("upgrade2::migrate_price_facture sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_price_facture", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1377,7 +1377,7 @@ function migrate_price_propal($db,$langs,$conf) $sql.= " WHERE pd.fk_propal = p.rowid"; $sql.= " AND ((pd.total_ttc = 0 AND pd.remise_percent != 100) or pd.total_ttc IS NULL)"; - dolibarr_install_syslog("upgrade2::migrate_price_propal sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_price_propal", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1486,7 +1486,7 @@ function migrate_price_contrat($db,$langs,$conf) $sql.= " WHERE cd.fk_contrat = c.rowid"; $sql.= " AND ((cd.total_ttc = 0 AND cd.remise_percent != 100 AND cd.subprice > 0) or cd.total_ttc IS NULL)"; - dolibarr_install_syslog("upgrade2::migrate_price_contrat sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_price_contrat", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1571,7 +1571,7 @@ function migrate_price_commande($db,$langs,$conf) $sql.= " WHERE cd.fk_commande = c.rowid"; $sql.= " AND ((cd.total_ttc = 0 AND cd.remise_percent != 100) or cd.total_ttc IS NULL)"; - dolibarr_install_syslog("upgrade2::migrate_price_commande sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_price_commande", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -1685,7 +1685,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) $sql.= " WHERE cd.fk_commande = c.rowid"; $sql.= " AND ((cd.total_ttc = 0 AND cd.remise_percent != 100) or cd.total_ttc IS NULL)"; - dolibarr_install_syslog("upgrade2::migrate_price_commande_fournisseur sql=".$sql); + dolibarr_install_syslog("upgrade2::migrate_price_commande_fournisseur", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -2406,7 +2406,7 @@ function migrate_restore_missing_links($db,$langs,$conf) $sql.= " (SELECT t2.rowid FROM ".MAIN_DB_PREFIX.$table2." as t2"; $sql.= " WHERE t1.rowid = t2.".$field2.")"; - dolibarr_install_syslog("upgrade2:migrate_restore_missing_links DIRECTION 1 sql=".$sql); + dolibarr_install_syslog("upgrade2:migrate_restore_missing_links DIRECTION 1", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { @@ -2472,7 +2472,7 @@ function migrate_restore_missing_links($db,$langs,$conf) $sql.= " (SELECT t2.rowid FROM ".MAIN_DB_PREFIX.$table2." as t2"; $sql.= " WHERE t1.rowid = t2.".$field2.")"; - dolibarr_install_syslog("upgrade2:migrate_restore_missing_links DIRECTION 2 sql=".$sql); + dolibarr_install_syslog("upgrade2:migrate_restore_missing_links DIRECTION 2", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 58ad4f1bc0d..1921ef1633d 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -128,7 +128,7 @@ class Livraison extends CommonObject $sql.= ", ".(!empty($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null"); $sql.= ")"; - dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG); + dol_syslog("Livraison::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -140,7 +140,7 @@ class Livraison extends CommonObject $sql.= "SET ref = '".$this->db->escape($numref)."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog("Livraison::create sql=".$sql, LOG_DEBUG); + dol_syslog("Livraison::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -241,7 +241,7 @@ class Livraison extends CommonObject $sql.= " ".($description?"'".$this->db->escape($description)."'":"null").","; $sql.= $qty.")"; - dol_syslog(get_class($this)."::create_line sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_line", LOG_DEBUG); if (! $this->db->query($sql) ) { $error++; @@ -271,7 +271,7 @@ class Livraison extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = l.rowid AND el.targettype = '".$this->element."'"; $sql.= " WHERE l.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -685,7 +685,7 @@ class Livraison extends CommonObject $sql.= " WHERE ld.fk_origin_line = cd.rowid"; $sql.= " AND ld.fk_livraison = ".$this->id; - dol_syslog(get_class($this)."::fetch_lines sql=".$sql); + dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -915,7 +915,7 @@ class Livraison extends CommonObject $sql.= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 602f5405ca2..b6cc0a0e6fc 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -132,7 +132,7 @@ class Opensurveysondage extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -196,7 +196,7 @@ class Opensurveysondage extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."opensurvey_sondage as t"; $sql.= " WHERE t.id_sondage = '".$this->db->escape($numsurvey)."'"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -281,7 +281,7 @@ class Opensurveysondage extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -352,16 +352,16 @@ class Opensurveysondage extends CommonObject { $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_comments WHERE id_sondage = '".$this->db->escape($numsondage)."'"; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); $sql='DELETE FROM '.MAIN_DB_PREFIX."opensurvey_user_studs WHERE id_sondage = '".$this->db->escape($numsondage)."'"; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql=$this->db->query($sql); $sql = "DELETE FROM ".MAIN_DB_PREFIX."opensurvey_sondage"; $sql.= " WHERE id_sondage = '".$this->db->escape($numsondage)."'"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a2d2ee36d9c..1f320f28504 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -370,7 +370,7 @@ class Product extends CommonObject $sql.= ", ".((empty($this->status_batch) || $this->status_batch < 0)? '0':$this->status_batch); $sql.= ")"; - dol_syslog(get_class($this)."::Create sql=".$sql); + dol_syslog(get_class($this)."::Create", LOG_DEBUG); $result = $this->db->query($sql); if ( $result ) { @@ -628,7 +628,7 @@ class Product extends CommonObject $sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null"); $sql.= " WHERE rowid = " . $id; - dol_syslog(get_class($this)."update sql=".$sql); + dol_syslog(get_class($this)."update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1000,7 +1000,7 @@ class Product extends CommonObject $sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty.",".$conf->entity; $sql.= ")"; - dol_syslog(get_class($this)."_log_price sql=".$sql); + dol_syslog(get_class($this)."_log_price", LOG_DEBUG); $resql=$this->db->query($sql); if(! $resql) { @@ -1027,7 +1027,7 @@ class Product extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price"; $sql.= " WHERE rowid=".$rowid; - dol_syslog(get_class($this)."log_price_delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."log_price_delete", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1063,7 +1063,7 @@ class Product extends CommonObject $sql.= " WHERE pfp.rowid = ".$prodfournprice; if ($qty) $sql.= " AND pfp.quantity <= ".$qty; - dol_syslog(get_class($this)."::get_buyprice sql=".$sql); + dol_syslog(get_class($this)."::get_buyprice", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1089,7 +1089,7 @@ class Product extends CommonObject $sql.= " ORDER BY pfp.quantity DESC"; $sql.= " LIMIT 1"; - dol_syslog(get_class($this)."::get_buyprice sql=".$sql); + dol_syslog(get_class($this)."::get_buyprice", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1222,7 +1222,7 @@ class Product extends CommonObject $sql.= " recuperableonly='".$newnpr."'"; $sql.= " WHERE rowid = ".$id; - dol_syslog(get_class($this)."update_price sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."update_price", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1303,7 +1303,7 @@ class Product extends CommonObject else if ($ref_ext) $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'"; } - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ( $resql ) { @@ -2152,7 +2152,7 @@ class Product extends CommonObject $sql.= " AND fk_product != ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::add_fournisseur sql=".$sql); + dol_syslog(get_class($this)."::add_fournisseur", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2176,7 +2176,7 @@ class Product extends CommonObject $sql.= " AND fk_product = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::add_fournisseur sql=".$sql); + dol_syslog(get_class($this)."::add_fournisseur", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2205,7 +2205,7 @@ class Product extends CommonObject $sql.= ", 0"; $sql.= ")"; - dol_syslog(get_class($this)."::add_fournisseur sql=".$sql); + dol_syslog(get_class($this)."::add_fournisseur", LOG_DEBUG); if ($this->db->query($sql)) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); @@ -2829,7 +2829,7 @@ class Product extends CommonObject $sql.= " AND w.rowid = ps.fk_entrepot"; $sql.= " AND ps.fk_product = ".$this->id; - dol_syslog(get_class($this)."::load_stock sql=".$sql); + dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 9c92431c563..78af2b01037 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -97,7 +97,7 @@ class Productbatch extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $error) @@ -161,7 +161,7 @@ class Productbatch extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -217,7 +217,7 @@ class Productbatch extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $error) @@ -289,7 +289,7 @@ class Productbatch extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX.self::$_table_element.""; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } } @@ -431,7 +431,7 @@ class Productbatch extends CommonObject if (! empty($where)) $sql.= " AND (".implode(" OR ",$where).")"; - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -487,7 +487,7 @@ class Productbatch extends CommonObject $sql.= " WHERE fk_product_stock=".$fk_product_stock; if ($with_qty) $sql.= " AND qty<>0"; - dol_syslog("productbatch::findAll sql=".$sql, LOG_DEBUG); + dol_syslog("productbatch::findAll", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 40e99a2d2ee..8d82b5548a5 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -199,7 +199,7 @@ else $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); - dol_syslog("product:list.php: sql=".$sql); + dol_syslog("product:list.php:", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index b28a8f9451f..b7061352fe6 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -89,7 +89,7 @@ class Entrepot extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (entity, datec, fk_user_author, label)"; $sql .= " VALUES (".$conf->entity.",'".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->libelle)."')"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -158,7 +158,7 @@ class Entrepot extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -187,12 +187,12 @@ class Entrepot extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement"; $sql.= " WHERE fk_entrepot = " . $this->id; - dol_syslog("Entrepot::delete sql=".$sql); + dol_syslog("Entrepot::delete", LOG_DEBUG); $resql1=$this->db->query($sql); $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " WHERE fk_entrepot = " . $this->id; - dol_syslog("Entrepot::delete sql=".$sql); + dol_syslog("Entrepot::delete", LOG_DEBUG); $resql2=$this->db->query($sql); if ($resql1 && $resql2) @@ -200,13 +200,13 @@ class Entrepot extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."entrepot"; $sql.= " WHERE rowid = " . $this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql1=$this->db->query($sql); // Update denormalized fields because we change content of produt_stock $sql = "UPDATE ".MAIN_DB_PREFIX."product p SET p.stock= (SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql2=$this->db->query($sql); if ($resql1 && $resql2) @@ -258,7 +258,7 @@ class Entrepot extends CommonObject if ($ref) $sql.= " AND label = '".$this->db->escape($ref)."'"; } - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -309,7 +309,7 @@ class Entrepot extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.rowid = ".$id; - dol_syslog(get_class($this)."::info sql=".$sql); + dol_syslog(get_class($this)."::info", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index e8861d60ddb..2bdb24e355b 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -112,7 +112,7 @@ class MouvementStock $sql.= " '".$origintype."'"; $sql.= ")"; - dol_syslog(get_class($this)."::_create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::_create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -138,7 +138,7 @@ class MouvementStock $sql = "SELECT rowid, reel, pmp FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " WHERE fk_entrepot = ".$entrepot_id." AND fk_product = ".$fk_product; - dol_syslog(get_class($this)."::_create sql=".$sql); + dol_syslog(get_class($this)."::_create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -203,7 +203,7 @@ class MouvementStock $sql.= " (".$newpmpwarehouse.", ".$qty.", ".$entrepot_id.", ".$fk_product.")"; } - dol_syslog(get_class($this)."::_create sql=".$sql); + dol_syslog(get_class($this)."::_create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -230,7 +230,7 @@ class MouvementStock // May be this request is better: // UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid); - dol_syslog(get_class($this)."::_create sql=".$sql); + dol_syslog(get_class($this)."::_create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -298,7 +298,7 @@ class MouvementStock $sql.= " FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = ".$idProduct; - dol_syslog(get_class($this)."::_createSubProduct sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::_createSubProduct", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index da52a5aac58..1309da95a2a 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -124,7 +124,7 @@ if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_typ $sql.= $db->order("datem","DESC"); $sql.= $db->plimit($max,0); -dol_syslog("Index:list stock movements sql=".$sql, LOG_DEBUG); +dol_syslog("Index:list stock movements", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 0a56b5253a9..ff2934eb970 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -123,7 +123,7 @@ class Task extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -212,7 +212,7 @@ class Task extends CommonObject $sql.="t.rowid = ".$id; } - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -295,7 +295,7 @@ class Task extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -386,7 +386,7 @@ class Task extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task"; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -457,7 +457,7 @@ class Task extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."projet_task"; $sql.= " WHERE fk_task_parent=".$this->id; - dol_syslog(get_class($this)."::hasChildren sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::hasChildren", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } else @@ -572,7 +572,7 @@ class Task extends CommonObject $sql.= " ORDER BY p.ref, t.rang, t.dateo"; //print $sql; - dol_syslog(get_class($this)."::getTasksArray sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::getTasksArray", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -686,7 +686,7 @@ class Task extends CommonObject } //print $sql; - dol_syslog(get_class($this)."::getUserRolesForProjectsOrTasks sql=".$sql); + dol_syslog(get_class($this)."::getUserRolesForProjectsOrTasks", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -764,7 +764,7 @@ class Task extends CommonObject $sql.= ", ".(isset($this->timespent_note)?"'".$this->db->escape($this->timespent_note)."'":"null"); $sql.= ")"; - dol_syslog(get_class($this)."::addTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); if ($this->db->query($sql) ) { $tasktime_id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_time"); @@ -793,7 +793,7 @@ class Task extends CommonObject $sql.= " SET duration_effective = duration_effective + '".price2num($this->timespent_duration)."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::addTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); if (! $this->db->query($sql) ) { $this->error=$this->db->lasterror(); @@ -808,7 +808,7 @@ class Task extends CommonObject $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " WHERE rowid = ".$tasktime_id; - dol_syslog(get_class($this)."::addTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); if (! $this->db->query($sql) ) { $this->error=$this->db->lasterror(); @@ -840,7 +840,7 @@ class Task extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql.= " WHERE t.rowid = ".$id; - dol_syslog(get_class($this)."::fetchTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetchTimeSpent", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -892,7 +892,7 @@ class Task extends CommonObject $sql.= " note = ".(isset($this->timespent_note)?"'".$this->db->escape($this->timespent_note)."'":"null"); $sql.= " WHERE rowid = ".$this->timespent_id; - dol_syslog(get_class($this)."::updateTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); if ($this->db->query($sql) ) { if (! $notrigger) @@ -921,7 +921,7 @@ class Task extends CommonObject $sql.= " SET duration_effective = duration_effective + '".$newDuration."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::updateTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); if (! $this->db->query($sql) ) { $this->error=$this->db->lasterror(); @@ -951,7 +951,7 @@ class Task extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time"; $sql.= " WHERE rowid = ".$this->timespent_id; - dol_syslog(get_class($this)."::delTimeSpent sql=".$sql); + dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -974,7 +974,7 @@ class Task extends CommonObject $sql.= " SET duration_effective = duration_effective - '".$this->timespent_duration."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delTimeSpent sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG); if ($this->db->query($sql) ) { $result = 0; diff --git a/htdocs/projet/liste.php b/htdocs/projet/liste.php index 39fcdb64a01..3dab05c1826 100644 --- a/htdocs/projet/liste.php +++ b/htdocs/projet/liste.php @@ -100,7 +100,7 @@ if ($search_societe) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); -dol_syslog("list allowed project sql=".$sql); +dol_syslog("list allowed project", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 6edeef201fb..33d7af532b2 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -106,7 +106,7 @@ class Resource extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); @@ -168,7 +168,7 @@ class Resource extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_resource as ty ON ty.code=t.fk_code_type_resource"; $sql.= " WHERE t.rowid = ".$this->db->escape($id); - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -225,7 +225,7 @@ class Resource extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -285,7 +285,7 @@ class Resource extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."element_resources as t"; $sql.= " WHERE t.rowid = ".$this->db->escape($id); - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -336,12 +336,12 @@ class Resource extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource"; $sql.= " WHERE rowid =".$rowid; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; $sql.= " WHERE element_type='resource' AND resource_id ='".$this->db->escape($rowid)."'"; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql)) { if (! $notrigger) @@ -411,7 +411,7 @@ class Resource extends CommonObject $sql.= " GROUP BY t.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; if ($limit) $sql.= $this->db->plimit($limit+1,$offset); - dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -484,7 +484,7 @@ class Resource extends CommonObject } $sql.= " GROUP BY t.rowid"; $sql.= " ORDER BY $sortfield $sortorder " . $this->db->plimit($limit+1,$offset); - dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -569,7 +569,7 @@ class Resource extends CommonObject } $sql.= " GROUP BY t.resource_id"; $sql.= " ORDER BY " . $sortfield . " " . $sortorder . " " . $this->db->plimit($limit+1,$offset); - dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -729,7 +729,7 @@ class Resource extends CommonObject $this->db->begin(); - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } @@ -784,7 +784,7 @@ class Resource extends CommonObject $sql.=" AND resource_type LIKE '%".$resource_type."%'"; $sql .= ' ORDER BY resource_type'; - dol_syslog(get_class($this)."::getElementResources sql=".$sql); + dol_syslog(get_class($this)."::getElementResources", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -837,7 +837,7 @@ class Resource extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."c_type_resource"; $sql.= " WHERE active > 0"; $sql.= " ORDER BY rowid"; - dol_syslog(get_class($this)."::load_cache_code_type_resource sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::load_cache_code_type_resource", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 32fbe2e2c00..36abbb909ad 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -84,7 +84,7 @@ if (GETPOST('newcompany') || GETPOST('socid','int') || GETPOST('id_fourn')) if (! empty($_GET["filter"])) $sql.= " AND ".$_GET["filter"]; // Add other filters $sql.= " ORDER BY nom ASC"; - //dol_syslog("ajaxcompanies sql=".$sql); + //dol_syslog("ajaxcompanies", LOG_DEBUG); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 174afbe5671..fe109b9137e 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -200,7 +200,7 @@ class Address if ($user) $sql .= ",fk_user_modif = '".$user->id."'"; $sql .= " WHERE fk_soc = '" . $socid ."' AND rowid = '" . $this->db->escape($id) ."'"; - dol_syslog(get_class($this)."::Update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 189556b186d..784b02ed930 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -227,7 +227,7 @@ class CompanyBankAccount extends Account $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { return 1; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9ffa0546782..5615961de86 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -418,7 +418,7 @@ class Societe extends CommonObject $sql.= ", 0"; $sql.= ", ".(! empty($this->import_key) ? "'".$this->import_key."'":"null").")"; - dol_syslog(get_class($this)."::create sql=".$sql); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -785,7 +785,7 @@ class Societe extends CommonObject $sql .= " WHERE rowid = '" . $id ."'"; - dol_syslog(get_class($this)."::Update sql=".$sql); + dol_syslog(get_class($this)."::Update", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -885,7 +885,7 @@ class Societe extends CommonObject else { - $this->error = $langs->trans("Error sql=".$sql); + $this->error = $langs->trans("Error", LOG_DEBUG); dol_syslog(get_class($this)."::Update fails update sql=".$sql, LOG_ERR); $result = -2; } @@ -1266,7 +1266,7 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; $sql.= " WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -1280,7 +1280,7 @@ class Societe extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -1294,7 +1294,7 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib"; $sql.= " WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::Delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::Delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -1319,7 +1319,7 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe"; $sql.= " WHERE rowid = " . $id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -2689,7 +2689,7 @@ class Societe extends CommonObject $sql.= " SET fk_soc=".$this->id; $sql.= " WHERE rowid=".$member->id; - dol_syslog(get_class($this)."::create_from_member sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2863,7 +2863,7 @@ class Societe extends CommonObject elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; - dol_syslog("useLocalTax sql=".$sql); + dol_syslog("useLocalTax", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2883,7 +2883,7 @@ class Societe extends CommonObject $sql .= " WHERE r.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; $sql .= " AND r.active = 1"; - dol_syslog("useRevenueStamp sql=".$sql); + dol_syslog("useRevenueStamp", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -2944,7 +2944,7 @@ class Societe extends CommonObject $sql.= " fk_prospectlevel='".$this->fk_prospectlevel."'"; $sql.= ",fk_user_modif='".$user->id."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_prospect_level sql=".$sql); + dol_syslog(get_class($this)."::set_prospect_level", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -3027,7 +3027,7 @@ class Societe extends CommonObject $sql.= ",fk_user_modif='".$user->id."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_commnucation_level sql=".$sql); + dol_syslog(get_class($this)."::set_commnucation_level", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { @@ -3061,7 +3061,7 @@ class Societe extends CommonObject $sql.= " outstanding_limit= ".($outstanding!=''?$outstanding:'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_outstanding sql=".$sql); + dol_syslog(get_class($this)."::set_outstanding", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3098,7 +3098,7 @@ class Societe extends CommonObject //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason $sql .= " AND fk_statut <> 3"; // Not abandonned - dol_syslog("get_OutstandingBill sql=".$sql); + dol_syslog("get_OutstandingBill", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f2d2e64791d..1ed5c1afc2c 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -432,7 +432,7 @@ if (empty($reshook)) $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d671322d0dc..7eac18240f0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -181,7 +181,7 @@ class User extends CommonObject $sql.= " AND u.rowid = ".$id; } - dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -664,7 +664,7 @@ class User extends CommonObject $sql.= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); - dol_syslog(get_class($this)."::setstatus sql=".$sql); + dol_syslog(get_class($this)."::setstatus", LOG_DEBUG); if ($result) { // Appel des triggers @@ -748,7 +748,7 @@ class User extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::delete sql=".$sql); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -811,7 +811,7 @@ class User extends CommonObject $sql.= " WHERE login ='".$this->db->escape($this->login)."'"; $sql.= " AND entity IN (0,".$conf->entity.")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -831,7 +831,7 @@ class User extends CommonObject $sql.= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->ldap_sid."',".$this->entity.")"; $result=$this->db->query($sql); - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); if ($result) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user"); @@ -950,7 +950,7 @@ class User extends CommonObject $sql.= " WHERE rowid=".$this->id; $resql=$this->db->query($sql); - dol_syslog(get_class($this)."::create_from_contact sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG); if ($resql) { // Appel des triggers @@ -1025,7 +1025,7 @@ class User extends CommonObject $sql.= " SET fk_societe=".$member->fk_soc; $sql.= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create_from_member sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -1176,7 +1176,7 @@ class User extends CommonObject $sql.= ", entity = '".$this->entity."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -1197,13 +1197,13 @@ class User extends CommonObject if ($this->fk_member > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL where fk_member = ".$this->fk_member; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; } } // Set link to user $sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member =".($this->fk_member>0?$this->fk_member:'null')." where rowid = ".$this->id; - dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; } @@ -2199,7 +2199,7 @@ class User extends CommonObject $sql.= " WHERE fk_user != 0"; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::load_parentof sql=".$sql); + dol_syslog(get_class($this)."::load_parentof", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2249,7 +2249,7 @@ class User extends CommonObject { $sql.= " WHERE u.entity IN (".getEntity('user',1).")"; } - dol_syslog(get_class($this)."::get_full_tree get user list sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 72dc0b7cf48..84b0bd4cbb5 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -85,7 +85,7 @@ class UserGroup extends CommonObject $sql.= " WHERE g.rowid = ".$id; } - dol_syslog(get_class($this)."::fetch sql=".$sql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -146,7 +146,7 @@ class UserGroup extends CommonObject } $sql.= " ORDER BY g.nom"; - dol_syslog(get_class($this)."::listGroupsForUser sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::listGroupsForUser", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -204,7 +204,7 @@ class UserGroup extends CommonObject } if (! empty($excludefilter)) $sql.=' AND ('.$excludefilter.')'; - dol_syslog(get_class($this)."::listUsersForGroup sql=".$sql,LOG_DEBUG); + dol_syslog(get_class($this)."::listUsersForGroup", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -592,7 +592,7 @@ class UserGroup extends CommonObject $sql.= ",".$entity; $sql.= ")"; - dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create", LOG_DEBUG); $result=$this->db->query($sql); if ($result) { @@ -644,7 +644,7 @@ class UserGroup extends CommonObject $sql.= ", note = '" . $this->db->escape($this->note) . "'"; $sql.= " WHERE rowid = " . $this->id; - dol_syslog(get_class($this)."::update sql=".$sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index d78a512bf53..179214c1bc4 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -395,7 +395,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $sql.= " WHERE rowid=".$object->id; } $resql=$db->query($sql); - dol_syslog("fiche::update sql=".$sql, LOG_DEBUG); + dol_syslog("fiche::update", LOG_DEBUG); if (! $resql) { $error++; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index af7a95af74d..2be426bb571 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -191,7 +191,7 @@ else } $sql.= " AND ur.fk_user = ".$fuser->id; -dol_syslog("get user perms sql=".$sql); +dol_syslog("get user perms", LOG_DEBUG); $result=$db->query($sql); if ($result) { @@ -227,7 +227,7 @@ if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transv $sql.= " AND gr.fk_usergroup = gu.fk_usergroup"; $sql.= " AND gu.fk_user = ".$fuser->id; -dol_syslog("get user perms sql=".$sql); +dol_syslog("get user perms", LOG_DEBUG); $result=$db->query($sql); if ($result) { diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index c2eba3f9d1b..f866e197e15 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -867,7 +867,7 @@ function getProductsForCategory($authentication,$id,$lang='') $sql .= " ORDER BY fk_".$field." ASC" ; - dol_syslog("getProductsForCategory get id of product into category sql=".$sql); + dol_syslog("getProductsForCategory get id of product into category", LOG_DEBUG); $res = $db->query($sql); if ($res) { diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c5ac0c8c686..632a4c164e5 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -660,7 +660,7 @@ function getListOfThirdParties($authentication,$filterthirdparty) if ($key == 'supplier' && $val != '') $sql.=" AND s.fournisseur = ".$db->escape($val); if ($key == 'category' && $val != '') $sql.=" AND s.rowid IN (SELECT fk_societe FROM ".MAIN_DB_PREFIX."categorie_societe WHERE fk_categorie=".$db->escape($val).") "; } - dol_syslog("Function: getListOfThirdParties sql=".$sql); + dol_syslog("Function: getListOfThirdParties", LOG_DEBUG); $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('societe',true); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index c271b6dd7a2..cf8dceb8f9e 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -226,7 +226,7 @@ if ($resql) { //Update status communication of thirdparty prospect $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj2->rowid.")"; - dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG); + dol_syslog("fiche.php: set prospect thirdparty status", LOG_DEBUG); $resqlx=$db->query($sqlx); if (! $resqlx) { @@ -236,7 +236,7 @@ if ($resql) //Update status communication of contact prospect $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj2->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)"; - dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG); + dol_syslog("fiche.php: set prospect contact status", LOG_DEBUG); $resqlx=$db->query($sqlx); if (! $resqlx) From d1d4c6d8a5e3dd33fadab0304784cdc76a07be8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 12 Jun 2014 11:45:32 +0200 Subject: [PATCH 031/502] Increased SQL Error to LOG_ERROR level --- htdocs/core/db/mssql.class.php | 2 +- htdocs/core/db/mysql.class.php | 2 +- htdocs/core/db/mysqli.class.php | 2 +- htdocs/core/db/pgsql.class.php | 2 +- htdocs/core/db/sqlite.class.php | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 52c4fc85de1..02edeb7cf16 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -372,7 +372,7 @@ class DoliDBMssql extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $row["code"]; - dol_syslog(get_class($this)."::query SQL error: ".$query, LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error: ".$query, LOG_ERROR); } $this->lastquery=$query; $this->_results = $ret; diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 5e5b4c360d0..18e40264495 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -273,7 +273,7 @@ class DoliDBMysql extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR); } $this->lastquery=$query; $this->_results = $ret; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 16915dcd22d..ed73d8621c0 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -275,7 +275,7 @@ class DoliDBMysqli extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR); } $this->lastquery=$query; $this->_results = $ret; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index b5959df1f63..8ce4e700d66 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -506,7 +506,7 @@ class DoliDBPgsql extends DoliDB $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); } - dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_WARNING); + dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_ERROR); //print "\n>> ".$query."
\n"; //print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n"; diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 45c1bbd182f..39f33341526 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -409,8 +409,8 @@ class DoliDBSqlite extends DoliDB $this->lastqueryerror = $query; $this->lasterror = $this->error(); $this->lasterrno = $this->errno(); - if (preg_match('/[0-9]/',$this->lasterrno)) dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_WARNING); - else dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING); + if (preg_match('/[0-9]/',$this->lasterrno)) dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_ERROR); + else dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR); } $this->lastquery=$query; $this->_results = $ret; From 7e7958cf73dfabee195616e50db43f9fac6e1cd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 12 Jun 2014 13:49:05 +0200 Subject: [PATCH 032/502] Removed SQL errors as they are logged by the database handler --- htdocs/categories/class/categorie.class.php | 11 +---------- htdocs/comm/propal/class/propal.class.php | 2 -- htdocs/commande/class/commande.class.php | 1 - htdocs/compta/bank/class/account.class.php | 2 -- .../compta/facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 16 +++++++--------- .../prelevement/class/bonprelevement.class.php | 3 +-- htdocs/contact/class/contact.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 -- htdocs/core/class/commonobject.class.php | 5 ++--- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/link.class.php | 1 - htdocs/core/lib/security.lib.php | 1 - htdocs/core/modules/DolibarrModules.class.php | 5 ++--- htdocs/core/modules/facture/mod_facture_mars.php | 1 - .../core/modules/facture/mod_facture_terre.php | 1 - .../modules/livraison/mod_livraison_jade.php | 1 - .../core/modules/mailings/contacts4.modules.php | 6 ++---- .../modules/societe/mod_codeclient_monkey.php | 3 ++- .../modules/societe/mod_codecompta_aquarium.php | 1 - .../mod_facture_fournisseur_cactus.php | 1 - htdocs/expedition/class/expedition.class.php | 1 - htdocs/exports/class/export.class.php | 1 - htdocs/fichinter/class/fichinter.class.php | 4 ---- .../fourn/class/fournisseur.commande.class.php | 3 --- htdocs/install/upgrade2.php | 2 +- htdocs/livraison/class/livraison.class.php | 3 --- htdocs/societe/class/address.class.php | 1 - htdocs/societe/class/societe.class.php | 4 ---- htdocs/user/class/user.class.php | 3 +-- scripts/emailings/mailing-send.php | 2 +- 31 files changed, 22 insertions(+), 70 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 2d657dc6e1c..e90e0fc626e 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -185,7 +185,7 @@ class Categorie extends CommonObject $sql.= $conf->entity; $sql.= ")"; - dol_syslog(get_class($this).'::create sql='.$sql); + dol_syslog(get_class($this).'::create', LOG_DEBUG); $res = $this->db->query($sql); if ($res) { @@ -232,7 +232,6 @@ class Categorie extends CommonObject else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::create error ".$this->error." sql=".$sql, LOG_ERR); $this->db->rollback(); return -1; } @@ -346,7 +345,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -357,7 +355,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -368,7 +365,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -379,7 +375,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -390,7 +385,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -401,7 +395,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } } @@ -414,7 +407,6 @@ class Categorie extends CommonObject if (!$this->db->query($sql)) { $this->error=$this->db->lasterror(); - dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR); $error++; } else @@ -1006,7 +998,6 @@ class Categorie extends CommonObject else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::already_exists error ".$this->error." sql=".$sql, LOG_ERR); return -1; } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5122bd15f51..31b6fc67468 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2955,7 +2955,6 @@ class PropaleLigne extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog(get_class($this).'::insert Error '.$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -3006,7 +3005,6 @@ class PropaleLigne extends CommonObject else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog("PropaleLigne::delete Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5af12ef11bb..e9f0ff9e43a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -233,7 +233,6 @@ class Commande extends CommonOrder $resql=$this->db->query($sql); if (! $resql) { - dol_syslog(get_class($this)."::valid Echec update - 10 - sql=".$sql, LOG_ERR); dol_print_error($this->db); $error++; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 0179149e69f..48e175b0c2e 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -448,12 +448,10 @@ class Account extends CommonObject if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error=$langs->trans("ErrorBankLabelAlreadyExists"); - dol_syslog($this->error, LOG_ERR); return -1; } else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog($this->error, LOG_ERR); return -2; } } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f87e640d78e..39d5d7ca398 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -507,7 +507,6 @@ class FactureRec extends Facture else { $this->error=$this->db->lasterror(); - dol_syslog("FactureRec::addline sql=".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 48d6e4d34e8..36ea7739652 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -516,7 +516,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::create error ".$this->error." sql=".$sql, LOG_ERR); $this->db->rollback(); return -1; } @@ -1315,7 +1314,6 @@ class Facture extends CommonInvoice if (! $this->db->query($sql)) { $this->error=$this->db->error()." sql=".$sql; - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -5; } @@ -1344,9 +1342,15 @@ class Facture extends CommonInvoice // Delete invoice line $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if ($this->db->query($sql) && $this->delete_linked_contact()) { $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid; + + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql=$this->db->query($sql); if ($resql) { @@ -1384,7 +1388,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->lasterror()." sql=".$sql; - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -6; } @@ -1392,7 +1395,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->lasterror()." sql=".$sql; - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -4; } @@ -1400,7 +1402,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } @@ -1771,7 +1772,6 @@ class Facture extends CommonInvoice $resql=$this->db->query($sql); if (! $resql) { - dol_syslog(get_class($this)."::validate Echec update - 10 - sql=".$sql, LOG_ERR); dol_print_error($this->db); $error++; } @@ -3255,7 +3255,7 @@ class Facture extends CommonInvoice $sql.= ' WHERE l.fk_facture = '.$this->id; $sql.= ' ORDER BY l.rang ASC, l.rowid'; - dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG); + dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -3305,7 +3305,6 @@ class Facture extends CommonInvoice else { $this->error=$this->db->error(); - dol_syslog("Error sql=".$sql.", error=".$this->error,LOG_ERR); return -1; } } @@ -3802,7 +3801,6 @@ class FactureLigne extends CommonInvoiceLine else { $this->error=$this->db->error()." sql=".$sql; - dol_syslog(get_class($this)."::delete Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3d224bbe274..759981b696e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -314,7 +314,6 @@ class BonPrelevement extends CommonObject } else { - dol_syslog(get_class($this)."::Fetch Erreur sql=".$sql, LOG_ERR); return -2; } } @@ -705,6 +704,7 @@ class BonPrelevement extends CommonObject //if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'"; //if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'"; + dol_syslog(get_class($this)."::SommeAPrelever"); $resql = $this->db->query($sql); if ( $resql ) @@ -718,7 +718,6 @@ class BonPrelevement extends CommonObject else { $this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error(); - dol_syslog($this->error, LOG_ERR); return -1; } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 727fa6486a9..26827a3d504 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -729,7 +729,7 @@ class Contact extends CommonObject $sqldel = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; $sqldel.=" WHERE rowid = ".$obj->rowid; - dol_syslog(get_class($this)."::delete sql=".$sqldel); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); $result = $this->db->query($sqldel); if (! $result) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 140d64c2daf..173a7239e4e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -319,7 +319,6 @@ class Contrat extends CommonObject $resql = $this->db->query($sql); if (! $resql) { - dol_syslog(get_class($this)."::validate Echec update - 10 - sql=".$sql, LOG_ERR); dol_print_error($this->db); $error++; } @@ -1089,7 +1088,6 @@ class Contrat extends CommonObject { $this->db->rollback(); $this->error=$this->db->error()." sql=".$sql; - dol_syslog(get_class($this)."::addline ".$this->error,LOG_ERR); return -1; } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2eb63db6d9b..0c366cb561f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2158,12 +2158,11 @@ abstract class CommonObject $this->db->begin(); $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; - dol_syslog(get_class($this)."::deleteExtraFields delete sql=".$sql_del); + dol_syslog(get_class($this)."::deleteExtraFields delete", LOG_DEBUG); $resql=$this->db->query($sql_del); if (! $resql) { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::deleteExtraFields ".$this->error,LOG_ERR); $this->db->rollback(); return -1; } @@ -2229,7 +2228,7 @@ abstract class CommonObject $this->db->begin(); $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; - dol_syslog(get_class($this)."::insertExtraFields delete sql=".$sql_del); + dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG); $this->db->query($sql_del); $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object"; foreach($this->array_options as $key => $value) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index df6d16767d6..84279b7eb9e 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -454,7 +454,7 @@ class ExtraFields $sql_del.= " WHERE name = '".$attrname."'"; $sql_del.= " AND entity = ".$conf->entity; $sql_del.= " AND elementtype = '".$elementtype."'"; - dol_syslog(get_class($this)."::update_label sql=".$sql_del); + dol_syslog(get_class($this)."::update_label", LOG_DEBUG); $resql1=$this->db->query($sql_del); $sql = "INSERT INTO ".MAIN_DB_PREFIX."extrafields("; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index e92aa273105..85c365d3443 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -136,7 +136,6 @@ class Link extends CommonObject else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::Create fails insert sql=".$sql, LOG_ERR); $result=-2; } $this->db->rollback(); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 31e900f8e7e..c8cccefda7f 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -470,7 +470,6 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature } else { - dol_syslog("security.lib:restrictedArea sql=".$sql, LOG_ERR); accessforbidden(); } } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9809c418f0c..f8456b4cf23 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -188,12 +188,11 @@ abstract class DolibarrModules { if (! $err) { - dol_syslog(get_class($this)."::_remove sql=".$array_sql[$i], LOG_DEBUG); + dol_syslog(get_class($this)."::_remove", LOG_DEBUG); $result=$this->db->query($array_sql[$i]); if (! $result) { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::_remove Error ".$this->error, LOG_ERR); $err++; } } @@ -859,7 +858,7 @@ abstract class DolibarrModules $sql_del.= " WHERE ".$this->db->decrypt('name')." = '".$this->const_name."'"; $sql_del.= " AND entity IN (0,".$entity.")"; - dol_syslog(get_class($this)."::insert_permissions sql=".$sql_del); + dol_syslog(get_class($this)."::insert_permissions", LOG_DEBUG); $resql=$this->db->query($sql_del); if ($resql) { diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 100b9193fd5..25c6d2cd2ad 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -153,7 +153,6 @@ class mod_facture_mars extends ModeleNumRefFactures } else { - dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 6270bb9ae9c..dc06c6202ec 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -169,7 +169,6 @@ class mod_facture_terre extends ModeleNumRefFactures } else { - dol_syslog(get_class($this)."::getNextValue sql=".$sql, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index e7cd8c926ac..3480bb6d609 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -127,7 +127,6 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder } else { - dol_syslog("mod_livraison_jade::getNextValue sql=".$sql, LOG_ERR); return -1; } diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php index acf4a316660..eb14b3995f4 100644 --- a/htdocs/core/modules/mailings/contacts4.modules.php +++ b/htdocs/core/modules/mailings/contacts4.modules.php @@ -89,7 +89,7 @@ class mailing_contacts4 extends MailingTargets if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'"; $sql.= " ORDER BY sp.lastname, sp.firstname"; - dol_syslog(get_class($this).':: add_to_target sql='.$sql,LOG_DEBUG); + dol_syslog(get_class($this).':: add_to_target',LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -115,7 +115,6 @@ class mailing_contacts4 extends MailingTargets } }else { $this->error=$this->db->lasterrno(); - dol_syslog(get_class($this)."Error sql=".$sql." ".$this->error, LOG_ERR); return -1; } @@ -215,7 +214,7 @@ class mailing_contacts4 extends MailingTargets $resql = $this->db->query($sql); - dol_syslog(get_class($this).':: formFilter sql='.$sql,LOG_DEBUG); + dol_syslog(get_class($this).':: formFilter',LOG_DEBUG); if ($resql) { $s=''; $s.=''; +print ''; +print ''; +print $langs->trans("FreeTextOnDonations").'
'; +print ''; +print ''; +print ''; +print "\n"; +print "\n"; +print ''; + +/* + * French params + */ +if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR") +{ + print '
'; + print_titre($langs->trans("FrenchOptions")); + + print ''; + print ''; + print ''; + print "\n"; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART200)) { + print ''; + } else { + print ''; + } + print ''; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART238)) { + print ''; + } else { + print ''; + } + print ''; + + $var=!$var; + print ""; + print ''; + if (! empty($conf->global->DONATION_ART885)) { + print ''; + } else { + print ''; + } + print ''; + print "
' . $langs->trans('Parameters') . '
' . $langs->trans("DONATION_ART200") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("DONATION_ART238") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
' . $langs->trans("DONATION_ART885") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
\n"; +} + // Document templates print '
'; print_titre($langs->trans("DonationsModels")); diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index cd4c06e763c..2dc9c72968c 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -2,7 +2,7 @@ - __DonationReceipt__ + __DonationTitle__ @@ -11,10 +11,10 @@ - + @@ -25,7 +25,6 @@
Cerfa No 11580 01Cerfa N° 11580*03 - __DonationReceipt__
+ __DonationReceipt__
__FrenchArticle__
-
No: __REF__
@@ -37,9 +36,6 @@
-
-
-
@@ -74,6 +70,10 @@
+ +
+
+ +
@@ -93,25 +93,29 @@ +
- - - - - -
- __Name__ :
- __DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__
- __Address__ :
- __DONATOR_ADDRESS__
- __Zip__ : __DONATOR_ZIP__
- __Town__ : __DONATOR_TOWN__
-
- -
+ + + +
+ __Name__ :
+ __DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__
+ __Address__ :
+ __DONATOR_ADDRESS__
+ __Zip__ : __DONATOR_ZIP__
+ __Town__ : __DONATOR_TOWN__
+
+
+
+
+ +\n"; } - print '
+ '; +} + + $link=''; // Add link to show birthdays if (empty($conf->use_javascript_ajax)) @@ -314,7 +357,7 @@ if (empty($conf->use_javascript_ajax)) $link.=''; } -print_fiche_titre($title,$link.'     '.$nav, ''); +print_fiche_titre($s,$link.'     '.$nav, ''); // Get event in an array @@ -330,15 +373,16 @@ $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; -$sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,'; -$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)"; +$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; +if ($usergroup) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; -if ($user->societe_id) $sql.= ' AND a.fk_soc = '.$user->societe_id; // To limit to external user company +if ($socid) $sql.= ' AND a.fk_soc = '.$socid; +if ($usergroup) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($action == 'show_day') { $sql.= " AND ("; @@ -372,12 +416,13 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } -if ($filtera > 0 || $filtert > 0 || $filterd > 0) +if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup) { $sql.= " AND ("; if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; + if ($usergroup) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } // Sort on date diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 494a5339f96..d98c84e7bae 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -146,6 +146,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c,"; $sql.= " ".MAIN_DB_PREFIX.'user as u,'; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; +if ($usergroup) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid"; @@ -153,24 +154,26 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid"; $sql.= " WHERE c.id = a.fk_action"; $sql.= ' AND a.fk_user_author = u.rowid'; -$sql.= ' AND a.entity IN ('.getEntity().')'; // To limit to entity +$sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; // To limit to entity if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid) $sql.= " AND s.rowid = ".$socid; +if ($usergroup) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($type) $sql.= " AND c.id = ".$type; if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } -if ($filtera > 0 || $filtert > 0 || $filterd > 0) +if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup) { - $sql.= " AND ("; - if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; - if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; - if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; - $sql.= ")"; + $sql.= " AND ("; + if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; + if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; + if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; + if ($usergroup) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; + $sql.= ")"; } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -210,7 +213,7 @@ if ($resql) $head = calendars_prepare_head(''); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,''); dol_fiche_end(); // Add link to show birthdays diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e08a076624e..0adb10c1d22 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4239,7 +4239,7 @@ class Form $i = 0; if ($num) { - $out.= ''; if ($show_empty) $out.= ''."\n"; while ($i < $num) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 8eddf330c0f..9e41b0e5c1d 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -41,17 +41,16 @@ * @param int $socid Third party id * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend * @param string $actioncode Preselected value of actioncode for filter on type - * @param int $showbirthday Show check to toggle birthday events + * @param int $usergroupid Id of group to filter on users * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $showbirthday=0) +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $usergroupid='') { global $conf, $user, $langs, $db; // Filters print ''; print ''; - print ''; print ''; print ''; print ''; @@ -80,6 +79,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh //print '  '; print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); print ajax_combobox('usertodo'); + print '   '.$langs->trans("or") . ' '; + print $langs->trans("ActionsForUsersGroup").'   '; + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); + print ajax_combobox('usergroup'); print ''; /*print ''; @@ -146,44 +149,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; - // Legend - if ($conf->use_javascript_ajax) - { - print ''; - } print '
@@ -119,20 +123,31 @@
- __AMOUNT__ __CURRENCY__ + + __AMOUNT__ __CURRENCY__ +
- __DatePayment__ : __DATE__
+ __DonationDatePayment__ : __DATE__
__PaymentMode__ : __PAYMENTMODE_LIB__
- +
+ + + +
+
+ __Message__ : + __DonationMessage__
+
+ + - '; // Realised by diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index cfe6c3c210d..d5434ac86bf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -296,7 +296,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode); +print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,1); dol_fiche_end(); $link=''; @@ -327,7 +327,7 @@ $sql.= ' a.datea,'; $sql.= ' a.datea2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; -$sql.= ' a.priority, a.fulldayevent, a.location,'; +$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,'; @@ -409,6 +409,7 @@ if ($resql) $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; + $event->transparency=$obj->transparency; $event->societe->id=$obj->fk_soc; $event->contact->id=$obj->fk_contact; @@ -1033,7 +1034,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); - $nextindextouse=count($colorindexused); + $nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... //print $nextindextouse; foreach ($eventarray as $daykey => $notused) @@ -1074,7 +1075,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $color=$event->icalcolor; $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other'); } - else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; } + else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } else { $numother++; $cssclass='family_other'; } if ($color == -1) // Color was not forced. Set color according to color index. { @@ -1086,21 +1087,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { - $colorindex=$nextindextouse; - $colorindexused[$idusertouse]=$colorindex; + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color } //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; // Define color $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); - } + } $cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Show rect of event print '
'; print '
  • '; - print '
-

- __ThankYou__ - +
+ __FrenchEligibility__
+ __ARTICLE200__ __ARTICLE238__ __ARTICLE885__
@@ -142,8 +157,8 @@
-
__Date__ __Signature__
- __NOW__ +
__Date__ & __Signature__
+
__NOW__
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index e999124300e..b4cc2795c1a 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Marcos García + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ -19,9 +20,9 @@ */ /** - * \file htdocs/core/modules/dons/html_cerfafr.modules.php - * \ingroup don - * \brief Formulaire de don + * \file htdocs/core/modules/dons/html_cerfafr.modules.php + * \ingroup don + * \brief Form of donation */ require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; @@ -44,9 +45,9 @@ class html_cerfafr extends ModeleDon $this->db = $db; $this->name = "cerfafr"; - $this->description = $langs->trans('DonationsReceiptModel'); + $this->description = $langs->trans('DonationsReceiptModel').' - fr_FR - Cerfa 11580*03'; - // Dimension page pour format A4 + // Dimension page for size A4 $this->type = 'html'; } @@ -87,7 +88,7 @@ class html_cerfafr extends ModeleDon if (! empty($conf->don->dir_output)) { - // Definition de l'objet $don (pour compatibilite ascendante) + // Definition of the object don (for upward compatibility) if (! is_object($don)) { $don = new Don($this->db); @@ -95,7 +96,7 @@ class html_cerfafr extends ModeleDon $id=$don->id; } - // Definition de $dir et $file + // Definition of $dir and $file if (! empty($don->specimen)) { $dir = $conf->don->dir_output; @@ -121,8 +122,8 @@ class html_cerfafr extends ModeleDon { $formclass = new Form($this->db); - //This is not the proper way to do it but $formclass->form_modes_reglement - //prints the translation instead of returning it + // This is not the proper way to do it but $formclass->form_modes_reglement + // prints the translation instead of returning it if ($don->modepaiementid) { $formclass->load_cache_types_paiements(); @@ -130,7 +131,7 @@ class html_cerfafr extends ModeleDon } else $paymentmode = ''; - // Defini contenu + // Define contents $donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html"; $form = implode('', file($donmodel)); $form = str_replace('__REF__',$don->id,$form); @@ -143,32 +144,79 @@ class html_cerfafr extends ModeleDon $form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form); $form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form); $form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form); - $form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form); + $form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form); $form = str_replace('__DONATOR_LASTNAME__',$don->lastname,$form); $form = str_replace('__DONATOR_ADDRESS__',$don->address,$form); $form = str_replace('__DONATOR_ZIP__',$don->zip,$form); $form = str_replace('__DONATOR_TOWN__',$don->town,$form); $form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form); - $form = str_replace('__NOW__',dol_print_date($now,'',false,$outputlangs),$form); + $form = str_replace('__NOW__',dol_print_date($now,'day',false,$outputlangs),$form); $form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form); + $form = str_replace('__DonationTitle__',$outputlangs->trans("DonationTitle"),$form); $form = str_replace('__DonationReceipt__',$outputlangs->trans("DonationReceipt"),$form); $form = str_replace('__DonationRecipient__',$outputlangs->trans("DonationRecipient"),$form); - $form = str_replace('__DatePayment__',$outputlangs->trans("DatePayment"),$form); - $form = str_replace('__PaymentMode__',$outputlangs->trans("PaymentMode"),$form); + $form = str_replace('__DonationDatePayment__',$outputlangs->trans("DonationDatePayment"),$form); + $form = str_replace('__PaymentMode__',$outputlangs->trans("PaymentMode"),$form); $form = str_replace('__Name__',$outputlangs->trans("Name"),$form); $form = str_replace('__Address__',$outputlangs->trans("Address"),$form); $form = str_replace('__Zip__',$outputlangs->trans("Zip"),$form); $form = str_replace('__Town__',$outputlangs->trans("Town"),$form); + $form = str_replace('__Object__',$outputlangs->trans("Object"),$form); $form = str_replace('__Donor__',$outputlangs->trans("Donor"),$form); $form = str_replace('__Date__',$outputlangs->trans("Date"),$form); $form = str_replace('__Signature__',$outputlangs->trans("Signature"),$form); - $form = str_replace('__ThankYou__',$outputlangs->trans("ThankYou"),$form); + $form = str_replace('__Message__',$outputlangs->trans("Message"),$form); $form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form); - $frencharticle=''; - if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='(Article 200-5 du Code Général des Impôts)
+ article 238 bis'; + $form = str_replace('__DonationMessage__',$conf->global->DONATION_MESSAGE,$form); + + $frencharticle=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='Article 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)'; $form = str_replace('__FrenchArticle__',$frencharticle,$form); + + $frencheligibility=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencheligibility='Le bénéficiaire certifie sur l\'honneur que les dons et versements qu\'il reçoit ouvrent droit à la réduction d\'impôt prévue à l\'article :'; + $form = str_replace('__FrenchEligibility__',$frencheligibility,$form); + + $art200=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) { + if ($conf->global->DONATION_ART200 >= 1) + { + $art200='200 du CGI'; + } + else + { + $art200='200 du CGI'; + } + } + $form = str_replace('__ARTICLE200__',$art200,$form); - // Sauve fichier sur disque + $art238=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) { + if ($conf->global->DONATION_ART238 >= 1) + { + $art238='238 bis du CGI'; + } + else + { + $art238='238 bis du CGI'; + } + } + $form = str_replace('__ARTICLE238__',$art238,$form); + + $art885=''; + if (preg_match('/fr/i',$outputlangs->defaultlang)) { + if ($conf->global->DONATION_ART885 >= 1) + { + $art885='885-0 V bis du CGI'; + } + else + { + $art885='885-0 V bis du CGI'; + } + } + $form = str_replace('__ARTICLE885__',$art885,$form); + + // Save file on disk dol_syslog("html_cerfafr::write_file $file"); $handle=fopen($file,"w"); fwrite($handle,$form); @@ -190,7 +238,7 @@ class html_cerfafr extends ModeleDon return 0; } $this->error=$langs->trans("ErrorUnknown"); - return 0; // Erreur par defaut + return 0; // Error by default } } diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 931aa2ec325..1e4dfd2c914 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2011 Regis Houssin +/* Copyright (C) 2003-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2014 Alexandre Spangaro * * 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 @@ -19,17 +20,17 @@ /** * \defgroup don Module donation - * \brief Module pour gerer le suivi des dons + * \brief Module to manage the follow-up of the donations * \file htdocs/core/modules/modDon.class.php * \ingroup don - * \brief Fichier de description et activation du module Don + * \brief Description and activation file for module Donation */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Classe de description et activation du module Don + * Class to describe and enable module Donation */ class modDon extends DolibarrModules { @@ -66,15 +67,43 @@ class modDon extends DolibarrModules $this->config_page_url = array("dons.php"); // Constants - $this->const = array(); - $r=0; - - $this->const[$r][0] = "DON_ADDON_MODEL"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "html_cerfafr"; - $this->const[$r][3] = 'Nom du gestionnaire de generation de recu de dons'; - $this->const[$r][4] = 0; - $r++; + $this->const = array (); + + $this->const[1] = array ( + "DON_ADDON_MODEL", + "chaine", + "html_cerfafr", + "Nom du gestionnaire de generation de recu de dons", + "0" + ); + $this->const[2] = array ( + "DONATION_ART200", + "yesno", + "0", + "Option Française - Eligibilité Art200 du CGI", + "0" + ); + $this->const[3] = array ( + "DONATION_ART238", + "yesno", + "0", + "Option Française - Eligibilité Art238 bis du CGI", + "0" + ); + $this->const[4] = array ( + "DONATION_ART885", + "yesno", + "0", + "Option Française - Eligibilité Art885-0 V bis du CGI", + "0" + ); + $this->const[5] = array ( + "DONATION_MESSAGE", + "chaine", + "Thank you", + "Message affiché sur le récépissé de versements ou dons", + "0" + ); // Boxes $this->boxes = array(); diff --git a/htdocs/langs/fr_FR/donations.lang b/htdocs/langs/fr_FR/donations.lang index f8a71165842..9af7a87a12d 100644 --- a/htdocs/langs/fr_FR/donations.lang +++ b/htdocs/langs/fr_FR/donations.lang @@ -1,7 +1,7 @@ # Dolibarr language file - Source file is en_US - donations Donation=Don Donations=Dons -DonationRef=Réf. donation +DonationRef=Numéro d'ordre du reçu Donor=Donateur Donors=Donateurs AddDonation=Ajouter don @@ -22,11 +22,19 @@ DonationStatusPromiseNotValidatedShort=Non validée DonationStatusPromiseValidatedShort=Validée DonationStatusPaidShort=Payé ValidPromess=Valider promesse -DonationReceipt=Reçu de dons +DonationTitle=Reçu au titre des dons +DonationReceipt=Reçu au titre des dons
à certains organismes d'intéret général +DonationDatePayment=Date de versement ou du don BuildDonationReceipt=Créer reçu DonationsModels=Modèles de documents de bon de réception de dons LastModifiedDonations=Les %s derniers dons modifiés SearchADonation=Rechercher un don DonationRecipient=Bénéficiaire des versements ThankYou=Merci -IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des versements ouvrant droit à réduction d'impôt, la somme de +FreeTextOnDonations=Message affiché sur le récépissé de versements ou dons +IConfirmDonationReception=Le bénéficiaire reconnait avoir reçu au titre des dons et versements ouvrant droit à réduction d'impôt, la somme de +# French Options +FrenchOptions=Options éligibles en France +DONATION_ART200=Les dons ou versements reçus sont éligibles à l'article 200 du CGI +DONATION_ART238=Les dons ou versements reçus sont éligibles à l'article 238bis du CGI +DONATION_ART885=Les dons ou versements reçus sont éligibles à l'article 885-0 V bis A du CGI \ No newline at end of file From c4912c5e25545e4f5b0bf1294d86a77d0e141aae Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 12:20:41 +0200 Subject: [PATCH 041/502] travis --- htdocs/product/class/product.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4654d1aabc3..f871d8197ba 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -940,14 +940,14 @@ class Product extends CommonObject /** * Update ou cree les traductions des infos produits * - * $langs_to_delete string code langue to delete - * @return int <0 if KO, >0 if OK + * @param $langstodelete string code langue to delete + * @return int <0 if KO, >0 if OK */ - function delMultiLangs($langs_to_delete) + function delMultiLangs($langstodelete) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_lang"; - $sql.= " WHERE fk_product=".$this->id." AND lang='".$langs_to_delete."'"; + $sql.= " WHERE fk_product=".$this->id." AND lang='".$langstodelete."'"; dol_syslog(get_class($this).'::delMultiLangs sql='.$sql); if (! $this->db->query($sql)) From 4b78c8e11a9b043f5ca77f2b58717671eafb5140 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 12:21:34 +0200 Subject: [PATCH 042/502] comment method in english --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f871d8197ba..e04d215768b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -860,7 +860,7 @@ class Product extends CommonObject } /** - * Update ou cree les traductions des infos produits + * Update or create transltation for product * * @return int <0 if KO, >0 if OK */ @@ -938,7 +938,7 @@ class Product extends CommonObject } /** - * Update ou cree les traductions des infos produits + * Delete Translation * * @param $langstodelete string code langue to delete * @return int <0 if KO, >0 if OK From c2fc40d62a4e9cfdb6d5d70bca2ebd566740b501 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 12:58:49 +0200 Subject: [PATCH 043/502] travis --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e04d215768b..13492f89159 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -940,8 +940,8 @@ class Product extends CommonObject /** * Delete Translation * - * @param $langstodelete string code langue to delete - * @return int <0 if KO, >0 if OK + * @param string $langstodelete code langue to delete + * @return int <0 if KO, >0 if OK */ function delMultiLangs($langstodelete) { From 9bb537f399a37298dd658a5dc236c3d691758e96 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 18 Jun 2014 09:59:15 +0200 Subject: [PATCH 044/502] - New: If multilangue is enabled, mail (from propal, invoice, etc...) message is pre-defaulted in Customer language --- ChangeLog | 1 + htdocs/comm/propal.php | 20 +++++++++------ htdocs/commande/fiche.php | 17 +++++++------ htdocs/compta/facture.php | 17 +++++++------ htdocs/core/class/html.formmail.class.php | 30 ++++++++++++++++------- htdocs/expedition/fiche.php | 14 +++++++---- htdocs/fichinter/fiche.php | 14 +++++++---- htdocs/fourn/commande/fiche.php | 14 +++++++---- htdocs/fourn/facture/fiche.php | 14 +++++++---- htdocs/societe/soc.php | 9 +++++++ 10 files changed, 99 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index a17751c7fb1..35a30311aef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -66,6 +66,7 @@ For users: - Fix: Price min of composition is not supplier price min by quantity. - Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers. - Fix: [ bug #1439 ] impossible to remove a a translation (multilanguage-feature) +- New: If multilangue is enabled, mail (from propal, invoice, etc...) message is pre-defaulted in Customer language TODO - New: Predefined product and free product use same form. diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a9ec591cf5f..38925315fd4 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1974,21 +1974,24 @@ if ($action == 'create') { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; + // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - + $result = propale_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $result); @@ -2004,6 +2007,7 @@ if ($action == 'create') { // Create form object include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 7c1f0d30d25..0927f9b51dc 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2270,16 +2270,18 @@ if ($action == 'create' && $user->rights->commande->creer) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -2300,6 +2302,7 @@ if ($action == 'create' && $user->rights->commande->creer) { // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b6837d68a98..59df4f2e3be 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3609,16 +3609,18 @@ if ($action == 'create') include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) - $newlang = $_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -3639,6 +3641,7 @@ if ($action == 'create') // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index b9f5e7e1bc1..21af36d5b76 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -554,17 +554,29 @@ class FormMail if (! empty($this->withbody)) { $defaultmessage=""; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $this->param['langsmodels']; + + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + // TODO A partir du type, proposer liste de messages dans table llx_c_email_template - if ($this->param["models"]=='facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoice"); } - elseif ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } - elseif ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); } - elseif ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); } - elseif ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } - elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } - elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); } - elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); } - elseif ($this->param["models"]=='thirdparty') { $defaultmessage=$langs->transnoentities("PredefinedMailContentThirdparty"); } + if ($this->param["models"]=='facture_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoice"); } + elseif ($this->param["models"]=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } + elseif ($this->param["models"]=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); } + elseif ($this->param["models"]=='order_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendOrder"); } + elseif ($this->param["models"]=='order_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierOrder"); } + elseif ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } + elseif ($this->param["models"]=='shipping_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendShipping"); } + elseif ($this->param["models"]=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); } + elseif ($this->param["models"]=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } // Complete substitution array diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 45208e77dbe..02c7a5670d1 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -1573,15 +1573,18 @@ else if ($id || $ref) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/')); $file=$fileparams['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -1604,6 +1607,7 @@ else if ($id || $ref) // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 7dae4a359ee..2af552b2537 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1625,15 +1625,18 @@ else if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/')); $file=$fileparams['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -1656,6 +1659,7 @@ else if ($id > 0 || ! empty($ref)) // Create form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 22df11dd7ae..6d6b138c542 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1975,14 +1975,17 @@ elseif (! empty($object->id)) $fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/')); $file=$fileparams['fullname']; + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; + // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -2006,6 +2009,7 @@ elseif (! empty($object->id)) // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 92c8be3469c..996af90f62f 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -2224,15 +2224,18 @@ else include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/')); $file=$fileparams['fullname']; + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Build document if it not exists if (! $file || ! is_readable($file)) { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -2255,6 +2258,7 @@ else // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b88642cd83d..da6c7771eb3 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1895,10 +1895,19 @@ else print '
'; print_titre($langs->trans($titreform)); + + // Define output language + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) + $newlang = $_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) + $newlang = $object->client->default_lang; // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; $formmail->fromname = $user->getFullName($langs); From ff31fff2d7a5248837d31edd7a6202b595a98d7e Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Jun 2014 21:34:18 +0200 Subject: [PATCH 045/502] Create box_task.php add boxes of tasks --- htdocs/core/boxes/box_task.php | 128 +++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 htdocs/core/boxes/box_task.php diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php new file mode 100644 index 00000000000..6e3b73b65db --- /dev/null +++ b/htdocs/core/boxes/box_task.php @@ -0,0 +1,128 @@ + + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_task.php + * \ingroup Projet + * \brief Module to Task activity of the current year + * \version $Id: box_task.php,v 1.1 2012/09/11 Charles-François BENKE + */ + +include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); + +class box_task extends ModeleBoxes { + + var $boxcode="projet"; + var $boximg="object_projecttask"; + var $boxlabel; + //var $depends = array("projet"); + var $db; + var $param; + + var $info_box_head = array(); + var $info_box_contents = array(); + + /** + * \brief Constructeur de la classe + */ + function box_task() + { + global $langs; + $langs->load("boxes"); + $langs->load("projects"); + $this->boxlabel="Tasks"; + } + + /** + * \brief Charge les donnees en memoire pour affichage ulterieur + * \param $max Nombre maximum d'enregistrements a charger + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $totalMnt = 0; + $totalnb = 0; + $totalDuree=0; + include_once(DOL_DOCUMENT_ROOT."/projet/class/task.class.php"); + $taskstatic=new Task($db); + + + $textHead = $langs->trans("Tasks")." ".date("Y"); + $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + + // list the summary of the orders + if ($user->rights->projet->lire) + { + + $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(pt.total_ht) as Mnttot, sum(pt.planned_workload) as Dureetot"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt"; + $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." "; + $sql.= " GROUP BY pt.fk_statut "; + $sql.= " ORDER BY pt.fk_statut DESC"; + $sql.= $db->plimit($max, 0); + + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask'); + + $objp = $db->fetch_object($result); + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0) + ); + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', + 'text' => $objp->nb." ".$langs->trans("Tasks"), + 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut + ); + $totalnb += $objp->nb; + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->Dureetot,'all',25200,5)); + $totalDuree += $objp->Dureetot; + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format($objp->Mnttot, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); + $totalMnt += $objp->Mnttot; + + $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); + + $i++; + } + } + } + + + // Add the sum à the bottom of the boxes + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalDuree,'all',25200,5)); + $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); + $this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => ""); + + } + + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } +} +?> From c963a6d8a15b291522229f45ae3db3d7281bf6a5 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Jun 2014 21:36:00 +0200 Subject: [PATCH 046/502] Create box_project.php add box for project --- htdocs/core/boxes/box_project.php | 150 ++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 htdocs/core/boxes/box_project.php diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php new file mode 100644 index 00000000000..206c54aafa0 --- /dev/null +++ b/htdocs/core/boxes/box_project.php @@ -0,0 +1,150 @@ + + * 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 . + */ + +/** + * \file htdocs/core/boxes/box_activite.php + * \ingroup projet + * \brief Module to show Projet activity of the current Year + * \version $Id: box_projet.php,v 1.1 2012/09/11 Charles-François BENKE + */ + +include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); + +class box_projet extends ModeleBoxes { + + var $boxcode="projet"; + var $boximg="object_projectpub"; + var $boxlabel; + //var $depends = array("projet"); + var $db; + var $param; + + var $info_box_head = array(); + var $info_box_contents = array(); + + /** + * \brief Constructeur de la classe + */ + function box_projet() + { + global $langs; + $langs->load("boxes"); + $langs->load("projects"); + + $this->boxlabel="Projet"; + } + + /** + * \brief Charge les donnees en memoire pour affichage ulterieur + * \param $max Nombre maximum d'enregistrements a charger + */ + function loadBox($max=5) + { + global $conf, $user, $langs, $db; + + $this->max=$max; + + $totalMnt = 0; + $totalnb = 0; + $totalnbTask=0; + include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); + require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php"); + $projectstatic=new Project($db); + + + + $textHead = $langs->trans("Projet")." ".date("Y"); + $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + + // list the summary of the orders + if ($user->rights->projet->lire) + { + + $sql = "SELECT p.fk_statut, count(p.rowid) as nb"; + $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."projet as p"; + $sql.= ")"; + $sql.= " WHERE p.fk_soc = s.rowid"; + $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND DATE_FORMAT(p.datec,'%Y') = ".date("Y")." "; + $sql.= " GROUP BY p.fk_statut "; + $sql.= " ORDER BY p.fk_statut DESC"; + $sql.= $db->plimit($max, 0); + + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projectpub'); + + $objp = $db->fetch_object($result); + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' =>$langs->trans("Project")." ".$projectstatic->LibStatut($objp->fk_statut,0) + ); + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', + 'text' => $objp->nb." ".$langs->trans("Projects"), + 'url' => DOL_URL_ROOT."/projet/liste.php?mainmenu=project&viewstatut=".$objp->fk_statut + ); + $totalnb += $objp->nb; + + $sql = "SELECT sum(pt.total_ht) as Mnttot, count(*) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p"; + $sql.= " WHERE pt.fk_projet = p.rowid"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND (DATE_FORMAT(p.datec,'%Y') = ".date("Y").")"; + $sql.= " AND p.fk_statut=".$objp->fk_statut; + $resultTask = $db->query($sql); + if ($resultTask) + { + $objTask = $db->fetch_object($resultTask); + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb , 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format($objTask->Mnttot, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); + + $totalMnt += $objTask->Mnttot; + $totalnbTask += $objTask->nb; + } + else + { + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0 , 0, ',', ' ')); + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_trunc(number_format(0 , 0, ',', ' '),40)." ".$langs->trans("Currency".$conf->currency)); + } + $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $projectstatic->LibStatut($objp->fk_statut,3)); + + $i++; + } + } + } + + + // Add the sum à the bottom of the boxes + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead); + $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Projects")); + $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); + $this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => ""); + + } + + function showBox($head = null, $contents = null) + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } +} +?> From 66dc82621dc69a2b0bdd1ee6ca8d6345c841bb38 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Jun 2014 21:37:56 +0200 Subject: [PATCH 047/502] Update modProjet.class.php add boxe definition on projet module --- htdocs/core/modules/modProjet.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 0d8a09aa7e5..d9d2817759f 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Charles-Fr BENKE * * 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 @@ -116,6 +117,11 @@ class modProjet extends DolibarrModules // Boxes $this->boxes = array(); + $r=0; + $this->boxes[$r][1] = "box_project.php"; + $r++; + $this->boxes[$r][1] = "box_task.php"; + $r++; // Permissions $this->rights = array(); From 31c2815d0fee2934f167d19e37ff33d3855c2e87 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Jun 2014 21:50:17 +0200 Subject: [PATCH 048/502] Update box_task.php --- htdocs/core/boxes/box_task.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 6e3b73b65db..1cdda61b766 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -71,9 +71,10 @@ class box_task extends ModeleBoxes { if ($user->rights->projet->lire) { - $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(pt.total_ht) as Mnttot, sum(pt.planned_workload) as Dureetot"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt"; + $sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt"; $sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = ".date("Y")." "; + $sql.= " AND pt.rowid = ptt.fk_task"; $sql.= " GROUP BY pt.fk_statut "; $sql.= " ORDER BY pt.fk_statut DESC"; $sql.= $db->plimit($max, 0); @@ -98,10 +99,10 @@ class box_task extends ModeleBoxes { 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut ); $totalnb += $objp->nb; - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->Dureetot,'all',25200,5)); - $totalDuree += $objp->Dureetot; - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format($objp->Mnttot, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); - $totalMnt += $objp->Mnttot; + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); + $totalplannedtot += $objp->plannedtot; + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5)); + $totaldurationtot += $objp->durationtot; $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3)); @@ -114,8 +115,8 @@ class box_task extends ModeleBoxes { // Add the sum à the bottom of the boxes $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead); $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks")); - $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalDuree,'all',25200,5)); - $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); + $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); + $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); $this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => ""); } From 754b028ec6c377a5711e72d42fc8d90ff37fd178 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Jun 2014 22:19:28 +0200 Subject: [PATCH 049/502] Update box_project.php --- htdocs/core/boxes/box_project.php | 36 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 206c54aafa0..9e5bca479f4 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -66,21 +66,20 @@ class box_projet extends ModeleBoxes { - $textHead = $langs->trans("Projet")." ".date("Y"); + $textHead = $langs->trans("Projet"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the orders if ($user->rights->projet->lire) { - $sql = "SELECT p.fk_statut, count(p.rowid) as nb"; + $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut "; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."projet as p"; $sql.= ")"; $sql.= " WHERE p.fk_soc = s.rowid"; $sql.= " AND s.entity = ".$conf->entity; - $sql.= " AND DATE_FORMAT(p.datec,'%Y') = ".date("Y")." "; - $sql.= " GROUP BY p.fk_statut "; - $sql.= " ORDER BY p.fk_statut DESC"; + $sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts + $sql.= " ORDER BY p.datec DESC"; $sql.= $db->plimit($max, 0); $result = $db->query($sql); @@ -94,38 +93,36 @@ class box_projet extends ModeleBoxes { $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projectpub'); $objp = $db->fetch_object($result); + $projectstatic->fetch($objp->rowid); + $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' =>$langs->trans("Project")." ".$projectstatic->LibStatut($objp->fk_statut,0) + 'text' =>$projectstatic->getNomUrl(1) ); - $this->info_box_contents[$i][2] = array('td' => 'align="right"', - 'text' => $objp->nb." ".$langs->trans("Projects"), - 'url' => DOL_URL_ROOT."/projet/liste.php?mainmenu=project&viewstatut=".$objp->fk_statut + $this->info_box_contents[$i][2] = array('td' => 'align="left"', + 'text' => $objp->title ); - $totalnb += $objp->nb; - $sql = "SELECT sum(pt.total_ht) as Mnttot, count(*) as nb"; + $sql = "SELECT count(*) as nb, sum(progress) as totprogress"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p"; $sql.= " WHERE pt.fk_projet = p.rowid"; $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND (DATE_FORMAT(p.datec,'%Y') = ".date("Y").")"; - $sql.= " AND p.fk_statut=".$objp->fk_statut; $resultTask = $db->query($sql); if ($resultTask) { $objTask = $db->fetch_object($resultTask); $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb , 0, ',', ' ')." ".$langs->trans("Tasks")); - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format($objTask->Mnttot, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); - - $totalMnt += $objTask->Mnttot; + if ($objTask->nb > 0 ) + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb) , 0, ',', ' ')." % ".$langs->trans("Progress")); + else + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); $totalnbTask += $objTask->nb; } else { $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0 , 0, ',', ' ')); - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dol_trunc(number_format(0 , 0, ',', ' '),40)." ".$langs->trans("Currency".$conf->currency)); + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); } - $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $projectstatic->LibStatut($objp->fk_statut,3)); $i++; } @@ -135,9 +132,8 @@ class box_projet extends ModeleBoxes { // Add the sum à the bottom of the boxes $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead); - $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Projects")); + $this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects")); $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks")); - $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')." ".$langs->trans("Currency".$conf->currency)); $this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => ""); } From ec1a6e1c29e5b0c316b3974ee840fa1b5f361b75 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 20 Jun 2014 23:17:26 +0200 Subject: [PATCH 050/502] Update box_task.php --- htdocs/core/boxes/box_task.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 1cdda61b766..6dfe65d78d7 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -24,7 +24,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); -class box_task extends ModeleBoxes { +/** + * Class to manage the box to show last task + */ +class box_task extends ModeleBoxes +{ var $boxcode="projet"; var $boximg="object_projecttask"; @@ -38,6 +42,7 @@ class box_task extends ModeleBoxes { /** * \brief Constructeur de la classe + * @return void */ function box_task() { From 8070030c4576124f42b7d7d706069271bac10efe Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 20 Jun 2014 23:19:57 +0200 Subject: [PATCH 051/502] Update box_project.php --- htdocs/core/boxes/box_project.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 9e5bca479f4..237b5c04064 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -23,9 +23,13 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); -class box_projet extends ModeleBoxes { +/** + * Class to manage the box to show last projet + */ +class box_project extends ModeleBoxes +{ - var $boxcode="projet"; + var $boxcode="project"; var $boximg="object_projectpub"; var $boxlabel; //var $depends = array("projet"); @@ -38,7 +42,7 @@ class box_projet extends ModeleBoxes { /** * \brief Constructeur de la classe */ - function box_projet() + function box_project() { global $langs; $langs->load("boxes"); @@ -49,7 +53,8 @@ class box_projet extends ModeleBoxes { /** * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger + * @param int $max Maximum number of records to load + * @return void */ function loadBox($max=5) { @@ -103,10 +108,10 @@ class box_projet extends ModeleBoxes { 'text' => $objp->title ); - $sql = "SELECT count(*) as nb, sum(progress) as totprogress"; - $sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p"; - $sql.= " WHERE pt.fk_projet = p.rowid"; - $sql.= " AND p.entity = ".$conf->entity; + $sql ="SELECT count(*) as nb, sum(progress) as totprogress"; + $sql.=" FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p"; + $sql.=" WHERE pt.fk_projet = p.rowid"; + $sql.=" AND p.entity = ".$conf->entity; $resultTask = $db->query($sql); if ($resultTask) { From a31d5cc193b4d880684e547751315c3e431ed831 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 20 Jun 2014 23:38:15 +0200 Subject: [PATCH 052/502] Update box_project.php --- htdocs/core/boxes/box_project.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 237b5c04064..2339a63c92f 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -28,7 +28,6 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); */ class box_project extends ModeleBoxes { - var $boxcode="project"; var $boximg="object_projectpub"; var $boxlabel; @@ -52,7 +51,8 @@ class box_project extends ModeleBoxes } /** - * \brief Charge les donnees en memoire pour affichage ulterieur + * Load data for box to show them later + * * @param int $max Maximum number of records to load * @return void */ @@ -143,6 +143,13 @@ class box_project extends ModeleBoxes } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); From 24e780cb0c3904de1ecd3018a9e64dd2b70b1ce0 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 20 Jun 2014 23:39:43 +0200 Subject: [PATCH 053/502] Update box_task.php --- htdocs/core/boxes/box_task.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 6dfe65d78d7..d850a7e0107 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -52,10 +52,12 @@ class box_task extends ModeleBoxes $this->boxlabel="Tasks"; } - /** - * \brief Charge les donnees en memoire pour affichage ulterieur - * \param $max Nombre maximum d'enregistrements a charger - */ + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ function loadBox($max=5) { global $conf, $user, $langs, $db; @@ -126,6 +128,13 @@ class box_task extends ModeleBoxes } + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @return void + */ function showBox($head = null, $contents = null) { parent::showBox($this->info_box_head, $this->info_box_contents); From 496379ced895a6cee3017cf23f0a3574f218f03c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 20 Jun 2014 23:56:03 +0200 Subject: [PATCH 054/502] fix travis error --- htdocs/core/boxes/box_factures.php | 3 +-- htdocs/core/boxes/box_project.php | 14 ++++++-------- htdocs/core/boxes/box_task.php | 23 +++++++++++------------ 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 18d276b0130..23ab2df8556 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -24,7 +24,6 @@ */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; - /** * Class to manage the box to show last invoices */ @@ -159,4 +158,4 @@ class box_factures extends ModeleBoxes } } - +?> \ No newline at end of file diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 2339a63c92f..e9cf2f24202 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -18,15 +18,13 @@ * \file htdocs/core/boxes/box_activite.php * \ingroup projet * \brief Module to show Projet activity of the current Year - * \version $Id: box_projet.php,v 1.1 2012/09/11 Charles-François BENKE */ - include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last projet */ -class box_project extends ModeleBoxes +class box_project extends ModeleBoxes { var $boxcode="project"; var $boximg="object_projectpub"; @@ -51,11 +49,11 @@ class box_project extends ModeleBoxes } /** - * Load data for box to show them later - * - * @param int $max Maximum number of records to load - * @return void - */ + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ function loadBox($max=5) { global $conf, $user, $langs, $db; diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index d850a7e0107..a0accd74b3a 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -27,9 +27,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); /** * Class to manage the box to show last task */ -class box_task extends ModeleBoxes +class box_task extends ModeleBoxes { - var $boxcode="projet"; var $boximg="object_projecttask"; var $boxlabel; @@ -41,9 +40,9 @@ class box_task extends ModeleBoxes var $info_box_contents = array(); /** - * \brief Constructeur de la classe - * @return void - */ + * \brief Constructeur de la classe + * @return void + */ function box_task() { global $langs; @@ -51,13 +50,13 @@ class box_task extends ModeleBoxes $langs->load("projects"); $this->boxlabel="Tasks"; } - - /** - * Load data for box to show them later - * - * @param int $max Maximum number of records to load - * @return void - */ + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ function loadBox($max=5) { global $conf, $user, $langs, $db; From b34947b37cd5850ec4d0cb233ce84b642dfe7f2d Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 21 Jun 2014 00:08:13 +0200 Subject: [PATCH 055/502] fix travis error --- htdocs/core/boxes/box_project.php | 6 +++--- htdocs/core/boxes/box_task.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index e9cf2f24202..5155c92b251 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -114,16 +114,16 @@ class box_project extends ModeleBoxes if ($resultTask) { $objTask = $db->fetch_object($resultTask); - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb , 0, ',', ' ')." ".$langs->trans("Tasks")); + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks")); if ($objTask->nb > 0 ) - $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb) , 0, ',', ' ')." % ".$langs->trans("Progress")); + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')." % ".$langs->trans("Progress")); else $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); $totalnbTask += $objTask->nb; } else { - $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0 , 0, ',', ' ')); + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0, 0, ',', ' ')); $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A "); } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index a0accd74b3a..20a0871bc7e 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -41,6 +41,7 @@ class box_task extends ModeleBoxes /** * \brief Constructeur de la classe + * * @return void */ function box_task() From fa75ef3b57d23a7709f22dcf55c142d81e9df412 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 21 Jun 2014 00:35:11 +0200 Subject: [PATCH 056/502] made change on all the modules_element definition --- htdocs/core/modules/barcode/modules_barcode.class.php | 1 + htdocs/core/modules/contract/modules_contract.php | 1 + htdocs/core/modules/dons/modules_don.php | 1 + htdocs/core/modules/expedition/modules_expedition.php | 1 + htdocs/core/modules/facture/modules_facture.php | 1 + htdocs/core/modules/fichinter/modules_fichinter.php | 1 + htdocs/core/modules/livraison/modules_livraison.php | 1 + htdocs/core/modules/product/modules_product.class.php | 1 + htdocs/core/modules/project/modules_project.php | 1 + htdocs/core/modules/societe/modules_societe.class.php | 2 ++ .../modules/supplier_invoice/modules_facturefournisseur.php | 1 + .../core/modules/supplier_order/modules_commandefournisseur.php | 1 + 12 files changed, 13 insertions(+) diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 5305ad53cd2..0f87306354a 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -109,6 +109,7 @@ abstract class ModeleNumRefBarCode if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } diff --git a/htdocs/core/modules/contract/modules_contract.php b/htdocs/core/modules/contract/modules_contract.php index 9c54ed4a460..27a77733553 100644 --- a/htdocs/core/modules/contract/modules_contract.php +++ b/htdocs/core/modules/contract/modules_contract.php @@ -138,6 +138,7 @@ class ModelNumRefContracts if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index c06494fc501..d676d2c6f70 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -134,6 +134,7 @@ abstract class ModeleNumRefDons if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index ceddd5064e1..a88ac3ff023 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -136,6 +136,7 @@ abstract class ModelNumRefExpedition if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 3253ed00ef9..2077e7255dd 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -137,6 +137,7 @@ abstract class ModeleNumRefFactures if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 51084d7b313..61f73eff366 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -136,6 +136,7 @@ abstract class ModeleNumRefFicheinter if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index 89b226ec066..4d6f888e9a5 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -139,6 +139,7 @@ abstract class ModeleNumRefDeliveryOrder if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index e708b89b82a..66affcf256a 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -97,6 +97,7 @@ abstract class ModeleProductCode if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 2595485eac1..22273be31dd 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -134,6 +134,7 @@ abstract class ModeleNumRefProjects if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 3bff1f41985..0a7245fc629 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -134,6 +134,7 @@ abstract class ModeleThirdPartyCode if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } @@ -303,6 +304,7 @@ abstract class ModeleAccountancyCode if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index fef936cb100..1a761bab636 100644 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -127,6 +127,7 @@ abstract class ModeleNumRefSuppliersInvoices if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index f7e6b75adc2..a08eb7f7ce4 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -132,6 +132,7 @@ abstract class ModeleNumRefSuppliersOrders if ($this->version == 'development') return $langs->trans("VersionDevelopment"); if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); if ($this->version == 'dolibarr') return DOL_VERSION; + if ($this->version) return $this->version; return $langs->trans("NotAvailable"); } } From 865d853af8cab161fc3501e3b822455b8c56a856 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 24 Jun 2014 06:02:17 +0200 Subject: [PATCH 057/502] Add migration file to 3.7 & update llx_c_paiement --- .../install/mysql/migration/3.6.0-3.7.0.sql | 21 +++++++++++++++++++ .../install/mysql/tables/llx_c_paiement.sql | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 htdocs/install/mysql/migration/3.6.0-3.7.0.sql diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql new file mode 100644 index 00000000000..a57c3e5a743 --- /dev/null +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -0,0 +1,21 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 3.7.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To restrict request to Mysql version x.y use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE + +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + + +ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_c_paiement.sql b/htdocs/install/mysql/tables/llx_c_paiement.sql index cc2f7500ab1..665897069cc 100644 --- a/htdocs/install/mysql/tables/llx_c_paiement.sql +++ b/htdocs/install/mysql/tables/llx_c_paiement.sql @@ -32,7 +32,7 @@ create table llx_c_paiement libelle varchar(30), type smallint, active tinyint DEFAULT 1 NOT NULL, - accountancy_code varchar(32) DEFAULT NULL, + accountancy_code varchar(32) NULL, module varchar(32) NULL )ENGINE=innodb; From 3269b463bbff82f87fe5613433b7164d8bd1ca2f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 24 Jun 2014 15:02:09 +0200 Subject: [PATCH 058/502] Fix / New : return on project page after task deletion instead of task list --- htdocs/projet/tasks/task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index dd83cf57d8f..0b3e98e94e0 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -110,7 +110,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->s if ($object->delete($user) > 0) { - header("Location: index.php"); + header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id); exit; } else From 396012f7e7f3a280452195e3c27c65d2ef6f599f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Jun 2014 15:37:10 +0200 Subject: [PATCH 059/502] Fix: When an invoice is replaced with another, amount must not appears on total for project --- htdocs/projet/element.php | 41 +++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6101f337471..6edaec7b35a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -246,7 +246,7 @@ foreach ($listofreferent as $key => $value) print ''; } print ''; - + print ''; print ''; print ''; @@ -269,6 +269,12 @@ foreach ($listofreferent as $key => $value) $element->fetch_thirdparty(); //print $classname; + $qualifiedfortotal=true; + if ($key == 'invoice') + { + if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice + } + $var=!$var; print ""; @@ -290,18 +296,35 @@ foreach ($listofreferent as $key => $value) print ''; // Amount - if (empty($value['disableamount'])) print ''; + if (empty($value['disableamount'])) + { + print ''; + } // Amount - if (empty($value['disableamount'])) print ''; + if (empty($value['disableamount'])) + { + print ''; + } // Status print ''; print ''; - $total_ht = $total_ht + $element->total_ht; - $total_ttc = $total_ttc + $element->total_ttc; + if ($qualifiedfortotal) + { + $total_ht = $total_ht + $element->total_ht; + $total_ttc = $total_ttc + $element->total_ttc; + } } print ''; @@ -385,9 +408,11 @@ foreach ($listofreferent as $key => $value) $element->fetch($elementarray[$i]); $element->fetch_thirdparty(); //print $classname; - - $total_ht = $total_ht + $element->total_ht; - $total_ttc = $total_ttc + $element->total_ttc; + if ($qualified) + { + $total_ht = $total_ht + $element->total_ht; + $total_ttc = $total_ttc + $element->total_ttc; + } } print ''; From 92f1778c9df42164d4c5fc71cc3a6afdb443bd8f Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 25 Jun 2014 16:51:26 +0200 Subject: [PATCH 060/502] Fix : [ bug #1459 ] _ADD_CONTACT and _DEL_CONTACT triggers do not intercept insertion when reported an error Start refactoring trigger call from within object --- ChangeLog | 3 + htdocs/core/class/commonobject.class.php | 77 +++++++++++++++--------- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a88f51c07d..76fc8bbf801 100644 --- a/ChangeLog +++ b/ChangeLog @@ -65,6 +65,7 @@ For users: - Fix: Add actions events not implemented. - Fix: Price min of composition is not supplier price min by quantity. - Fix: [ bug #1356 ] Bank accountancy number is limited to 8 numbers. +- Fix: [ bug #1459 ] _ADD_CONTACT and _DEL_CONTACT triggers do not intercept insertion when reported an error TODO - New: Predefined product and free product use same form. @@ -89,6 +90,8 @@ For developers: - New: A module can disable a standard ECM view. - New: Add multilang support into product webservice. - New: Add hooks on project card page. +- New: Add call_trigger method on CommonObject class. So new trigger call within object it's just : +$result = $this->call_trigger($triger_name, $user) and do what you need to do if trigger fail WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 914d9be59a3..0c1d18e28ed 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -164,7 +164,6 @@ abstract class CommonObject { global $user,$conf,$langs; - $error=0; dol_syslog(get_class($this)."::add_contact $fk_socpeople, $type_contact, $source"); @@ -205,6 +204,8 @@ abstract class CommonObject $datecreate = dol_now(); + $this->db->begin(); + // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact"; $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) "; @@ -219,20 +220,16 @@ abstract class CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers(strtoupper($this->element).'_ADD_CONTACT',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End call triggers + $result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); + if ($result < 0) { $this->db->rollback(); return -1; } } - + + $this->db->commit(); return 1; } else { + $this->db->rollback(); if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error=$this->db->errno(); @@ -311,8 +308,9 @@ abstract class CommonObject { global $user,$langs,$conf; - $error=0; + $this->db->begin(); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; $sql.= " WHERE rowid =".$rowid; @@ -321,21 +319,17 @@ abstract class CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers(strtoupper($this->element).'_DELETE_CONTACT',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End call triggers + $result=$this->call_trigger(strtoupper($this->element).'_DELETE_CONTACT', $user); + if ($result < 0) { $this->db->rollback(); return -1; } } + $this->db->commit(); return 1; } else { $this->error=$this->db->lasterror(); + $this->db->rollback(); dol_syslog(get_class($this)."::delete_contact error=".$this->error, LOG_ERR); return -1; } @@ -3354,8 +3348,9 @@ abstract class CommonObject { global $user,$langs,$conf; - $error=0; + $this->db->begin(); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; $sql.= " WHERE rowid =".$rowid; @@ -3364,14 +3359,8 @@ abstract class CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers(strtoupper($element).'_DELETE_RESOURCE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End call triggers + $result=$this->call_trigger(strtoupper($element).'_DELETE_RESOURCE', $user); + if ($result < 0) { $this->db->rollback(); return -1; } } return 1; @@ -3379,6 +3368,7 @@ abstract class CommonObject else { $this->error=$this->db->lasterror(); + $this->db->rollback(); dol_syslog(get_class($this)."::delete_resource error=".$this->error, LOG_ERR); return -1; } @@ -3402,5 +3392,36 @@ abstract class CommonObject } } } + + /** + * Call trigger based on this instance + * + * NB: Error from trigger are stacked in errors + * NB2: if trigger fail, action should be canceled. + * + * @param string $trigger_name trigger's name to execute + * @param User $user Object user + * @return int Result of run_triggers + */ + function call_trigger($trigger_name, $user) + { + global $langs,$conf; + + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers($trigger_name,$this,$user,$langs,$conf); + if ($result < 0) { + if (!empty($this->errors)) + { + $this->errors=array_merge($this->errors,$interface->errors); + } + else + { + $this->errors=$interface->errors; + } + } + return $result; + + } } From 012d2c2a9e07e6534cba2c1e112cf05b2e7d5e1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Jun 2014 01:50:49 +0200 Subject: [PATCH 061/502] Syn pt_BR from transifex --- htdocs/langs/pt_BR/admin.lang | 607 ++++++++++++++++------------ htdocs/langs/pt_BR/agenda.lang | 95 ++--- htdocs/langs/pt_BR/banks.lang | 9 + htdocs/langs/pt_BR/bills.lang | 63 ++- htdocs/langs/pt_BR/bookmarks.lang | 16 +- htdocs/langs/pt_BR/boxes.lang | 20 +- htdocs/langs/pt_BR/cashdesk.lang | 11 + htdocs/langs/pt_BR/categories.lang | 11 + htdocs/langs/pt_BR/commercial.lang | 26 +- htdocs/langs/pt_BR/companies.lang | 82 +++- htdocs/langs/pt_BR/compta.lang | 77 +++- htdocs/langs/pt_BR/contracts.lang | 2 + htdocs/langs/pt_BR/errors.lang | 77 +++- htdocs/langs/pt_BR/exports.lang | 126 +++--- htdocs/langs/pt_BR/help.lang | 17 + htdocs/langs/pt_BR/holiday.lang | 109 +++-- htdocs/langs/pt_BR/install.lang | 2 + htdocs/langs/pt_BR/languages.lang | 5 + htdocs/langs/pt_BR/mails.lang | 9 + htdocs/langs/pt_BR/main.lang | 13 +- htdocs/langs/pt_BR/margins.lang | 5 +- htdocs/langs/pt_BR/members.lang | 49 +++ htdocs/langs/pt_BR/opensurvey.lang | 18 + htdocs/langs/pt_BR/orders.lang | 3 + htdocs/langs/pt_BR/other.lang | 34 +- htdocs/langs/pt_BR/paypal.lang | 3 + htdocs/langs/pt_BR/products.lang | 42 +- htdocs/langs/pt_BR/projects.lang | 56 +++ htdocs/langs/pt_BR/shop.lang | 1 + htdocs/langs/pt_BR/stocks.lang | 97 +++-- htdocs/langs/pt_BR/users.lang | 103 +++-- htdocs/langs/pt_BR/withdrawals.lang | 49 ++- 32 files changed, 1307 insertions(+), 530 deletions(-) diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index 0bb138efa70..d68455c24a1 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - admin Foundation=Empresa/Instituição -VersionProgram=Versão Programa +VersionProgram=Versão do programa VersionLastInstall=Versão da instalação inicial VersionLastUpgrade=Versão da última atualização SessionId=ID da sessao @@ -33,14 +33,15 @@ IfModuleEnabled=Nota: Sim só é eficaz se o módulo %s estiver ativado RemoveLock=Exclua o arquivo %s se tem permissão da ferramenta de atualização. RestoreLock=Substituir o arquivo %s e apenas dar direito de ler a esse arquivo, a fim de proibir novas atualizações. ErrorModuleRequireDolibarrVersion=Erro, este módulo requer uma versão %s ou superior do ERP -DictionarySetup=Dictionary setup -Dictionary=Dictionaries +DictionarySetup=Configuração Dicionário ErrorReservedTypeSystemSystemAuto=Valores 'system' e 'systemauto' para o tipo é reservado. Você pode usar "usuário" como valor para adicionar seu próprio registro ErrorCodeCantContainZero=Código não pode conter valor 0 DisableJavascript=Desativar as funções Javascript e AJax ConfirmAjax=Utilizar os popups de confirmação Ajax +UseSearchToSelectCompanyTooltip=Além disso, se você tem um grande número de terceiros (> 100 000), você pode aumentar a velocidade, definindo COMPANY_DONOTSEARCH_ANYWHERE constante a 1 em Setup-> Outro. Busca, então, ser limitada até o início da string. UseSearchToSelectCompany=Use campos de completação automática para escolher terceiros em vez de usar uma caixa de listagem. ActivityStateToSelectCompany=Adicionar uma opção de filtro para exibir / ocultar thirdparties que estão atualmente em atividade ou deixou de ativar +UseSearchToSelectContactTooltip=Além disso, se você tem um grande número de terceiros (> 100 000), você pode aumentar a velocidade, definindo CONTACT_DONOTSEARCH_ANYWHERE constante a 1 em Setup-> Outro. Busca, então, ser limitada até o início da string. UseSearchToSelectContact=Use campos de completação automática para escolher de contato (em vez de usar uma caixa de lista). SearchFilter=Opções de filtro para pesquisa NumberOfKeyToSearch=Número de caracteres para iniciar a pesquisa: %s @@ -49,8 +50,10 @@ UsePopupCalendar=Utilizar popups para a introdução das datas UsePreviewTabs=Use guias de visualização ShowPreview=Ver Preview ThemeCurrentlyActive=Tema Atualmente Ativo -CurrentTimeZone=Zona Horária atual +CurrentTimeZone=Fuso horário PHP (servidor) NextValueForInvoices=Próximo Valor (Faturas) +NextValueForDeposit=Próxima valor (depósito) +NextValueForReplacements=Próxima valor (substituições) MustBeLowerThanPHPLimit=Observação: Parâmetros PHP limita o tamanho a %s %s de máximo, qualquer que seja o valor deste parâmetros NoMaxSizeByPHPLimit=Nota: Não há limite definido em sua configuração do PHP UseCaptchaCode=Utilização do Captcha no login @@ -70,19 +73,24 @@ Active=Ativo SetupShort=Configuracao OtherSetup=Outras configuracoes CurrentValueSeparatorThousand=Separador milhar +Destination=Destino +IdModule=Módulo ID +IdPermissions=Permissão ID ModulesCommon=Módulos Principais ModulesInterfaces=Módulos de interface ModulesSpecial=Módulos muito específico ClientTZ=Fuso horário do cliente (usuário). ClientHour=Horário do cliente (usuário) +OSTZ=Fuso horário do sistema operacional do servidor PHPTZ=Fuso horário do servidor PHP PHPServerOffsetWithGreenwich=Offset com Greenwich (segundos) ClientOffsetWithGreenwich=Largura do Browser/Cleinte compesa Greenwich(segundos) DaylingSavingTime=Horário de verão -CurrentHour=PHP Time (servidor) -CompanyTZ=Fuso Horario da empresa(empresa principal) -CompanyHour=Tempo empresa(empresa principal) +CurrentHour=Horário PHP (servidor) +CompanyTZ=Fuso Horário da empresa (empresa principal) +CompanyHour=Horário na empresa (empresa principal) CurrentSessionTimeOut=Tempo limite da sessão atual +YouCanEditPHPTZ=Para definir um fuso horário diferente PHP (não obrigatório), você pode tentar adicionar um arquivo. Htacces com uma linha como esta "SetEnv TZ Europa / Paris" OSEnv=OS Ambiente MaxNbOfLinesForBoxes=Numero de linhas máximo para as caixas PositionByDefault=Posição por padrao @@ -164,6 +172,9 @@ OfficialWebSite=Site oficial do Dolibarr OfficialWebSiteFr=site web oficial falado/escrito em francês OfficialDemo=Demo online ERP OfficialMarketPlace=Loja Oficial para módulos / addons externos +OfficialWebHostingService=Serviços de hospedagem web referenciados (Hospedagem em nuvem) +ReferencedPreferredPartners=Parceiro preferido +OtherResources=Outros recursos ForDocumentationSeeWiki=Para a documentação de usuário, programador ou Perguntas Frequentes (FAQ), consulte o wiki do ERP:
%s ForAnswersSeeForum=Para outras questões ou realizar as suas próprias consultas, pode utilizar o fórum do ERP:
%s HelpCenterDesc1=Esta área permite ajudá-lo a obter um serviço de suporte do ERP. @@ -206,73 +217,93 @@ CurrentVersion=Versão atual do ERP CallUpdatePage=Chamar a página de atualização da estrutura e dados da base de dados %s. LastStableVersion=Ultima Versão estável GenericMaskCodes=Pode introduzir qualquer máscara numérica. Nesta máscara, pode utilizar as seguintes etiquetas:
{000000} corresponde a um número que se incrementa em cada um de %s. Introduza tantos zeros como longitude que deseje mostrar. O contador completarse-á a partir de zeros pela esquerda com o fim de ter tantos zeros como a máscara.
{000000+000} Igual que o anterior, com uma compensação correspondente ao número da direita do sinal + aplica-se a partir do primeiro %s.
{000000@x} igual que o anterior, mas o contador restabelece-se a zero quando se chega a x meses (x entre 1 e 12). Se esta opção se utiliza e x é de 2 ou superior, então a seq�ência {yy}{mm} ou {yyyy}{mm} também é necessário.
{dd} dias (01 a 31).
{mm} mês (01 a 12).
{yy}, {yyyy} ou {e} ano em 2, 4 ou 1 figura.
+GenericMaskCodes2=O código do cliente no caracteres Cccc000
o código do cliente em caracteres n é seguido por um contador dedicado para o cliente. Este contador dedicado ao cliente é reposto ao mesmo tempo do que o contador global. O código do tipo de empresa em n caracteres (ver tipos dicionário da empresa). GenericMaskCodes3=qualquer outro caracter0 na máscara se fica sem alterações.
Não é permitido espaços
GenericMaskCodes4a=Exemplo em 99 � %s o Fornecedor a Empresa realizada em 31/03/2007:
GenericMaskCodes4b=Exemplo sobre um Fornecedor criado em 31/03/2007:
+GenericMaskCodes4c=Exemplo de produto criado em 2007-03-01:
+GenericMaskCodes5=ABC {yy} {mm} - {000000} dará ABC0701-000099
{0000 100 @ 1}-ZZZ / dd {} / XXX dará 0199-ZZZ/31/XXX GenericNumRefModelDesc=Devolve um número criado na linha em uma máscara definida. ServerAvailableOnIPOrPort=Servidor disponível não endereço %s na porta %s ServerNotAvailableOnIPOrPort=Servidor não disponível não endereço %s na Porta %s DoTestSend=Teste envio DoTestSendHTML=Teste envio HTML +ErrorCantUseRazIfNoYearInMask=Erro, não pode usar a opção para redefinir @ contador a cada ano se sequência {yy} ou {aaaa} não está na máscara. ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Erro, não se pode usar opção @ se a seq�ência {yy}{mm} ou {yyyy}{mm} não se encontra a máscara. UMask=Parâmetro UMask de novos arquivos em Unix/Linux/BSD. UMaskExplanation=Este parâmetro determina os direitos dos arquivos criados não servidor do ERP (durante o carregamento, por Exemplo).
Este deve ter o valor octal (por Exemplo, 0666 significa leitura / escrita para todos).
Este parâmetro não tem nenhum efeito sobre um servidor Windows. SeeWikiForAllTeam=Veja o wiki para mais detalhes de todos os autores e da sua organização -UseACacheDelay=Delay for caching export response in seconds (0 or empty for no cache) -DisableLinkToHelpCenter=Hide link "Need help or support" on login page -DisableLinkToHelp=Hide link "%s Online help" on left menu -AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on documents because too long, you must add yourself carriage returns in the textarea. +UseACacheDelay=Atraso para a resposta cache em segundos (0 ou vazio para nenhum cache) +DisableLinkToHelpCenter=Esconde link Precisa ajuda ou suporte " na página de login +DisableLinkToHelp=Esconde link "%s Ajuda online " no menu esquerdo +AddCRIfTooLong=Não há envolvimento automático, por isso, se linha está fora da página em documentos, porque por muito tempo, você deve adicionar-se os retornos de carro no testar área. ModuleDisabled=Módulo desabilitado ModuleDisabledSoNoEvent=Módulo desabilitado, portanto, o evento não será criado. -ConfirmPurge=Are you sure you want to execute this purge ?
This will delete definitely all your data files with no way to restore them (ECM files, attached files...). +ConfirmPurge=Você tem certeza que quer executar esta limpeza?
Isso deletará definitivamente todos os seus arquivos sem meios para restaurá-los (arquivo ECM, arquivos anexados) MinLength=Tamanho mínimo -LanguageFilesCachedIntoShmopSharedMemory=Files .lang loaded in shared memory -ExamplesWithCurrentSetup=Examples with current running setup -ListOfDirectories=List of OpenDocument templates directories -ListOfDirectoriesForModelGenODT=List of directories containing templates files with OpenDocument format.

Put here full path of directories.
Add a carriage return between eah directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt. -ExampleOfDirectoriesForModelGen=Examples of syntax:
c:\\mydir
/home/mydir
DOL_DATA_ROOT/ecm/ecmdir -FollowingSubstitutionKeysCanBeUsed=
To know how to create your odt document templates, before storing them in those directories, read wiki documentation: -FirstnameNamePosition=Position of Name/Lastname -DescWeather=The following pictures will be shown on dashboard when number of late actions reach the following values: -KeyForWebServicesAccess=Key to use Web Services (parameter "dolibarrkey" in webservices) -TestSubmitForm=Input test form -ThisForceAlsoTheme=Using this menu manager will also use its own theme whatever is user choice. Also this menu manager specialized for smartphones does not works on all smartphone. Use another menu manager if you experience problems on yours. +LanguageFilesCachedIntoShmopSharedMemory=Arquivos .lang transferidos na memória compartilhada +ExamplesWithCurrentSetup=Exemplos com a configuração atual em execução +ListOfDirectories=Lista de OpenDocument de modelos de diretórios +ListOfDirectoriesForModelGenODT=Lista de diretórios contendo modelos de arquivos com formato OpenDocument.

Coloque aqui o caminho completo do diretório.
Adicione um procedimento de retorno entre cada diretório.
Para adicionar um diretório de módulo GED, adicione aqui DOL_DATA_ROOT/ecm/yourdirectoryname.

Arquivos neste diretório devem ter final .odt. +NumberOfModelFilesFound=Números de arquivos de modelos ODT/ODS encontrados neste diretório +ExampleOfDirectoriesForModelGen=Exemplos de sintaxe:
c:\\mydir
/home/mydir
DOL_DATA_ROOT/ecm/ecmdir +FollowingSubstitutionKeysCanBeUsed=Para saber como criar seu documento seu modelo de documento odt, antes de armazená-lo naquele diretório, leia a documentação wiki +FirstnameNamePosition=Posição do Nome/Sobrenome +DescWeather=As imagens a seguir será mostrado no painel quando o número de ações final atingir os seguintes valores: +KeyForWebServicesAccess=A chave para usar Web Services (parâmetro "dolibarrkey" em webservices) +TestSubmitForm=Formulário teste de entrada +ThisForceAlsoTheme=Usando este gestor de menu também utilizará seu próprio tema independente da escolha do usuário. Este gestor de menu também é especializado para smartphones que não funcionam em todos smartphones. Use outro gestor de menu se você encontrar problemas no seu. ThemeDir=Diretório de Skins ConnectionTimeout=Tempo de conexão esgotado ResponseTimeout=Tempo de resposta esgotado -SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__ -ModuleMustBeEnabledFirst=Module %s must be enabled first before using this feature. +SmsTestMessage=Mensagem de teste a partir de __ para __ PHONEFROM__ PHONETO__ +ModuleMustBeEnabledFirst=Módulo deve ser ativado antes de usar este recurso. SecurityToken=Chave para URLs seguras -NoSmsEngine=No SMS sender manager available. SMS sender manager are not installed with default distribution (because they depends on an external supplier) but you can find some on %s -PDFDesc=You can set each global options related to the PDF generation -PDFAddressForging=Rules to forge address boxes -HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF -HideDescOnPDF=Hide products description on generated PDF -HideRefOnPDF=Hide products ref. on generated PDF -UrlGenerationParameters=Parameters to secure URLs -SecurityTokenIsUnique=Use a unique securekey parameter for each URL -EnterRefToBuildUrl=Enter reference for object %s -GetSecuredUrl=Get calculated URL -ButtonHideUnauthorized=Hide buttons for unauthorized actions instead of showing disabled buttons -OldVATRates=Old VAT rate -NewVATRates=New VAT rate -TextLong=Long text -Int=Integer -Float=Float -DateAndTime=Date and hour -Unique=Unique -Boolean=Boolean (Checkbox) -ExtrafieldSelect =Select list -ExtrafieldSelectList =Select from table -ExtrafieldSeparator=Separator -ExtrafieldCheckBox=Checkbox -ExtrafieldRadio=Radio button -LibraryToBuildPDF=Library used to build PDF +NoSmsEngine=No SMS gerente disponível remetente. Gerente de SMS do remetente não são instalados com a distribuição padrão (porque depende de um fornecedor externo), mas você pode encontrar em alguns. +PDFDesc=Você pode definir cada uma das opções globais relacionadas com a geração de PDF +PDFAddressForging=Regras de estabelecimento de caixas de endereço +HideAnyVATInformationOnPDF=Esconder todas as informações relativas ao IVA em PDF gerados +HideDescOnPDF=Esconder descrição dos produtos em PDF gerados +HideRefOnPDF=Esconder ref. dos produtos em PDF gerados +HideDetailsOnPDF=Ocultar artigos linhas detalhes sobre PDF gerado +UrlGenerationParameters=Parâmetros para proteger URLs +SecurityTokenIsUnique=Use um parâmetro SecureKey exclusivo para cada URL +EnterRefToBuildUrl=Digite referência para o objeto +GetSecuredUrl=Obter URL calculado +ButtonHideUnauthorized=Ocultar botões para ações não autorizadas em vez de mostrar os botões com deficiência +OldVATRates=Taxa de VAt anterior +NewVATRates=Nova taxa do VAT +PriceBaseTypeToChange=Modificar sobre os preços com valor de referência de base definida em +MassConvert=Inicie a conversão em massa +Float=Flutuar +Boolean=Booleano (Caixa de seleção) +ExtrafieldSelect =Selecionar lista +ExtrafieldSelectList =Selecione da tabela +ExtrafieldCheckBox=Caixa de seleção +ExtrafieldRadio=Botão de opção +ExtrafieldParamHelpselect=Lista de parâmetros tem que ser como chave, valor por exemplo: 1, valor1 2, valor2 < 3, value3 ... A fim de ter a lista dependendo outro: 1, valor1 | parent_list_code: parent_key 2, valor2 | parent_list_code: parent_key +ExtrafieldParamHelpcheckbox=Lista de parâmetros tem que ser como chave, valor

por exemplo:
1, valor1
2, valor2
3, value3
... +ExtrafieldParamHelpradio=Lista de parâmetros tem que ser como chave, valor por exemplo: 1, valor 2, valor2 1 3, value3 ... +ExtrafieldParamHelpsellist=Lista Parâmetros vem de uma tabela
Sintaxe: table_name: label_field: id_field :: filtro
Exemplo: c_typent: libelle: id :: filtro

filtro pode ser um teste simples (por exemplo, ativo = 1) para exibir apenas o valor ativo
se você deseja filtrar extrafields usar syntaxt extra.fieldcode = ... (onde código de campo é o código de extrafield)

A fim de ter a lista dependendo outro:
c_typent: libelle: id: parent_list_code | parent_column: Filtro +LibraryToBuildPDF=Biblioteca utilizada para criar o PDF +WarningUsingFPDF=Atenção: Seu conf.php contém dolibarr_pdf_force_fpdf directiva = 1. Isto significa que você usar a biblioteca FPDF para gerar arquivos PDF. Esta biblioteca é velho e não suporta um monte de recursos (Unicode, a transparência da imagem, cirílicos, árabes e asiáticos, ...), por isso podem ocorrer erros durante a geração de PDF.
Para resolver isso e ter um apoio total de geração de PDF, faça o download da biblioteca TCPDF , em seguida, comentar ou remover a linha $ dolibarr_pdf_force_fpdf = 1, e adicione ao invés $ dolibarr_lib_TCPDF_PATH = 'path_to_TCPDF_dir' +LocalTaxDesc=Alguns países aplicam 2 ou 3 impostos sobre cada linha de nota fiscal. Se este for o caso, escolha o tipo de segundo e terceiro imposto e sua taxa. Tipos possíveis são:
1: impostos locais, aplicar sobre produtos e serviços, sem IVA (IVA não é aplicado sobre o imposto local)
2: impostos locais, aplicar sobre produtos e serviços antes de IVA (IVA é calculado sobre o montante + localtax)
3: impostos locais, aplicar em produtos sem IVA (IVA não é aplicado sobre o imposto local)
4: impostos locais, aplicadas aos produtos antes de IVA (IVA é calculado sobre o montante + localtax)
5: impostos locais, aplicar em serviços sem IVA (IVA não é aplicado sobre o imposto local)
6: impostos locais, aplicar em serviços antes de IVA (IVA é calculado sobre o montante + localtax) SMS=Mensagem de texto -RefreshPhoneLink=Refresh link -KeepEmptyToUseDefault=Keep empty to use default value -DefaultLink=Default link -CurrentlyNWithoutBarCode=Currently, you have %s records on %s %s without barcode defined. +LinkToTestClickToDial=Digite um número de telefone para ligar para mostrar um link para testar a url ClickToDial para o usuário% s +LinkToTest=Link clicável gerado para o usuário% s (clique número de telefone para testar) +KeepEmptyToUseDefault=Manter em branco para usar o valor padrão +DefaultLink=Link padrão +ValueOverwrittenByUserSetup=Atenção, este valor pode ser substituído por configuração específica do usuário (cada usuário pode definir sua própria url de clicktodial) +ExternalModule=Módulo externo - Instalado no diretório +BarcodeInitForThirdparties=Inicialização de código de barras em massa para clientes +BarcodeInitForProductsOrServices=Inicialização de código de barras em massa ou redefinir de produtos ou serviços +CurrentlyNWithoutBarCode=Atualmente, você tem registros% s em% s% s, sem código de barras definido. +InitEmptyBarCode=Valor Init para o próximo registros vazios +EraseAllCurrentBarCode=Apague todos os valores de código de barras atuais +ConfirmEraseAllCurrentBarCode=Tem certeza de que deseja apagar todos os valores de código de barras atuais? +AllBarcodeReset=Todos os valores de código de barras foram removidas +NoBarcodeNumberingTemplateDefined=Nenhum modelo de numeração de código de barras habilitado para configuração do módulo de código de barras. +NoRecordWithoutBarcodeDefined=Sem registro, sem valor de código de barras definido. Module0Name=Usuários e Grupos Module0Desc=Administração de Usuários e Grupos Module1Name=Fornecedores @@ -281,16 +312,15 @@ Module2Desc=Administração comercial Module10Desc=Administração simples da Contabilidade (repartição das receitas e pagamentos) Module20Desc=Administração de Orçamentos/Propostas comerciais Module22Desc=Administração e envio de E-Mails massivos -Module23Name=Energy -Module23Desc=Monitoring the consumption of energies +Module23Desc=Acompanhamento do consumo de energias Module25Desc=Administração de pedidos de clientes Module30Name=Faturas e Recibos Module30Desc=Administração de faturas e recibos de clientes. Administração de faturas de Fornecedores Module40Desc=Administração de Fornecedores Module49Desc=Administração de Editores Module50Desc=Administração de produtos -Module51Name=Mass mailings -Module51Desc=Mass paper mailing management +Module51Name=Correspondência em massa +Module51Desc=Gestão de correspondência do massa Module52Name=Estoques de produtos Module52Desc=Administração de estoques de produtos Module53Desc=Administração de serviços @@ -307,56 +337,64 @@ Module75Name=Notas de despesas e deslocamentos Module75Desc=Administração das notas de despesas e deslocamentos Module80Desc=Administração de Expedições e Recepções Module85Desc=Administração das contas financeiras de tipo contas bancarias, postais o efetivo -Module100Name=External site -Module100Desc=This module include an external web site or page into Dolibarr menus and view it into a Dolibarr frame -Module105Name=Mailman and SPIP -Module105Desc=Mailman or SPIP interface for member module +Module100Name=Site externo +Module100Desc=Este módulo inclui um web site ou página externa em menus Dolibarr e vê-lo em um quadro Dolibarr +Module105Name=Mailman e SPIP +Module105Desc=Mailman ou interface SPIP para o módulo membro Module200Desc=sincronização com um anuário LDAP Module310Desc=Administração de Membros de uma associação Module330Desc=Administração de Favoritos Module400Name=Projetos Module400Desc=Administração dos projetos nos outros módulos Module410Desc=Interface com calendário Webcalendar -Module510Name=Salaries +Module500Name=Despesas especiais (impostos, contribuições sociais, dividendos) +Module500Desc=Gestão de despesas especiais, como impostos, contribuição social, dividendos e salários +Module510Desc=Gestão de funcionários salários e pagamentos Module600Desc=Envio de Notificações (por correio eletrônico) sobre os eventos de trabalho Dolibarr Module700Desc=Administração de Bolsas Module800Desc=Interface de visualização de uma loja OSCommerce mediante acesso direto à sua base de dados Module900Desc=Interface de visualização de uma loja OSCommerce mediante Web services.\nEste módulo requer instalar os arquivos de /oscommerce_ws/ws_server em OSCommerce. Leia o Arquivo README da pasta /oscommerce_ws/ws_server. Module1200Desc=Interface com o sistema de seguimento de incidências Mantis -Module1400Name=Accounting -Module1400Desc=Accounting management (double parties) +Module1400Name=Contabilidade +Module1400Desc=Gestão de Contabilidade (partes duplas) Module1780Name=Categorias Module1780Desc=Administração de categorias (produtos, Fornecedores e clientes) -Module2000Name=WYSIWYG editor -Module2000Desc=Allow to edit some text area using an advanced editor +Module2000Name=Editor WYSIWYG +Module2000Desc=Permitir editar alguma área de texto usando um editor avançado Module2300Desc=Gerenciamento de tarefas agendadas Module2400Desc=Administração da agenda e das ações Module2500Name=Administração Eletrônica de Documentos Module2600Name=Webservices -Module2600Desc=Enable the Dolibarr web services server -Module2700Desc=Use online Gravatar service (www.gravatar.com) to show photo of users/members (found with their emails). Need an internet access +Module2600Desc=Ativar o servidor de serviços web Dolibarr +Module2700Name=Sobrescrito +Module2700Desc=Usar o serviço on-line Gravatar (www.gravatar.com) para mostrar fotos de usuários / membros (que se encontra com os seus e-mails). Precisa de um acesso à Internet Module2800Desc=Cliente de FTP -Module2900Desc=GeoIP Maxmind conversions capabilities +Module2900Desc=GeoIP Maxmind conversões capacidades +Module3100Desc=Adicionar um botão do Skype no cartão de adeptos / terceiros / contatos Module5000Name=Multi-Empresa Module5000Desc=Permite-lhe gerenciar várias empresas -Module6000Name=Workflow -Module6000Desc=Workflow management +Module6000Desc=Gestão de fluxo de trabalho Module20000Name=Ferias +Module20000Desc=Declare e siga funcionários de férias Module50000Name=PayBox -Module50000Desc=Module to offer an online payment page by credit card with PayBox +Module50000Desc=Módulo para oferecer uma página de pagamento on-line por cartão de crédito com PayBox Module50100Desc=Caixa registradora -Module50200Desc=Module to offer an online payment page by credit card with Paypal +Module50200Desc=Módulo para oferecer uma página de pagamento on-line por cartão de crédito com Paypal +Module54000Desc=Imprimir via Cups IPP Impressora. +Module55000Name=Abrir Enquete +Module55000Desc=Módulo para fazer pesquisas on-line (como Doodle, Studs, Rdvz ...) Module59000Name=Margems -Module59000Desc=Module to manage margins +Module59000Desc=Módulo para gerenciar as margens Module60000Desc=Módulo para gerenciar comissões +Module150010Name=Número do lote, de comer por data e data de validade +Module150010Desc=Número do lote, prazo de validade de venda gestão de data para o produto Permission11=Consultar faturas Permission12=Criar/Modificar faturas -Permission13=Unvalidate customer invoices +Permission13=Faturas de clientes Unvalidate Permission14=Confirmar faturas Permission15=Enviar faturas por correio Permission16=Emitir pagamentos de faturas Permission19=Eliminar faturas -Permission28=Export commercial proposals Permission41=Consultar projetos Permission42=Criar/Modificar projetos Permission44=Eliminar projetos @@ -365,31 +403,33 @@ Permission92=Criar/Modificar Impostos e ICMS Permission93=Eliminar Impostos e ICMS Permission97=Ler linhas de faturas Permission98=Repartir linhas de faturas +Permission106=Envios de exportação Permission112=Criar/Modificar quantidade/eliminar registros bancários Permission113=Configurar contas financeiras (criar, controlar as categorias) Permission114=Exportar transações e registros bancários Permission115=Exportar transações e extratos Permission116=Captar transferências entre contas Permission117=Gerenciar envio de cheques -Permission141=Read projects (also private i am not contact for) -Permission142=Create/modify projects (also private i am not contact for) -Permission144=Delete projects (also private i am not contact for) +Permission141=Leia projetos (também privado não estou em contato para) +Permission142=Criar / modificar projetos (também privado não estou em contato para) +Permission144=Excluir projetos (também privado não estou em contato para) Permission146=Consultar Prestadores Permission151=Consultar Débitos Diretos Permission152=Configurar Débitos Diretos Permission153=Consultar Débitos Diretos -Permission154=Credit/refuse standing orders receipts +Permission154=Crédito / recusar ordens permanentes recibos Permission163=Ativar os serviços de um contrato Permission164=Desativar os serviços de um contrato Permission171=Criar/Modificar Deslocamento Permission172=Eliminar Deslocamento -Permission173=Delete trips +Permission173=apagar viagens Permission178=Exportar Deslocamento Permission194=Consultar Linhas da Lagura de Banda Permission205=Gerenciar Ligações Permission213=Ativar Linha Permission222=Criar/Modificar E-Mails (assunto, destinatários, etc.) Permission223=Confirmar E-Mails (permite o envio) +Permission237=Exibir os destinatários e as informações Permission238=Envio manual de e-mails Permission239=Deletar e-mail após o envio Permission241=Consultar categorias @@ -397,7 +437,6 @@ Permission242=Criar/Modificar categorias Permission243=Eliminar categorias Permission244=Ver conteúdo de categorias ocultas Permission251=Consultar Outros Usuário, grupos e permissões -PermissionAdvanced251=Read other users Permission252=Criar/Modificar outros usuário, grupos e permissões Permission253=Modificar a senha de outros usuário PermissionAdvanced253=Criar ou modificar usuários internos ou externos e suas permissões @@ -424,6 +463,10 @@ Permission401=Consultar ativos Permission402=Criar/Modificar ativos Permission403=Confirmar ativos Permission404=Eliminar ativos +Permission510=Leia Salários +Permission512=Criar / modificar salários +Permission514=Excluir salários +Permission517=Salários de exportação Permission532=Criar ou modificar serviços Permission534=Excluir serviços Permission536=Visualizar ou gerenciar serviços ocultos @@ -444,9 +487,10 @@ Permission1231=Consultar faturas de Fornecedores Permission1232=Criar faturas de Fornecedores Permission1233=Confirmar faturas de Fornecedores Permission1234=Eliminar faturas de Fornecedores -Permission1235=Send supplier invoices by email +Permission1235=Enviar por e-mail faturas de fornecedores Permission1236=Exportar faturas de Fornecedores, atributos e pagamentos -Permission1251=Run mass imports of external data into database (data load) +Permission1237=Pedidos a fornecedores Export e seus detalhes +Permission1251=Execute as importações em massa de dados externos para o banco de dados (carga de dados) Permission1321=Exportar faturas a clientes, atributos e cobranças Permission1421=Exportar faturas de clientes e atributos Permission23001 =Ler tarefa agendada @@ -455,32 +499,41 @@ Permission23003 =Apagar tarefa agendada Permission2401=Ler ações (eventos ou tarefas) vinculadas na sua conta Permission2402=Criar/Modificar/Eliminar ações (eventos ou tarefas) vinculadas na sua conta Permission2403=Consultar ações (acontecimientos ou tarefas) de outros -Permission2411=Read actions (events or tasks) of others -Permission2412=Create/modify actions (events or tasks) of others -Permission2413=Delete actions (events or tasks) of others +Permission2411=Leia ações (eventos ou tarefas) de outros +Permission2412=Criar / modificar ações (eventos ou tarefas) de outros +Permission2413=Excluir ações (eventos ou tarefas) de outros Permission2501=Enviar ou eliminar documentos Permission2502=Baixar documentos Permission2515=Configuração de diretorios de documentos -Permission2801=Use FTP client in read mode (browse and download only) -Permission2802=Use FTP client in write mode (delete or upload files) -Permission50101=Use Point of sales -Permission50201=Read transactions -Permission50202=Import transactions -Permission54001=Print -DictionaryCompanyType=Thirdparties type -DictionaryRegion=Regions -DictionaryCountry=Countries -DictionaryCurrency=Currencies -DictionaryPaymentConditions=Payment terms -DictionaryPaymentModes=Payment modes -DictionaryTypeContact=Contact/Address types -DictionaryPaperFormat=Paper formats -DictionaryFees=Type of fees -DictionarySendingMethods=Shipping methods -DictionaryStaff=Staff -DictionaryAvailability=Delivery delay -DictionaryOrderMethods=Ordering methods -DictionarySource=Origin of proposals/orders +Permission2801=Use cliente FTP em modo de leitura (navegar e baixar apenas) +Permission2802=Use o cliente FTP no modo de escrita (apagar ou fazer upload de arquivos) +Permission50101=Usar ponto de vendas +Permission50202=Importar transacções +Permission54001=Impressão +Permission55001=Leia urnas +Permission55002=Criar / modificar urnas +Permission59001=Leia margens comerciais +Permission59002=Definir margens comerciais +DictionaryCompanyType=Tipo de clientes +DictionaryCompanyJuridicalType=Tipos jurídicos de thirdparties +DictionaryProspectLevel=Nível potencial Prospect +DictionaryCanton=Estado / cantões +DictionaryCivility=Título Civilidade +DictionaryActions=Tipo de eventos da agenda +DictionarySocialContributions=Contribuições Sociais tipos +DictionaryVAT=Taxas de VAT ou imposto sobre vendas de moeda +DictionaryRevenueStamp=Quantidade de selos fiscais +DictionaryPaymentConditions=As condições de pagamento +DictionaryPaymentModes=Modos de pagamento +DictionaryTypeContact=Tipos Contato / Endereço +DictionaryEcotaxe=Ecotaxa (REEE) +DictionaryPaperFormat=Formatos de papel +DictionarySendingMethods=Métodos do transporte +DictionaryStaff=Pessoal +DictionaryOrderMethods=Métodos de compra +DictionarySource=Origem das propostas / ordens +DictionaryAccountancyplan=Plano de contas +DictionaryAccountancysystem=Modelos para o plano de contas SetupSaved=configuração guardada BackToDictionaryList=Voltar para a lista de dicionários VATReceivedOnly=Impostos especiais não faturaveis @@ -489,27 +542,36 @@ VATIsUsedDesc=o tipo de ICMS proposto por default em criações de Orçamentos, VATIsNotUsedDesc=o tipo de ICMS proposto por default é 0. Este é o caso de associações, particulares o algunas pequenhas sociedades. VATIsUsedExampleFR=em Francia, se trata das sociedades u organismos que eligen um regime fiscal general (General simplificado o General normal), regime ao qual se declara o ICMS. VATIsNotUsedExampleFR=em Francia, se trata de associações exentas de ICMS o sociedades, organismos o profesiones liberales que han eligedo o regime fiscal de módulos (ICMS em franquicia), pagando um ICMS em franquicia sem fazer declaração de ICMS. Esta elecção hace aparecer a anotação "IVA não aplicable - art-293B do CGI" em faturas. -LocalTax1ManagementES=RE Management -LocalTax1IsUsedDescES=The RE rate by default when creating prospects, invoices, orders etc follow the active standard rule:
If te buyer is not subjected to RE, RE by default=0. End of rule.
If the buyer is subjected to RE then the RE by default. End of rule.
-LocalTax1IsNotUsedDescES=By default the proposed RE is 0. End of rule. -LocalTax1IsUsedExampleES=In Spain they are professionals subject to some specific sections of the Spanish IAE. -LocalTax1IsNotUsedExampleES=In Spain they are professional and societies and subject to certain sections of the Spanish IAE. -LocalTax2ManagementES=IRPF Management -LocalTax2IsUsedDescES=The RE rate by default when creating prospects, invoices, orders etc follow the active standard rule:
If the seller is not subjected to IRPF, then IRPF by default=0. End of rule.
If the seller is subjected to IRPF then the IRPF by default. End of rule.
-LocalTax2IsNotUsedDescES=By default the proposed IRPF is 0. End of rule. -LocalTax2IsUsedExampleES=In Spain, freelancers and independent professionals who provide services and companies who have chosen the tax system of modules. -LocalTax2IsNotUsedExampleES=In Spain they are bussines not subject to tax system of modules. +LocalTax1IsUsed=Utilize segundo imposto +LocalTax1IsNotUsed=Não use o segundo imposto +LocalTax1IsUsedDesc=Use um segundo tipo de impostos (excepto o IVA) +LocalTax1IsNotUsedDesc=Não use outro tipo de impostos (excepto o IVA) +LocalTax1Management=Segundo tipo de imposto +LocalTax2IsUsed=Use terceiro imposto +LocalTax2IsNotUsed=Não use terceiro imposto +LocalTax2IsUsedDesc=Use um terceiro tipo de impostos (excepto o VAT) +LocalTax2IsNotUsedDesc=Não use outro tipo de impostos (excepto o VAT) +LocalTax2Management=Terceiro tipo de imposto +LocalTax1IsUsedDescES=A taxa de RE por padrão ao criar perspectivas, notas fiscais, ordens etc seguir a regra padrão ativo:
Se te comprador não está sujeito a RE, RP por default = 0. Fim da regra.
Se o comprador está sujeito a RE então o RE por padrão. Fim da regra.
+LocalTax1IsUsedExampleES=Na Espanha, eles são profissionais sujeitos a algumas seções específicas do IAE espanhol. +LocalTax1IsNotUsedExampleES=Na Espanha, eles são profissionais e sociedades e sujeito a determinadas seções do IAE espanhol. +LocalTax2ManagementES=Gestão IRPF +LocalTax2IsUsedDescES=A taxa de RE por padrão ao criar perspectivas, notas fiscais, ordens etc seguir a regra padrão ativo:
Se o vendedor não está sujeito a IRPF, então IRPF por default = 0. Fim da regra.
Se o vendedor é submetido a IRPF, em seguida, o IRPF por padrão. Fim da regra.
+LocalTax2IsNotUsedDescES=Por padrão, o IRPF proposta é 0. Fim da regra. +LocalTax2IsUsedExampleES=Na Espanha, freelancers e profissionais independentes que prestam serviços e empresas que escolheram o sistema fiscal de módulos. +LocalTax2IsNotUsedExampleES=Na Espanha, eles são bussines não sujeitas ao regime fiscal dos módulos. NbOfDays=N� de Dias AlwaysActive=Sempre Ativo UpdateRequired=Parâmetros sistema necessita de uma atualização. Para atualizar click em Módulos
é indispensável já que Dolibarr não é um ERP/CRM monolítico, é um conjunto de módulos mais ou menos independente. Depois de ativar os módulos que lhe interessem verificar as suas funcionalidades nos menus de Dolibarr. -SetupDescription5=Other menu entries manage optional parameters. +SetupDescription5=Outros itens do menu gerenciar parâmetros opcionais. InfoDolibarr=Infos Dolibarr InfoOS=Informações do sistema operacional InfoWebServer=Informações do Web Server @@ -555,7 +626,7 @@ InfoDatabase=Informações da base de dados InfoPHP=Informações do PHP InfoPerf=Infos performances ListOfSecurityEvents=Listado de eventos de segurança Dolibarr -SecurityEventsPurged=Security events purged +SecurityEventsPurged=Os eventos de segurança expurgados LogEventDesc=Pode ativar o registo de eventos de segurança Dolibarr aqui. os administradores podem ver o seu conteúdo a travé de menu ferramentas do sistema - Auditoria.Atenção, esta característica pode consumir uma gran quantidade de dados na base de dados. AreaForAdminOnly=Estas funções só são acessíveis a um Usuário administrador. a função de administrador e as ajudas para os administradores são definidas em Dolibarr por o seguinte símbolo: SystemInfoDesc=Esta informação do sistema é informação técnica acessíveis só de leitura a aos administradores. @@ -564,6 +635,7 @@ CompanyFundationDesc=Editar nesta página toda a informação conhecida sobre a DisplayDesc=pode encontrar aqui todos os parâmetros relacionados com a aparência de Dolibarr AvailableModules=Módulos disponíveis ToActivateModule=Para ativar os módulos, ir à área de configuração. +SessionTimeOut=Tempo Esgotado para a sessão SessionExplanation=Asegura que o período de sessões não expirará antes deste momento. sem embargo, a Administração do período de sessões de PHP não garantiza que o período de sessões expira depois deste período: Este será o caso sim um sistema de limpieza do caché de sessões é ativo.
Nota: sem mecanismo especial, o mecanismo interno para limpiar o período de sessões de PHP todos os acessos %s/%s, mas só em torno à acesso de Outros períodos de sessões. TriggersAvailable=Triggers disponíveis TriggersDesc=os triggers são Arquivos que, une vez depositados na pasta htdocs/core/triggers, modifican o comportamento do workflow de Dolibarr. Realizan ações suplementarias, desencadenadas por os eventos Dolibarr (criação de empresa, validação fatura, fechar contrato, etc). @@ -572,6 +644,7 @@ TriggerDisabledAsModuleDisabled=Triggers deste Arquivo desativados já que o mó TriggerAlwaysActive=Triggers deste Arquivo sempre ativos, já que os módulos Dolibarr relacionados estão ativados TriggerActiveAsModuleActive=Triggers deste Arquivo ativos já que o módulo %s está ativado GeneratedPasswordDesc=Indique aqui que norma quer utilizar para Gerar as Senhas quando queira Gerar uma Nova senha +DictionaryDesc=Defina aqui todas datas de referência. Você pode completar o valor pré-definido com o seu. ConstDesc=qualquer outro parâmetro não editável em páginas anteriores OnceSetupFinishedCreateUsers=Atenção, está baixo de uma conta de administrador de Dolibarr. os administradores se utilizam para configurar a Dolibarr. Para um uso corrente de Dolibarr, recomenda-se utilizar uma conta não administrador criada a partir do menu "Usuários e grupos" MiscellaneousDesc=Defina aqui os Outros parâmetros relacionados com a segurança. @@ -581,9 +654,9 @@ MAIN_MAX_DECIMALS_UNIT=Casas decimais máximas para os preços unitários MAIN_MAX_DECIMALS_TOT=Casas decimais máximas para os preços totais MAIN_MAX_DECIMALS_SHOWN=Casas decimais máximas para os valores mostrados em janela (Colocar ... depois do máximo quer ver ... quando o número se trunque à mostrar em janela) MAIN_DISABLE_PDF_COMPRESSION=Utilizar a compressão PDF para os Arquivos PDF gerados -MAIN_ROUNDING_RULE_TOT=Size of rounding range (for rare countries where rounding is done on something else than base 10) -UnitPriceOfProduct=Net unit price of a product -TotalPriceAfterRounding=Total price (net/vat/incl tax) after rounding +MAIN_ROUNDING_RULE_TOT=Tamanho da faixa de arredondamento (para os países raros em que o arredondamento é feito em outra coisa do que base 10) +UnitPriceOfProduct=Preço líquido unitário de um produto +TotalPriceAfterRounding=Preço total (imposto net / cuba / manhã) após arredondamento ParameterActiveForNextInputOnly=parâmetro efetivo somente a partir das próximas sessões NoEventOrNoAuditSetup=não são registrado eventos de segurança. Esto pode ser normal sim a auditoría não ha sido habilitado na página "configuração->segurança->auditoría". NoEventFoundWithCriteria=não são encontrado eventos de segurança para tais criterios de pesquisa. @@ -592,57 +665,64 @@ BackupDesc2=* Guardar o conteúdo da pasta de documentos (%s) que contém BackupDesc3=* Guardar o conteúdo de a sua base de dados em um Arquivo de despejo. Para ele pode utilizar o assistente a continuação. BackupDescX=O Arquivo gerado deverá localizar-se em um lugar seguro. BackupDescY=O arquivo gerado devevrá ser colocado em local seguro. +BackupPHPWarning=Backup não pode ser garantida com este método. Prefere uma anterior RestoreDesc=Para restaurar uma Cópia de segurança de Dolibarr, voçê deve: RestoreDesc2=* Tomar o Arquivo (Arquivo zip, por Exemplo) da pasta dos documentos e Descompactá-lo na pasta dos documentos de uma Nova Instalação de Dolibarr diretorio o na pasta dos documentos desta Instalação (%s). RestoreDesc3=* Recargar o Arquivo de despejo guardado na base de dados de uma Nova Instalação de Dolibarr o desta Instalação. Atenção, uma vez realizada a Restaurar, deverá utilizar um login/senha de administrador existente ao momento da Cópia de segurança para conectarse. Para restaurar a base de dados na Instalação atual, pode utilizar o assistente a continuação. -RestoreMySQL=MySQL import -ForcedToByAModule=This rule is forced to %s by an activated module -PreviousDumpFiles=Available database backup dump files -WeekStartOnDay=First day of week -RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be required (Programs version %s differs from database version %s) -YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user %s or you must add -W option at end of command line to provide %s password. -YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP -DownloadMoreSkins=More skins to download -SimpleNumRefModelDesc=Returns the reference number with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence without hole and with no reset -ShowProfIdInAddress=Show professionnal id with addresses on documents -TranslationUncomplete=Partial translation -MenuUseLayout=Make vertical menu hidable (option javascript must not be disabled) -MAIN_DISABLE_METEO=Disable meteo view -TestLoginToAPI=Test login to API -ProxyDesc=Some features of Dolibarr need to have an Internet access to work. Define here parameters for this. If the Dolibarr server is behind a Proxy server, those parameters tells Dolibarr how to access Internet through it. -ExternalAccess=External access -MAIN_PROXY_USE=Use a proxy server (otherwise direct access to internet) -MAIN_PROXY_HOST=Name/Address of proxy server -MAIN_PROXY_PORT=Port of proxy server -MAIN_PROXY_USER=Login to use the proxy server -MAIN_PROXY_PASS=Password to use the proxy server -DefineHereComplementaryAttributes=Define here all attributes, not already available by default, and that you want to be supported for %s. -ExtraFields=Complementary attributes -ExtraFieldsLines=Complementary attributes (lines) -ExtraFieldsThirdParties=Complementary attributes (thirdparty) -ExtraFieldsContacts=Complementary attributes (contact/address) -ExtraFieldsMember=Complementary attributes (member) -ExtraFieldsMemberType=Complementary attributes (member type) -ExtraFieldsCustomerOrders=Complementary attributes (orders) -ExtraFieldsCustomerInvoices=Complementary attributes (invoices) -ExtraFieldsSupplierOrders=Complementary attributes (orders) -ExtraFieldsSupplierInvoices=Complementary attributes (invoices) -ExtraFieldsProject=Complementary attributes (projects) -ExtraFieldsProjectTask=Complementary attributes (tasks) -AlphaNumOnlyCharsAndNoSpace=only alphanumericals characters without space -SendingMailSetup=Setup of sendings by email -SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba). +RestoreMySQL=importar do MySQL +ForcedToByAModule=Esta regra é forçado a por um módulo ativado +PreviousDumpFiles=Arquivos de despejo de backup de banco de dados disponível +RunningUpdateProcessMayBeRequired=A execução do processo de atualização parece ser exigido (Programas versão difere da versão do banco de dado) +YouMustRunCommandFromCommandLineAfterLoginToUser=Você deve executar este comando a partir da linha de comando após o login a um shell com o usuário ou você deve adicionar-W opção no final da linha de comando para fornece a senha. +YourPHPDoesNotHaveSSLSupport=Funções SSL não disponíveis no seu PHP +DownloadMoreSkins=Mais skins para baixar +SimpleNumRefModelDesc=Retorna o número de referência com o formato% syymm-nnnn, onde aa é o ano, mm é o mês e nnnn é uma sequência sem buracos e sem reinicialização +ShowProfIdInAddress=Mostrar ID profissional com endereços em documentos +ShowVATIntaInAddress=Esconder VAT Intra número com endereços em documentos +TranslationUncomplete=Tradução parcial +SomeTranslationAreUncomplete=Alguns idiomas podem ser parcialmente traduzido ou pode conter erros. Se detectar alguma, você pode corrigir arquivos de idioma registrando a
http://transifex.com/projects/p/dolibarr/ . +MenuUseLayout=Faça cardápio compativel vertical (opção javascript não deve ser desativado) +MAIN_DISABLE_METEO=Desativar vista meteo +TestLoginToAPI=Testar Acesso ao API +ProxyDesc=Algumas características do Dolibarr precisa ter um acesso à Internet ao trabalho. Defina aqui os parâmetros para isso. Se o servidor Dolibarr está atrás de um servidor proxy, esses parâmetros diz Dolibarr como acessar Internet através dele. +MAIN_PROXY_USE=Usar um servidor proxy (caso contrário, o acesso direto a internet) +MAIN_PROXY_HOST=Nome / Endereço do servidor proxy +MAIN_PROXY_PORT=Porto de servidor proxy +MAIN_PROXY_USER=Entre para usar o servidor proxy +DefineHereComplementaryAttributes=Defina aqui todos os atributos, não já disponíveis por padrão, e que pretende ser apoiada por. +ExtraFieldsThirdParties=Atributos complementares (clientes) +ExtraFieldsContacts=Atributos complementares (contato / endereço) +ExtraFieldsCustomerOrders=Atributos complementares (ordens) +ExtraFieldsSupplierOrders=Atributos complementares (ordens) +ExtraFieldHasWrongValue=Atributo% s tem um valor errado. +AlphaNumOnlyCharsAndNoSpace=apenas alfanuméricos caracteres sem espaço +AlphaNumOnlyLowerCharsAndNoSpace=apenas alfanumérico e minúsculas, sem espaço +SendingMailSetup=Configuração de envios por e-mail +SendmailOptionNotComplete=Atenção, em alguns sistemas Linux, para enviar e-mail de seu e-mail, sendmail instalação execução must contém opção-ba (mail.force_extra_parameters parâmetros no seu arquivo php.ini). Se alguns destinatários não receber e-mails, tentar editar este parâmetro PHP com mail.force_extra_parameters =-ba). PathToDocuments=Rotas de acesso a documentos -SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by thoose bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommanded) is to use the method "SMTP socket library" that has no disadvantages. -TranslationSetup=Configuration de la traduction -TotalNumberOfActivatedModules=Total number of activated feature modules: %s -YouMustEnableOneModule=You must at least enable 1 module -YesInSummer=Yes in summer -TestNotPossibleWithCurrentBrowsers=Automatic detection not possible -SearchOptim=Search optimization -FixTZ=TimeZone fix -GetBarCode=Get barcode -EmptyNumRefModelDesc=The code is free. This code can be modified at any time. +SendmailOptionMayHurtBuggedMTA=Recurso para enviar e-mails usando o método "PHP mail direto" irá gerar uma mensagem de correio que pode não ser corretamente analisado por alguns servidores de correio de recepção. Resultado é que alguns e-mails não podem ser lidos por pessoas, alojadas pela thoose plataformas escutas. É caso para alguns provedores de Internet (Ex: Laranja na França). Este não é um problema em Dolibarr nem em PHP, mas para receber servidor de correio. No entanto, pode adicionar a opção MAIN_FIX_FOR_BUGGED_MTA a 1 no setup - outro para modificar Dolibarr para evitar isso. No entanto, você pode experimentar problemas com outros servidores que respeitem rigorosamente o padrão SMTP. A outra solução (recommanded) é usar o método de "biblioteca de tomada de SMTP" que não tem desvantagens. +TranslationSetup=Configuração de tradução +TranslationDesc=Escolha da língua visível na tela pode ser modificado: * A nível mundial a partir do menu strong Home - Setup - Exibição* Para o usuário apenas de guia de exibição do usuário de cartão de usuário (clique sobre o login no topo da tela). +TotalNumberOfActivatedModules=Número total de módulos de recursos ativados: +YouMustEnableOneModule=Você deve, pelo menos, permitir que um módulo +ClassNotFoundIntoPathWarning=A classe não foi encontrado em caminho PHP +OnlyFollowingModulesAreOpenedToExternalUsers=Note-se, apenas seguintes módulos são abertos a usuários externos (o que quer que sejam permissão desses usuários): +SuhosinSessionEncrypt=Armazenamento de sessão criptografada pelo Suhosin +ConditionIsCurrently=Condição é atualmente +YouUseBestDriver=Você usa o driverque é o melhor driver disponível atualmente. +YouDoNotUseBestDriver=Você usa drive mas recomendado. +NbOfProductIsLowerThanNoPb=Você tem produtos / serviços somente no banco de dados. Isso não exigida qualquer otimização particular. +SearchOptim=Pesquisa otimização +YouHaveXProductUseSearchOptim=Você tem produto no banco de dados. Você deve adicionar o PRODUCT_DONOTSEARCH_ANYWHERE constante a 1 em Home-Setup-Outros, você limitar a pesquisa ao início de cordas que fazem possível para banco de dados para usar o índice e você deve obter uma resposta imediata. +BrowserIsOK=Você está usando o navegador. Este navegador é ok para segurança e desempenho. +BrowserIsKO=Você está usando o navegador web% s. Este navegador é conhecido por ser uma má escolha para a segurança, desempenho e confiabilidade. Aconselhamos que você use o Firefox, Chrome, Opera ou Safari. +XDebugInstalled=XDebug é carregado. +XCacheInstalled=XCache é carregado. +AddRefInList=Mostrar ao cliente / fornecedor ref em lista (lista ou combobox selecionar) e mais de hiperlink +FieldEdition=Edição de campo +FixTZ=Correção de fuso horário +FillThisOnlyIfRequired=Exemplo: 2 (preencher somente se deslocamento de fuso horário problemas são experientes) +EmptyNumRefModelDesc=O código é livre. Este código pode ser modificado a qualquer momento. PasswordGenerationStandard=Devolve uma senha generada por o algoritmo interno Dolibarr: 8 caracteres, números e caracteres em minúsculas mescladas. PasswordGenerationNone=não oferece Senhas. a senha se introduce manualmente. UserGroupSetup=Configuração Módulo Usuários e Grupos @@ -651,8 +731,8 @@ RuleForGeneratedPasswords=Norma para a geração das Senhas Propostas DoNotSuggest=não propor EncryptedPasswordInDatabase=Permitir encriptação das Senhas na base de dados DisableForgetPasswordLinkOnLogonPage=não mostrar o link "senha esquecida" na página de login -UsersSetup=Users module setup -UserMailRequired=EMail required to create a new user +UsersSetup=Configuração do módulo Usuários +UserMailRequired=EMail necessário para criar um novo usuário CompanySetup=configuração do módulo empresas CompanyCodeChecker=Módulo de geração e control dos códigos de Fornecedores (clientes/Fornecedores) AccountCodeManager=Módulo de geração dos códigos contabíls (clientes/Fornecedores) @@ -660,12 +740,12 @@ ModuleCompanyCodeAquarium=Devolve um código contabíl composto de %s seguido do ModuleCompanyCodePanicum=Devolve um código contabíl vazio. ModuleCompanyCodeDigitaria=Devolve um código contabíl composto seguindo o código de Fornecedor. o código está formado por caracter0 ' C ' em primeiroa posição seguido dos 5 primeiroos caracteres do código Fornecedor. NotificationsDesc=a função das Notificações permite enviar automaticamente um correio eletrônico para um determinado evento Dolibarr em empresas configuradas para ele -ModelModules=Documents templates -WatermarkOnDraft=Watermark on draft document -CompanyIdProfChecker=Rules on Professional Ids -MustBeUnique=Must be unique ? -MustBeMandatory=Mandatory to create third parties ? -MustBeInvoiceMandatory=Mandatory to validate invoices ? +ModelModules=Modelos de documentos +DocumentModelOdt=Gere documentos a partir de modelos OpenDocuments (. ODT ou. Arquivos ODS para OpenOffice, KOffice, TextEdit, ...) +WatermarkOnDraft=Marca d'água sobre o projeto de documento +CompanyIdProfChecker=Regras sobre profissional Ids +MustBeMandatory=Obrigatório para criar terceiros? +MustBeInvoiceMandatory=Obrigatório para validar faturas? WebCalSetup=configuração de link com o calendário Webcalendar WebCalSyncro=Integrar os eventos Dolibarr em WebCalendar WebCalYesByDefault=Consultar (sim por default) @@ -674,6 +754,7 @@ WebCalURL=endereço (URL) de acesso ao calendário WebCalServer=Servidor da base de dados do calendário WebCalUser=Usuário com acesso e a base WebCalSetupSaved=os dados de link são guardado corretamente. +WebCalTestOk=A ligação ao servidor no banco de dados com o usuário de sucesso. WebCalTestKo1=a login à servidor '%s' ha sido satisfactoria, mas a base '%s' não se ha podido comTeste. WebCalTestKo2=a login à servidor '%s' por o Usuário '%s' ha falhado. WebCalErrorConnectOkButWrongDatabase=a login salió bien mas a base não parece ser uma base Webcalendar. @@ -697,6 +778,7 @@ EnableEditDeleteValidInvoice=Ativar a possibilidade de editar/eliminar uma fatur SuggestPaymentByRIBOnAccount=Sugerenciar o pagamento por transfência em conta SuggestPaymentByChequeToAddress=Sugerenciar o pagamento por cheque a FreeLegalTextOnInvoices=Texto livre em faturas +WatermarkOnDraftInvoices=Marca d'água sobre o projeto de faturas (nenhum se estiver vazio) PropalSetup=configuração do módulo Orçamentos CreateForm=criação formulário ClassifiedInvoiced=Classificar faturado @@ -704,19 +786,25 @@ HideTreadedPropal=Ocultar os Orçamentos processados do listado AddShippingDateAbility=possibilidade de determinar uma data de entregas AddDeliveryAddressAbility=possibilidade de selecionar uma endereço de envio UseOptionLineIfNoQuantity=uma linha de produto/serviço que tem uma quantidade nula se considera como uma Opção +WatermarkOnDraftProposal=Marca d'água em projetos de propostas comerciais (nenhum se estiver vazio) OrdersSetup=configuração do módulo pedidos OrdersModelModule=Modelos de documentos de pedidos +HideTreadedOrders=Esconder as ordens tratados ou cancelados na lista +WatermarkOnDraftOrders=Marca d'água em projetos de ordem (nenhum se estiver vazio) ClickToDialSetup=configuração do módulo Click To Dial ClickToDialUrlDesc=Url de chamada fazendo click ao ícone telefone.
a 'url completa chamada será: URL?login Bookmark4uSetup=configuração do módulo Bookmark4u InterventionsSetup=configuração do módulo Intervenções -FreeLegalTextOnInterventions=Free text on intervention documents -ContractsSetup=Contracts module setup -ContractsNumberingModules=Contracts numbering modules +FreeLegalTextOnInterventions=Texto livre em documentos de intervenção +WatermarkOnDraftInterventionCards=Marca d'água em documentos de cartão de intervenção (nenhum se estiver vazio) +ContractsSetup=Configuração do módulo Contratos +ContractsNumberingModules=Contratos numeração módulos +TemplatePDFContracts=Modelos de documentos Contratos +FreeLegalTextOnContracts=Texto livre em contratos +WatermarkOnDraftContractCards=Marca d'água em projetos de contratos (nenhum se estiver vazio) MembersSetup=configuração do módulo associações MemberMainOptions=opções principales AddSubscriptionIntoAccount=Registar honorários em conta bancaria ou Caixa do módulo bancario -AdherentLoginRequired=Manage a Login for each member AdherentMailRequired=E-Mail obrigatório para criar um membro novo MemberSendInformationByMailByDefault=Caixa de verificação para enviar o correio de confirmação a os Membros é por default "sí" LDAPSetup=Configuracón do módulo LDAP @@ -752,13 +840,15 @@ LDAPContactObjectClassListExample=Lista de objectClass que definem os atributos LDAPTestConnect=Teste a login LDAP LDAPTestSynchroContact=Teste a sincronização de contatos LDAPTestSynchroUser=Teste a sincronização de Usuário -LDAPTestSearch=Test a LDAP search +LDAPTestSearch=Teste uma pesquisa LDAP LDAPSynchroOK=Prueba de sincronização realizada corretamente LDAPSynchroKO=Prueba de sincronização errada LDAPSynchroKOMayBePermissions=Error da prueba de sincronização. verifique que a login à servidor sea correta e que permite as atualizaciones LDAP LDAPTCPConnectOK=login TCP à servidor LDAP efetuada (Servidor LDAPTCPConnectKO=Fallo de login TCP à servidor LDAP (Servidor +LDAPBindOK=Ligue / authentificate ao servidor LDAP sucesso (Server =% s, Port =% s, Admin =% s, Password =% s) LDAPBindKO=Fallo de login/autentificação à servidor LDAP (Servidor +LDAPUnbindSuccessfull=Desconecte sucesso LDAPConnectToDNSuccessfull=login a DN (%s) realizada LDAPConnectToDNFailed=Connexión a DN (%s) falhada LDAPDolibarrMapping=Mapping Dolibarr @@ -780,12 +870,11 @@ LDAPFieldZip=Código Postal LDAPFieldZipExample=Exemplo : postalcode LDAPFieldTown=Município LDAPFieldDescriptionExample=Exemplo : description -LDAPFieldGroupMembers=Group members -LDAPFieldGroupMembersExample=Example : uniqueMember +LDAPFieldGroupMembersExample=Exemplo: uniqueMember LDAPFieldBirthdate=data de nascimento LDAPFieldSidExample=Exemplo : objectsid LDAPFieldEndLastSubscription=data finalização como membro -LDAPFieldTitleExample=Example: title +LDAPParametersAreStillHardCoded=Parâmetros LDAP ainda são codificados (na classe de contato) LDAPSetupNotComplete=configuração LDAP incompleta (a completar em Outras pestanhas) LDAPNoUserOrPasswordProvidedAccessIsReadOnly=Administrador o senha não indicados. os acessos LDAP serão anônimos e em só leitura. LDAPDescContact=Esta página permite definir o Nome dos atributos da árvore LDAP para cada informação dos contatos Dolibarr. @@ -793,33 +882,46 @@ LDAPDescUsers=Esta página permite definir o Nome dos atributos da árvore LDAP LDAPDescGroups=Esta página permite definir o Nome dos atributos da árvore LDAP para cada informação dos grupos Usuários Dolibarr. LDAPDescMembers=Esta página permite definir o Nome dos atributos da árvore LDAP para cada informação dos Membros do módulo associações Dolibarr. LDAPDescValues=os valores de Exemplos se adaptan a OpenLDAP com os schemas carregados: core.schema, cosine.schema, inetorgperson.schema). sim voçê utiliza os a valores sugeridos e OpenLDAP, modifique a sua arquivo de configuração LDAP slapd.conf para tener todos estos schemas ativos. -NotInstalled=Not installed, so your server is not slow down by this. -HTTPCacheStaticResources=HTTP cache for static resources (css, img, javascript) -FilesOfTypeCached=Files of type %s are cached by HTTP server -FilesOfTypeNotCached=Files of type %s are not cached by HTTP server -FilesOfTypeCompressed=Files of type %s are compressed by HTTP server -FilesOfTypeNotCompressed=Files of type %s are not compressed by HTTP server -CompressionOfResources=Compression of HTTP responses +PerfDolibarr=Relatório de configuração Desempenho / otimização +YouMayFindPerfAdviceHere=Você vai encontrar nesta página algumas verificações ou conselhos relacionados com o desempenho. +NotInstalled=Não instalado, por que o seu servidor não está mais lento por isso. +ApplicativeCache=Cache de aplicativo +MemcachedNotAvailable=No cache de aplicativo encontrado. Você pode melhorar o desempenho através da instalação de um servidor de cache Memcached e um módulo capaz de usar este servidor cache. Mais informações aqui 100 000), você pode aumentar a velocidade, definindo PRODUCT_DONOTSEARCH_ANYWHERE constante a 1 em Setup Outro. Busca, então, ser limitada até o início da string. +UseSearchToSelectProduct=Use um formulário de pesquisa para escolher um produto (em vez de uma lista drop-down). UseEcoTaxeAbility=Asumir ecotaxa (DEEE) SetDefaultBarcodeTypeProducts=Tipo de código de barras utilizado por default para os produtos SetDefaultBarcodeTypeThirdParties=Tipo de código de barras utilizado por default para os Fornecedores -ProductOtherConf=Product / Service configuration +ProductCodeChecker=Módulo para geração de código do produto e verificação (produto ou serviço) +ProductOtherConf=A configuração do produto / serviço SyslogOutput=Saída do log SyslogLevel=Nível SyslogSimpleFile=Arquivo SyslogFilename=Nome e Rota do Arquivo YouCanUseDOL_DATA_ROOT=pode utilizar DOL_DATA_ROOT/dolibarr.log para um log na pasta 'documentos' de Dolibarr. ErrorUnknownSyslogConstant=a constante %s não é uma constante syslog conhecida +OnlyWindowsLOG_USER=Somente para Windows suporta LOG_USER DonationsSetup=configuração do módulo Bolsas -DonationsReceiptModel=Template of donation receipt BarcodeSetup=configuração dos códigos de barra BarcodeEncodeModule=Módulos de codificação dos códigos de barra CodeBarGenerator=gerador do código @@ -830,26 +932,25 @@ BarcodeDescUPC=Códigos de barra tipo UPC BarcodeDescISBN=Códigos de barra tipo ISBN BarcodeDescC39=Códigos de barra tipo C39 BarcodeDescC128=Códigos de barra tipo C128 -BarcodeInternalEngine=Internal engine +BarCodeNumberManager=Gerente de auto definir números de código de barras WithdrawalsSetup=configuração do módulo Débitos Diretos ExternalRSSSetup=configuração das importações do fluxos RSS NewRSS=Sindicação de um Novo fluxos RSS RSSUrl=RSS URL -RSSUrlExample=An interesting RSS feed -MailingEMailError=Return EMail (Errors-to) for emails with errors +MailingEMailError=Voltar E-mail (Erros-to) para e-mails com erros NotificationSetup=configuração do módulo Notificações -ListOfAvailableNotifications=List of available notifications (This list depends on activated modules) SendingsSetup=configuração do módulos envios -SendingsNumberingModules=Sendings numbering modules +SendingsNumberingModules=Expedição de numeração de módulos SendingsAbility=Fretes pagos pelo cliente NoNeedForDeliveryReceipts=na maioria dos casos, as entregas utilizam como nota de entregas ao cliente (lista de produtos a enviar), se recebem e assinam por o cliente. Por o tanto, a hoja de entregas de produtos é uma característica duplicada e rara vez é ativada. -FreeLegalTextOnShippings=Free text on shippings DeliveryOrderModel=Modelo de ordem de envio DeliveriesOrderAbility=Fretes pagos por o cliente -AdvancedEditor=Advanced editor +AdvancedEditor=Formatação avançada ActivateFCKeditor=Ativar FCKeditor para : FCKeditorForCompany=Criação/Edição WYSIWIG da descrição e notas dos Fornecedores FCKeditorForProductDetails=Criação/Edição WYSIWIG das linhas de detalhe dos produtos (em pedidos, Orçamentos, faturas, etc.) +FCKeditorForUserSignature=WYSIWIG criação / edição da assinatura do usuário +FCKeditorForMail=Criação WYSIWIG / edição para todos os emails (exceto Outils-> e-mail) OSCommerceErrorConnectOkButWrongDatabase=a login se ha estabelecido, mas a base de dados não parece de OSCommerce. OSCommerceTestOk=a login à servidor '%s' sobre a base '%s' por o Usuário '%s' é correta. OSCommerceTestKo1=a login à servidor '%s' sobre a base '%s' por o Usuário '%s' não se pode efetuar. @@ -858,7 +959,7 @@ StockSetup=configuração do módulo Estoque UserWarehouse=Utilizar os estoques personais de Usuário Menu=Seleção dos menus MenuHandler=Gerente de menus -HideUnauthorizedMenu=Hide unauthorized menus (gray) +HideUnauthorizedMenu=Esconder menus não autorizadas (cinza) DetailMenuHandler=Nome do gerente de menus DetailMenuModule=Nome do módulo sim a entrada do menu é resultante de um módulo DetailType=Tipo de menu (superior o izquierdp) @@ -866,7 +967,7 @@ DetailTitre=Etiqueta de menu DetailMainmenu=Grupo à qual pertence (obsoleto) DetailUrl=URL da página fazia a qual o menu aponta DetailLeftmenu=Condição de visualização o não (obsoleto) -DetailEnabled=Condition to show or not entry +DetailEnabled=Condição para mostrar ou não entrada DetailRight=Condição de visualização completa o cristálida DetailLangs=Arquivo langs para a tradução do título DetailTarget=Objetivo @@ -877,51 +978,55 @@ ConfirmDeleteLine=Tem certeza que quer eliminar esta linha? OptionVatMode=Opção de carga de ICMS OptionVatDefaultDesc=a carga do ICMS é:
-ao envio dos bens
-sobre o pagamento por os serviços OptionVatDebitOptionDesc=a carga do ICMS é:
-ao envio dos bens
-sobre o faturamento dos serviços -OnDelivery=On delivery -OnPayment=On payment -OnInvoice=On invoice -SupposedToBePaymentDate=Payment date used -SupposedToBeInvoiceDate=Invoice date used -Buy=Buy -Sell=Sell -InvoiceDateUsed=Invoice date used -YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Foundation), so there is no VAT options to setup. -AccountancyCode=Accountancy Code +SummaryOfVatExigibilityUsedByDefault=Hora do VTA exigibilidade por padrão de acordo com a opção escolhida: +OnPayment=Mediante o pagamento +OnInvoice=Na fatura +SupposedToBePaymentDate=Data de pagamento usado +SupposedToBeInvoiceDate=Data da fatura usado +InvoiceDateUsed=Data da fatura usado +YourCompanyDoesNotUseVAT=Sua empresa foi definido para não usar de IVA (Home - Configuração - Empresa / Fundação), então não há nenhuma opção de VAT a configuração. +AccountancyCodeSell=Conta Venda. código +AccountancyCodeBuy=Compre conta. código AgendaSetup=Módulo configuração de ações e agenda PasswordTogetVCalExport=Chave de autorização vcal export link -PastDelayVCalExport=Do not export event older than +PastDelayVCalExport=Não exportar evento mais antigo que +AGENDA_USE_EVENT_TYPE=Use eventos tipos (geridos em Setup Menu -> Dicionário -> Tipo de eventos da agenda) ClickToDialDesc=Este módulo permite agregar um ícone depois do número de telefone de contatos Dolibarr. um clic neste ícone, Chama a um servidor com uma URL que se indica a continuação. Esto pode ser usado para Chamar à sistema call center de Dolibarr que pode Chamar à número de telefone em um sistema SIP, por Exemplo. CashDeskSetup=configuração do módulo de Caixa registradora CashDeskThirdPartyForSell=Fornecedor genérico a usar para a venda CashDeskBankAccountForSell=conta de efetivo que se utilizará para as vendas -CashDeskBankAccountForCheque=Default account to use to receive payments by cheque -CashDeskBankAccountForCB=Default account to use to receive payments by credit cards +CashDeskBankAccountForCheque=Padrão conta para usar a receber pagamentos por cheque +CashDeskBankAccountForCB=Padrão conta para usar a receber pagamentos por cartões de crédito CashDeskIdWareHouse=Almoxarifado que se utiliza para as vendas BookmarkSetup=Configuração do Módulo de Favoritos BookmarkDesc=Este módulo lhe permite Gerenciar os links e acessos diretos. também permite Adicionar qualquer página de Dolibarr o link web ao menu de acesso rápido da esquerda. NbOfBoomarkToShow=Número máximo de marcadores que se mostrará ao menu -WebServicesSetup=Webservices module setup -WebServicesDesc=By enabling this module, Dolibarr become a web service server to provide miscellaneous web services. -WSDLCanBeDownloadedHere=WSDL descriptor files of provided services can be download here -EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint available at Url -BankSetupModule=Bank module setup -FreeLegalTextOnChequeReceipts=Free text on cheque receipts -BankOrderShow=Display order of bank accounts for countries using "detailed bank number" +WebServicesSetup=Configuração do módulo Webservices +WebServicesDesc=Ao habilitar este módulo, Dolibarr se tornar um servidor web service para fornecer serviços web diversos. +WSDLCanBeDownloadedHere=Arquivos descritores WSDL dos serviços prestados pode ser baixado aqui +EndPointIs=Clientes SOAP devem enviar seus pedidos para o terminal Dolibarr Disponível em URL +BankSetupModule=Configuração do módulo Banco +FreeLegalTextOnChequeReceipts=Texto livre em recibos de verificação +BankOrderShow=Ordem de apresentação das contas bancárias para os países usando o "número do banco detalhada" BankOrderGlobal=General -BankOrderGlobalDesc=General display order BankOrderES=Espanhol -BankOrderESDesc=Spanish display order -MultiCompanySetup=Multi-company module setup +BankOrderESDesc=Ordem de exibição Espanhol +MultiCompanySetup=Configuração do módulo Multi-empresa SuppliersSetup=Configuração Módulo Fornecedor -SuppliersCommandModel=Complete template of supplier order (logo...) -SuppliersInvoiceModel=Complete template of supplier invoice (logo...) -GeoIPMaxmindSetup=GeoIP Maxmind module setup -NoteOnPathLocation=Note that your ip to country data file must be inside a directory your PHP can read (Check your PHP open_basedir setup and filesystem permissions). -YouCanDownloadFreeDatFileTo=You can download a free demo version of the Maxmind GeoIP country file at %s. -YouCanDownloadAdvancedDatFileTo=You can also download a more complete version, with updates, of the Maxmind GeoIP country file at %s. -TestGeoIPResult=Test of a conversion IP -> country -ProjectsNumberingModules=Projects numbering module -ProjectsSetup=Project module setup -ProjectsModelModule=Project reports document model -TasksNumberingModules=Tasks numbering module -ECMSetup =GED Setup +SuppliersCommandModel=Modelo completo de ordem fornecedor (logo. ..) +SuppliersInvoiceModel=Modelo completo da fatura do fornecedor (logo. ..) +SuppliersInvoiceNumberingModel=Faturas de fornecedores de numeração modelos +GeoIPMaxmindSetup=Configuração do módulo GeoIP Maxmind +PathToGeoIPMaxmindCountryDataFile=Caminho para o arquivo que contém a tradução Maxmind ip país. Exemplos: / Usr / local / share / GeoIP / GeoIP.dat / Usr / share / GeoIP / GeoIP.dat +NoteOnPathLocation=Note-se que o seu ip para o arquivo de dados do país devem estar dentro de um diretório do seu PHP pode ler (Verifique se o seu PHP open_basedir configuração e as permissões do sistema de arquivos). +YouCanDownloadFreeDatFileTo=Você pode baixar uma versão demo gratuita do arquivo país Maxmind GeoIP em. +YouCanDownloadAdvancedDatFileTo=Você também pode baixar uma versão,mais completa, com atualizações, do arquivo país em Maxmind GeoIP. +TestGeoIPResult=Teste de um IP de conversão -> país +ProjectsNumberingModules=Projetos de numeração módulo +ProjectsSetup=Configuração do módulo de Projetos +ProjectsModelModule=Os relatórios do projeto modelo de documento +TasksNumberingModules=Módulo de numeração de Tarefas +TaskModelModule=Relatórios Tarefas modelo de documento +ECMSetup =Instalar GED +ECMAutoTree =Pasta árvore automática e documento +Format=Formato diff --git a/htdocs/langs/pt_BR/agenda.lang b/htdocs/langs/pt_BR/agenda.lang index 976290df389..437e4344053 100644 --- a/htdocs/langs/pt_BR/agenda.lang +++ b/htdocs/langs/pt_BR/agenda.lang @@ -1,58 +1,61 @@ # Dolibarr language file - Source file is en_US - agenda +IdAgenda=ID evento Actions=Eventos -ActionsArea=Área de Ações (Eventos e Tarefas) -DoneBy=Feito por +ActionsArea=Área de eventos (Atividades e Tarefas) +DoneBy=Concluído por EventsNb=Numero de eventos -EventOnFullDay=Evento para todos os dia(s) -SearchAnAction=Procurar uma ação / tarefa -MenuToDoActions=Todas as ações incompletas -MenuDoneActions=Todas a ações completas -MenuToDoMyActions=As minhas ações incompletas -MenuDoneMyActions=As minhas ações completas +EventOnFullDay=Evento durante todo o dia (s) +SearchAnAction=Procurar um evento/tarefa +MenuToDoActions=Todos os eventos incompletos +MenuDoneActions=Todas os eventos completos +MenuToDoMyActions=Os meus eventos incompletas +MenuDoneMyActions=Os meus eventos completos ListOfEvents=Lista de eventos Dolibarr -ActionsAskedBy=Ações registradas pelo -ActionsToDoBy=Ações afetando o -ActionsDoneBy=Ações terminadas por -AllMyActions=Todas as minhas ações/tarefas -AllActions=Todas a ações/tarefas -ViewList=Ver lista -ViewDay=Vista diaria -ViewWeek=Vista semanal -AutoActions=Carregamento automático da ordem do dia -AgendaAutoActionDesc=Defina aqui eventos para os quais deseja que o Dolibarr crie automaticamente uma ação na agenda. Se nada está marcado (por padrão), apenas ações manuais serão incluídas na agenda. -AgendaSetupOtherDesc=Esta página permite configurar outros parâmetros do módulo de agenda. -AgendaExtSitesDesc=Esta pagina permite declarar fontes externas dos calendarios para ver os eventos na agenda do Dolibarr. -ActionsEvents=Eventos para o Dolibarr que irá criar uma ação na agenda automaticamente. -PropalValidatedInDolibarr=Proposta validada -InvoiceValidatedInDolibarr=Fatura validada +ActionsAskedBy=Eventos registrados por +ActionsToDoBy=Eventos atribuídos à +ActionsDoneBy=Eventos concluído por +AllMyActions=Todos meus eventos/tarefas +AllActions=Todas os eventos/tarefas +ViewList=Exibir lista +ViewCal=Exibir Calendário +ViewDay=Exibir dia +ViewWeek=Exibir semana +ViewWithPredefinedFilters=Exibir com filtros predefinidos +AgendaAutoActionDesc=Defina aqui quais os eventos que deseja que o Dolibarr adicione automaticamente na sua agenda. Se nada estiver marcado (por padrão), sera incluído só eventos manualmente na agenda. +AgendaSetupOtherDesc=Esta página fornece opções para permitir a exportação de seus eventos do Dolibarr para um calendário externo (thunderbird, google agenda, ...) +AgendaExtSitesDesc=Esta página permite importar calendários de fontes externas para sua agenda de eventos no Dolibarr. +ActionsEvents=Para qual eventos o Dolibarr irá criar uma atividade na agenda automaticamente +PropalValidatedInDolibarr=Proposta %s validada +InvoiceValidatedInDolibarr=Fatura %s validada InvoiceBackToDraftInDolibarr=Fatura %s volta ao estado de rascunho -OrderValidatedInDolibarr=Ordem validada +OrderValidatedInDolibarr=Pedido %s validado OrderApprovedInDolibarr=Pedido %s aprovado +OrderRefusedInDolibarr=Pedido %s recusado OrderBackToDraftInDolibarr=Pedido %s volta ao estado de rascunho OrderCanceledInDolibarr=Pedido %s cancelado -InterventionValidatedInDolibarr=Intervençao %s validada ProposalSentByEMail=Proposta comercial %s enviada por e-mail -OrderSentByEMail=Pedido cliente %s enviado por e-mail -InvoiceSentByEMail=Fatura cliente %s enviada por e-mail -SupplierOrderSentByEMail=Pedido fornecedor %s enviado por e-mail -SupplierInvoiceSentByEMail=Fatura fornecedor %s enviada por e-mail -ShippingSentByEMail=Envio %s enviado por e-mail -InterventionSentByEMail=Intervençao %s enviada por e-mail -NewCompanyToDolibarr=Fornecedor Criado -DateActionPlannedStart=Planejada a data de início -DateActionPlannedEnd=Planejada a data de fim +OrderSentByEMail=Pedido do cliente %s enviado por e-mail +InvoiceSentByEMail=Fatura do cliente %s enviada por e-mail +SupplierOrderSentByEMail=Pedido do fornecedor %s enviado por e-mail +SupplierInvoiceSentByEMail=Fatura do fornecedor %s enviada por e-mail +ShippingSentByEMail=Entrega %s enviado por e-mail +ShippingValidated=Envio %s validado +InterventionSentByEMail=Intervenção %s enviada por e-mail +NewCompanyToDolibarr=Fornecedor criado +DateActionPlannedStart=Data de início do planejamento +DateActionPlannedEnd=Data final do planejamento DateActionDoneStart=Data real de início DateActionDoneEnd=Data real de fim -AgendaUrlOptions2=login -AgendaUrlOptions3=logina -AgendaUrlOptions4=logint -AgendaUrlOptions5=logind -AgendaShowBirthdayEvents=Mostrar Aniversários dos Contatos -AgendaHideBirthdayEvents=Esconder Aniversários dos Contatos -ExportCal=Exportar calendario -ExtSites=Importar calendarios externos -ExtSitesEnableThisTool=Mostrar calendarios externos na agenda -ExtSitesNbOfAgenda=Numero de calendarios -AgendaExtNb=Calendario nr. %s +DateActionEnd=Data de término +AgendaUrlOptions1=Você também pode adicionar os seguintes parâmetros para filtrar o resultado: +AgendaUrlOptions2=Usuário=%s permitir apenas resultados para atividades atribuídas, criadas ou concluídas pelo usuário %s. +AgendaUrlOptions3=Usuário=%s permitir resultados apenas para atividades criadas pelo usuário %s +AgendaUrlOptions4=Usuário=%s permitir apenas resultados para atividades atribuídas ao usuário %s. +AgendaUrlOptions5=Usuário=%s não permitir resultados para atividades concluídas pelo usuário %s. +AgendaShowBirthdayEvents=Visualizar aniversários dos contatos +AgendaHideBirthdayEvents=Esconder aniversários dos contatos +ExportDataset_event1=Lista de eventos na agenda +ExtSitesEnableThisTool=Visualizar calendários externos na agenda +AgendaExtNb=Calendário nr. %s ExtSiteUrlAgenda=URL para acessar arquivos .ical -ExtSiteNoLabel=Sem descriçao +ExtSiteNoLabel=Sem descrição diff --git a/htdocs/langs/pt_BR/banks.lang b/htdocs/langs/pt_BR/banks.lang index 7a2765d44d2..f667a2813df 100644 --- a/htdocs/langs/pt_BR/banks.lang +++ b/htdocs/langs/pt_BR/banks.lang @@ -1,4 +1,5 @@ # Dolibarr language file - Source file is en_US - banks +MenuBankCash=Banco/Caixa MenuSetupBank=Configuração Banco/Caixa BankName=Nome do Banco BankAccount=Conta Bancaria @@ -17,6 +18,7 @@ BankBalanceBefore=Sldo anterior BankBalanceAfter=Saldo depois CurrentBalance=Saldo atual ShowAllTimeBalance=Mostrar Balanço Desde do Inicio +AllTime=Do inicio RIB=Conta Bancaria AccountStatement=Extrato da Conta AccountStatementShort=Extrato @@ -89,6 +91,7 @@ CashBudget=Orçamento de Tesouraria PlannedTransactions=Transações Previstas Graph=Graficos ExportDataset_banque_1=Transação Bancaria e Extrato de Conta +ExportDataset_banque_2=comprovante de depósito TransactionOnTheOtherAccount=Transação Sobre Outra Conta TransactionWithOtherAccount=Transferencia de Conta PaymentNumberUpdateSucceeded=Numero de pagamento modificado @@ -105,3 +108,9 @@ EventualyAddCategory=Posivelmente especificar a categoria para se clasificar os ToConciliate=A se conciliar ? ThenCheckLinesAndConciliate=Verificar as linhas presentes no relatorio do banco e clickar BankDashboard=Somario de contas bancarias +DefaultRIB=BAN padrao +AllRIB=Todos BAN +LabelRIB=Etiqueta BAN +NoBANRecord=Nao tem registro BAN +DeleteARib=Apagar registro BAN +ConfirmDeleteRib=Voce tem certeza que quer apagar este registro BAN ? diff --git a/htdocs/langs/pt_BR/bills.lang b/htdocs/langs/pt_BR/bills.lang index a10b0462fbf..5637ee7ddaf 100644 --- a/htdocs/langs/pt_BR/bills.lang +++ b/htdocs/langs/pt_BR/bills.lang @@ -23,9 +23,12 @@ InvoiceProFormaAsk=Fatura Pro-Forma InvoiceProFormaDesc=Fatura Pro-Forma é uma verdadeira imagem de uma fatura, mas não tem valor contábil. InvoiceReplacement=Fatura Retificativa InvoiceReplacementAsk=Fatura Retificativa da Fatura -InvoiceReplacementDesc=A fatura retificativa serve para cancelar e para substituir uma fatura existente em que ainda não existe pagamentos.

Nota: só uma fatura sem nenhum pagamento pode retificarse. Sim esta última não está fechada, passará automaticamente ao estado'abandonada'. +InvoiceReplacementDesc=A fatura retificada serve para cancelar e para substituir uma fatura existente em que ainda não existe pagamentos.

Nota: só uma fatura sem nenhum pagamento pode retificar se. Sim esta última não está fechada, passará automaticamente ao estado 'abandonada'. InvoiceAvoirAsk=Nota de Crédito para Corrigir a Fatura InvoiceAvoirDesc=A Nota de Crédito é uma fatura negativa destinada a compensar um valor de uma fatura que difere do valor realmente pago (por ter pago a mais ou por devolução de produtos, por Exemplo).

Nota: Tenha em conta que a fatura original a corrigir deve ter sido fechada (' paga' ou ' paga parcialmente ') para poder realizar uma nota de crédito. +invoiceAvoirWithLines=Criar Nota de Crédito conforme a fatura original +invoiceAvoirWithPaymentRestAmount=Criar Nota de Crédito com o montante dos pagamentos da fatura de origem +invoiceAvoirLineWithPaymentRestAmount=Nota de Crédito de pagamentos fatura ReplaceInvoice=Retificar a Fatura %s ReplacementInvoice=Substituição da Fatura ReplacedByInvoice=Substituído por Fatura %s @@ -57,6 +60,7 @@ ConfirmDeletePayment=Tem certeza que quer eliminar este pagamento? ConfirmConvertToReduc=Quer converter este deposito numa redução futura?
O valor deste deposito ficará guardado para este cliente. Poderá utiliza-lo para reduzir o valor de uma próxima fatura do cliente. ReceivedPayments=Pagamentos Recebidos ReceivedCustomersPayments=Pagamentos Recebidos de Cliente +PayedSuppliersPayments=Pagamentos pago ao fornecedores ReceivedCustomersPaymentsToValid=Pagamentos Recebidos de Cliente a Confirmar PaymentsReportsForYear=Relatórios de Pagamentos de %s PaymentsReports=Relatórios de Pagamentos @@ -66,12 +70,14 @@ PaymentRule=Regra de pagamento PaymentAmount=Valor a Pagar ValidatePayment=Validar Pagamento HelpPaymentHigherThanReminderToPay=Atenção, o valor de uma fatura ou mais faturas e maior do que o que resta a pagar.
Editar a sua entrada ou confirme e pense em criar uma nota de credito para o excesso recebido por cada fatura paga alem do valor da mesma. +HelpPaymentHigherThanReminderToPaySupplier=Atenção, o valor do pagamento de uma ou mais contas é maior do que o resto a pagar.
Edite sua entrada, caso contrário, confirmar. ClassifyPaid=Clasificar 'pago' ClassifyPaidPartially=Clasificar 'parcialmente pago' ClassifyCanceled=Classificar 'Cancelado' ClassifyClosed=Classificar 'Encerrado' CreateBill=Criar Fatura AddBill=Criar Fatura ou Deposito +AddToDraftInvoices=Nenhuma Outra Fatura Rascunho DeleteBill=Eliminar Fatura SearchACustomerInvoice=Procurar uma fatura de cliente SearchASupplierInvoice=Procurar uma fatura de fornecedor @@ -128,7 +134,20 @@ ConfirmCancelBill=Tem certeza que quer anular a fatura %s ? ConfirmCancelBillQuestion=Por qué Razão quer abandonar a fatura? ConfirmClassifyPaidPartially=Tem certeza de que deseja voltar a fatura: %s ao status de paga ? ConfirmClassifyPaidPartiallyQuestion=Esta fatura não foi paga em completo. Qual as razoes para fecha-la ? +ConfirmClassifyPaidPartiallyReasonAvoir=Restante a pagar (% s% s) é um desconto concedido porque foi feita antes de prazo de pagamento. Regularizar o IVA, com uma nota de crédito. +ConfirmClassifyPaidPartiallyReasonDiscountNoVat=Restante a pagar (% s% s) é um desconto concedido porque foi feita antes de prazo de pagamento. Eu aceito perder o IVA sobre este desconto. +ConfirmClassifyPaidPartiallyReasonDiscountVat=Restante a pagar (% s% s) é um desconto concedido porque foi feita antes do prazo de pagamento. Recuperar o IVA sobre este desconto, sem uma nota de crédito. +ConfirmClassifyPaidPartiallyReasonBadCustomer=mau serviço ao cliente +ConfirmClassifyPaidPartiallyReasonProductReturned=Produtos parcialmente devolvidos +ConfirmClassifyPaidPartiallyReasonOther=Valor abandonado por outra razão +ConfirmClassifyPaidPartiallyReasonDiscountNoVatDesc=Esta escolha é possível, se a sua fatura tiver sido fornecida adequada. (Exemplo "Somente o imposto correspondente ao preço pago que forem realmente dá direito à dedução") +ConfirmClassifyPaidPartiallyReasonDiscountVatDesc=Em alguns países, esta escolha pode ser possível apenas se a sua fatura contém nota correta. +ConfirmClassifyPaidPartiallyReasonAvoirDesc=Use esta opção se todos os outros não der certo +ConfirmClassifyPaidPartiallyReasonBadCustomerDesc=Um mau cliente, é um cliente que se recusa a pagar a sua dívida. +ConfirmClassifyPaidPartiallyReasonProductReturnedDesc=Esta escolha é utilizado quando o pagamento não está completo, porque alguns dos produtos foram devolvidos +ConfirmClassifyPaidPartiallyReasonOtherDesc=Use esta opção se todos os outros não se adequar, por exemplo, na seguinte situação:
- pagamento não está completo porque alguns produtos foram enviados de volta
- montante reclamado muito importante porque um desconto foi esquecido
Em todos os casos, a quantidade deve ser corrigido no sistema de contabilidade, criando uma nota de crédito. ConfirmClassifyAbandonReasonOtherDesc=Esta eleição será para qualquer outro caso. Por Exemplo a raíz da intenção de Criar uma fatura retificativa. +ConfirmSupplierPayment=Confirma o processo deste pagamento de %s %s ? ConfirmValidatePayment=Tem certeza que quer Confirmar este pagamento (Nenhuma modificação é possível uma vez o pagamento este validado)? ValidateBill=Confirmar Fatura UnvalidateBill=Desaprovar Fatura @@ -144,8 +163,12 @@ ShowInvoiceAvoir=Ver Deposito ShowInvoiceDeposit=Ver Fatura Depositada ShowPayment=Ver Pagamento File=Arquivo +AlreadyPaid=Pago +AlreadyPaidBack=Pagamento voltou +AlreadyPaidNoCreditNotesNoDeposits=Já pago (sem notas de crédito e depósitos) RemainderToPay=Falta a Pagar RemainderToTake=Falta Cobrar +RemainderToPayBack=Restante a pagar AmountExpected=Valor Reclamado ExcessReceived=Recebido em Excesso SendBillRef=Enviar Fatura %s @@ -154,6 +177,7 @@ StandingOrders=Débitos Diretos StandingOrder=Débito Direto NoDraftBills=Nenhuma Fatura Rascunho NoOtherDraftBills=Nenhuma Outra Fatura Rascunho +NoDraftInvoices=Nenhuma Fatura Rascunho RefBill=Ref. Fatura ToBill=A Faturar RemainderToBill=Falta Faturar @@ -185,12 +209,14 @@ EditRelativeDiscount=Alterar Desconto Relativo AddGlobalDiscount=Adicionar Desconto Fixo EditGlobalDiscounts=Alterar Descontos Globais ShowDiscount=Ver o Depósito +ShowReduc=Mostrar a dedução RelativeDiscount=Desconto Relativo GlobalDiscount=Desconto Fixo CreditNote=Depósito DiscountFromDeposit=Pagamentos a partir de depósito na fatura %s AbsoluteDiscountUse=Este tipo de crédito não pode ser usado em um projeto antes da sua validação CreditNoteDepositUse=O projeto deve ser validado para utilizar este tipo de crédito +NewRelativeDiscount=Novo desconto relacionado BillAddress=Endereço de Faturação HelpEscompte=Um Desconto é um desconto acordado sobre uma fatura dada, a um cliente que realizou o seu pagamento muito antes do vencimiento. HelpAbandonBadCustomer=Este valor foi esquecido (cliente classificado como devedor) e considera-se como uma perda excepcional. @@ -202,11 +228,20 @@ InvoiceRef=Ref. Fatura InvoiceDateCreation=Data de Criação da Fatura InvoiceStatus=Estado Fatura InvoiceNote=Nota Fatura +InvoicePaid=Fatura paga PaymentNumber=Número de Pagamento WatermarkOnDraftBill=Marca de água em faturas rascunho (nada se está vazia) +InvoiceNotChecked=Não há notas fiscais selecionadas CloneInvoice=Clonar Fatura ConfirmCloneInvoice=Tem certeza que quer clonar esta fatura? DisabledBecauseReplacedInvoice=Ação desativada porque é uma fatura substituida +DescTaxAndDividendsArea=Esta área apresenta um resumo de todos os pagamentos feitos para despesas especiais. Somente os registros com pagamento durante o ano estão incluídos aqui. +NbOfPayments=valores para pagamentos +SplitDiscount=Desconto dividido em dois +ConfirmSplitDiscount=Tem certeza que dividir este desconto em duas vezes +TypeAmountOfEachNewDiscount=Quantidade de entrada para cada uma das duas partes: +TotalOfTwoDiscountMustEqualsOriginal=Total de dois novos desconto deve ser igual ao valor do desconto inicial. +ConfirmRemoveDiscount=Você tem certeza que deseja remover este desconto? RelatedBill=Fatura Anexo RelatedBills=Faturas Anexos PaymentConditionShort30D=30 Dias @@ -217,6 +252,11 @@ PaymentConditionShort60D=60 Dias PaymentCondition60D=Pagamento a 60 Dias PaymentConditionShort60DENDMONTH=60 Dias Fim de Mês PaymentCondition60DENDMONTH=Pagamento a 60 Dias até ao Fim do Mês +PaymentConditionShortPT_ORDER=Em ordem +PaymentConditionPT_ORDER=Em ordem +PaymentConditionPT_5050=50 por cento adiantado, 50 por cento na entrega +FixAmount=Quantidade fixa +VarAmount=Quantidade variável PaymentTypeVIR=Transferência Bancaria PaymentTypePRE=Débito Direto Bancario PaymentTypeShortPRE=Débito Direto @@ -258,13 +298,28 @@ UsBillingContactAsIncoiveRecipientIfExist=Utilizar o endereço do contato de cli ShowUnpaidAll=Mostrar todas as faturas ShowUnpaidLateOnly=Mostrar apenas faturas em Atraso PaymentInvoiceRef=Pagamento Fatura %s -ClosePaidInvoicesAutomatically=Classificar como "Pago". -AllCompletelyPayedInvoiceWillBeClosed=Todos os pagamentos que continuam sem pagar vão ser automaticamente fechados com status "Pago" +ValidateInvoice=Validar a fatura +Cash=em dinheiro +DisabledBecausePayments=Não é possível uma vez já que existem alguns pagamentos +CantRemovePaymentWithOneInvoicePaid=Não é possível remover o pagamento já que há pelo menos uma fatura classificada como pago +ExpectedToPay=Esperando pagamento +PayedByThisPayment=Pago +ClosePaidInvoicesAutomatically=Classifique "Paid" todas as faturas padrão ou a substituição inteiramente paga. +ClosePaidCreditNotesAutomatically=Classificar "pagou" todas as notas de crédito totalmente pago de volta. +AllCompletelyPayedInvoiceWillBeClosed=Todos fatura que permanecer sem pagar será automaticamente fechada ao status de "Paid". +ToMakePaymentBack=pagar tudo NoteListOfYourUnpaidInvoices=Atenção: Esta lista inclue somente faturas para terceiros para as quais voce esta conectado como vendedor. -PDFCrabeDescription=Modelo de fatura completo (ICMS, método de pagamento a mostrar, logotipo...) +RevenueStamp=Selo da receita +YouMustCreateInvoiceFromThird=Esta opção só está disponível ao criar fatura de terceiros +PDFCrabeDescription=Modelo de fatura completo (ICMS, método de pagamento a mostrar, logotipo...) +TerreNumRefModelDesc1=Mostrarr número com formato %syymm-nnnn padrão para faturas e %syymm-nnnn para notas de crédito onde yy é o ano, mm mês e nnnn é uma sequência, sem interrupção e não pode mostrar o valor 0 +MarsNumRefModelDesc1=Mostrar número com formato %syymm-nnnn padrão para faturas e %syymm-nnnn para notas de crédito onde yy é o ano, mm mês e nnnn é uma sequência, sem interrupção e não pode mostrar o valor 0 TerreNumRefModelError=O projeto começa começado por $syymm já existe e não é compatível com este modelo de seq�ência. Remova-o ou renomei-o para ativar este módulo. +TypeContact_facture_internal_SALESREPFOLL=Responsável do acompanhamento da fatura do cliente TypeContact_facture_external_BILLING=Contato fatura cliente TypeContact_facture_external_SHIPPING=Contato envio cliente +TypeContact_facture_external_SERVICE=Contato da fatura cliente +TypeContact_invoice_supplier_internal_SALESREPFOLL=Representante seguindo a fatura do fornecedor TypeContact_invoice_supplier_external_BILLING=Contato da Fatura de Fornecedor TypeContact_invoice_supplier_external_SHIPPING=Contato de envio do fornecedor TypeContact_invoice_supplier_external_SERVICE=Contato de servico do fornecedor diff --git a/htdocs/langs/pt_BR/bookmarks.lang b/htdocs/langs/pt_BR/bookmarks.lang index 09de7f23d01..2d4ff9f572e 100644 --- a/htdocs/langs/pt_BR/bookmarks.lang +++ b/htdocs/langs/pt_BR/bookmarks.lang @@ -1,11 +1,13 @@ # Dolibarr language file - Source file is en_US - bookmarks -ShowBookmark=Mostrar Favorito -OpenANewWindow=Abrir uma nova janela +ShowBookmark=Visualizar Favorito +OpenANewWindow=Abrir em uma nova janela +BookmarkTargetNewWindowShort=Uma nova janela +BookmarkTargetReplaceWindowShort=Na janela atual BookmarkTitle=Título do favorito -BehaviourOnClick=Comportamento à fazer quando clickamos na URL +BehaviourOnClick=Comportamento ao clicar em uma URL CreateBookmark=Criar favorito -SetHereATitleForLink=Indicar aqui um título do favorito -UseAnExternalHttpLinkOrRelativeDolibarrLink=Indicar um http URL externo ou URL Dolibarr relativo -ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Escolher se a página aberta pelo link tem que aparecer na janela atual ou uma nova janela -BookmarksManagement=Administração de favoritos +SetHereATitleForLink=Definir um título para ao favorito +UseAnExternalHttpLinkOrRelativeDolibarrLink=Usar uma URL de HTTP externa ou uma URL relativa do Dolibarr +ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Escolha se a página aberta pelo link deve aparecer na janela atual ou na nova +BookmarksManagement=Administração dos favoritos ListOfBookmarks=Lista de favoritos diff --git a/htdocs/langs/pt_BR/boxes.lang b/htdocs/langs/pt_BR/boxes.lang index cf48bb04347..c1e1dde6f55 100644 --- a/htdocs/langs/pt_BR/boxes.lang +++ b/htdocs/langs/pt_BR/boxes.lang @@ -2,26 +2,38 @@ BoxProductsAlertStock=Produtos em alerta de estoque BoxLastSupplierBills=Últimas faturas de Fornecedores BoxLastCustomerBills=Últimas faturas a Clientes +BoxOldestUnpaidCustomerBills=Primeira fatura pendente do cliente +BoxOldestUnpaidSupplierBills=Primeira fatura pendentes do fornecedor BoxLastActions=Últimas ações BoxLastContracts=Últimos contratos BoxLastContacts=Últimos contatos/endereços BoxFicheInter=Últimas intervenções -BoxCurrentAccounts=Saldos contas correntes +BoxCurrentAccounts=Abrir saldo das contas BoxTotalUnpaidCustomerBills=Total de faturas pendentes de clientes BoxTotalUnpaidSuppliersBills=Total de faturas pendentes de fornecedores BoxTitleLastRssInfos=As %s últimas Infos de %s BoxTitleLastProducts=Os %s últimos Produtos/Serviços Registados BoxTitleProductsAlertStock=Produtos em alerta de estoque BoxTitleLastModifiedSuppliers=Últimos %s fornecedores modificados +BoxTitleLastModifiedCustomers=Últimos clientes BoxTitleLastCustomerBills=As %s últimas faturas a clientes registradas BoxTitleLastSupplierBills=As %s últimas faturas de Fornecedores registradas +BoxTitleLastModifiedProspects=Últimos clientes potenciais modificados BoxTitleLastModifiedMembers=os %s últimos Membros modificados -BoxTitleCurrentAccounts=Saldos das contas correntes +BoxTitleLastFicheInter=As últimas % s intervenções modificadas +BoxTitleOldestUnpaidCustomerBills=Primeira %s fatura pendente do cliente +BoxTitleOldestUnpaidSupplierBills=Primeira %s fatura pendente do fornecedor +BoxTitleCurrentAccounts=Abrir saldo das contas BoxTitleTotalUnpaidCustomerBills=Faturas de Clientes Pendentes de Cobrança BoxTitleTotalUnpaidSuppliersBills=Faturas de Fornecedores Pendentes de Pagamento +BoxTitleLastModifiedContacts=Últimos %s contatos/endereços BoxMyLastBookmarks=Os meus últimos Favoritos +BoxOldestExpiredServices=Primeiro serviços expirados ativos +BoxLastExpiredServices=Últimos %s contatos com os serviços expirados ativos BoxTitleLastActionsToDo=As %s últimas ações a realizar BoxTitleLastModifiedDonations=As ultimas %s doações modificadaas +BoxTitleLastModifiedExpenses=Últimas despesas modificadas +BoxGlobalActivity=Atividade geral (notas fiscais, propostas, ordens) FailedToRefreshDataInfoNotUpToDate=Erro na atualização do fluxos RSS. Data da última atualização: %s LastRefreshDate=Data da última atualização ClickToAdd=Clique aqui para adicionar @@ -36,6 +48,7 @@ NoRecordedProducts=Nenhum Produto/Serviço registado NoRecordedProspects=Nenhums prespéctiva registrada NoContractedProducts=Nenhum Produto/Serviço contratado NoRecordedContracts=Nenhum contrato registrado +NoRecordedInterventions=Não há intervenções gravadas BoxLatestSupplierOrders=Últimos pedidos a forcecedores BoxTitleLatestSupplierOrders=%s últimos pedidos a forcecedores NoSupplierOrder=Nenhum pedido a fornecedor registrado @@ -44,4 +57,7 @@ BoxSuppliersInvoicesPerMonth=Faturas de fornecedor por mês BoxCustomersOrdersPerMonth=Pedidos de clientes por mês BoxSuppliersOrdersPerMonth=Pedidos de fornecedor por mês NoTooLowStockProducts=Nenhum produto abaixo do limite de estoque +BoxProductDistribution=Produtos / Serviços e distribuição +BoxProductDistributionFor=Distribuição de para ForCustomersInvoices=Faturas de Clientes +ForCustomersOrders=Ordem de clientes diff --git a/htdocs/langs/pt_BR/cashdesk.lang b/htdocs/langs/pt_BR/cashdesk.lang index 61dd93a73d5..bd66cd84c14 100644 --- a/htdocs/langs/pt_BR/cashdesk.lang +++ b/htdocs/langs/pt_BR/cashdesk.lang @@ -2,6 +2,17 @@ CashDesks=Caixa CashDeskBank=Conta Bancaria CashDeskStock=Estoque +CashDeskOn=Ligado CashDeskThirdParty=Fornecedor +CashdeskDashboard=Ponto de acesso venda +NewSell=Nova venda +AddThisArticle=Adicione este artigo +RestartSelling=Volte para vendas +SellFinished=Venda acabada +PrintTicket=Cupom impresso +TotalTicket=Ticket total Change=Recebido em Excesso +CashDeskSetupStock=Você pede para diminuir do estoque com a criação de faturas, mas não foi definido armazém para isso
Alterar configuração do módulo de estoque, ou escolha um armazém +BankToPay=Carregue Conta ShowCompany=Mostar Empresa +FilterRefOrLabelOrBC=Busca (Ref/Etiqueta) diff --git a/htdocs/langs/pt_BR/categories.lang b/htdocs/langs/pt_BR/categories.lang index a46070fe5f4..25d02e13de4 100644 --- a/htdocs/langs/pt_BR/categories.lang +++ b/htdocs/langs/pt_BR/categories.lang @@ -5,6 +5,7 @@ categories=Categorias In=Em ThirdPartyCategoriesArea=Área Categorias de Fornecedores MembersCategoriesArea=Área categorias membros +ContactsCategoriesArea=Contatos area categorias NoSubCat=Esta categoria não contém Nenhuma subcategoria. ErrSameCatSelected=Selecionou a mesma categoria varias vezes ErrForgotCat=Esqueceu de escolher a categoria @@ -13,26 +14,36 @@ ErrCatAlreadyExists=Este nome esta sendo utilizado ImpossibleAddCat=Impossível Adicionar a categoria ObjectAlreadyLinkedToCategory=O elemento já está associado a esta categoria MemberIsInCategories=Este membro deve as seguintes categorias de membros +ContactIsInCategories=Este contato pertence as seguentes categorias contatos CompanyHasNoCategory=Esta empresa não se encontra em Nenhuma categoria em particular MemberHasNoCategory=Este membro nao esta em nenhuma categoria +ContactHasNoCategory=Este contato nao esta em nenhuma categoria ClassifyInCategory=Esta categoria não contém clientes ContentsVisibleByAll=O Conteúdo Será Visivel por Todos? ContentsVisibleByAllShort=Conteúdo visivel por todos ContentsNotVisibleByAllShort=Conteúdo não visivel por todos +CategoriesTree=Tipos de categoria ConfirmDeleteCategory=Tem certeza que quer eliminar esta categoria? RemoveFromCategoryConfirm=Tem certeza que quer eliminar o link entre a transação e a categoria? MembersCategoryShort=Categoria de membros MembersCategoriesShort=Categoria de membros +ContactCategoriesShort=Categorias contatos ThisCategoryHasNoProduct=Esta categoria não contém nenhum produto. ThisCategoryHasNoSupplier=Esta categoria não contém a nenhum fornecedor. ThisCategoryHasNoCustomer=Esta categoria não contém a nenhum cliente. ThisCategoryHasNoMember=Esta categoria nao contem nenhum membro. +ThisCategoryHasNoContact=Esta categoria nao contem nenhum contato. CatSupList=Lista de categorias de fornecedores CatCusList=Lista de Categorias de Clientes/Perspectivas CatProdList=Lista de Categorias de Produtos CatMemberList=Lista de membros categorias +CatContactList=Lista de categorias contatos e do contato CatSupLinks=Linkes entre fornecedores e catogorias CatCusLinks=Linkes entre clientes/prospetivas e categorias CatProdLinks=Linkes entre produtos/servicos e categorias CatMemberLinks=Linkes entre membros e categorias DeleteFromCat=Excluir da categoria +ExtraFieldsCategories=atributos complementares +CategoriesSetup=Configuração de categorias +CategorieRecursiv=Ligação com a categoria automaticamente +CategorieRecursivHelp=Se ativado, o produto também será ligada a categoria original quando adicionando em uma subcategoria diff --git a/htdocs/langs/pt_BR/commercial.lang b/htdocs/langs/pt_BR/commercial.lang index 78bea4f6dcc..80a31305ff9 100644 --- a/htdocs/langs/pt_BR/commercial.lang +++ b/htdocs/langs/pt_BR/commercial.lang @@ -1,17 +1,21 @@ # Dolibarr language file - Source file is en_US - commercial CommercialArea=Área Comercial -DeleteAction=Eliminar uma Ação -NewAction=Nova Ação -AddAction=Criar Ação -AddAnAction=Criar uma Ação -ConfirmDeleteAction=Tem certeza que quer eliminar esta ação? -CardAction=Ficha da Ação -ActionOnCompany=Ação Relativa à Empresa -ActionOnContact=Ação Relativa ao Contato -ShowTask=Ver Tarefa -ShowAction=Ver Ação -ActionsReport=Relatório de Ações +DeleteAction=Eliminar um evento/tarefa +NewAction=Novo evento/tarefa +AddAction=Adicionar evento/tarefa +AddAnAction=Adicionar um evento/tarefa +AddActionRendezVous=Criar uma reunião +ConfirmDeleteAction=Você tem certeza que deseja excluir este evento/tarefa? +CardAction=Ficha de evento +PercentDone=Percentual completo +ActionOnCompany=Tarefa relativa à empresa +ActionOnContact=Tarefa relativa a um contato +ShowTask=Visualizar tarefa +ShowAction=Visualizar evento +ActionsReport=Relatório de eventos ThirdPartiesOfSaleRepresentative=Terceiros com representantes +SalesRepresentative=Representante de vendas +SalesRepresentatives=Os representantes de vendas SalesRepresentativeFollowUp=Comercial (Seguimento) SalesRepresentativeSignature=Comercial (Assinatura) CommercialInterlocutor=Interlocutor Comercial diff --git a/htdocs/langs/pt_BR/companies.lang b/htdocs/langs/pt_BR/companies.lang index 9325df33424..8c4c01c7a86 100644 --- a/htdocs/langs/pt_BR/companies.lang +++ b/htdocs/langs/pt_BR/companies.lang @@ -1,42 +1,81 @@ # Dolibarr language file - Source file is en_US - companies -ErrorCompanyNameAlreadyExists=o Nome da emprea %s já existe. Indique outro. -ErrorPrefixAlreadyExists=o Prefixooo %s já existe. Indique outro. -ErrorSetACountryFirst=Defina em primeiro localização o país -DeleteThirdParty=Eliminar um Fornecedor -ConfirmDeleteCompany=? Tem certeza que quer eliminar esta empresa e toda a informação dela pendente? -DeleteContact=Eliminar um contato -ConfirmDeleteContact=? Tem certeza que quer eliminar este contato e toda a sua informação inerente? -MenuNewThirdParty=Novo Fornecedor -NewThirdParty=Novo Fornecedor (Cliente Potencial, Cliente, Fornecedor) +ErrorCompanyNameAlreadyExists=Nome da empresa %s já existe. Indique outro. +ErrorPrefixAlreadyExists=Prefixo %s já existe. Indique outro. +ErrorSetACountryFirst=Primeiro defina o Pais +SelectThirdParty=Selecione um Terceiro +DeleteThirdParty=Excluir um Terceiro +ConfirmDeleteCompany=Tem certeza que quer excluir esta empresa e toda a informação dela pendente? +DeleteContact=Excluir um contato +ConfirmDeleteContact=Tem certeza que quer excluir este contato e toda a sua informação inerente? +NewSocGroup=Novo grupo de empresas +CreateDolibarrThirdPartySupplier=Criar um terceiro(Fornecedor) SocGroup=Agrupamento de empresas -IdThirdParty=ID Fornecedor IdContact=Id Contato Contacts=Contatos ThirdPartyContacts=Contatos de Fornecedores ThirdPartyContact=Contato de Fornecedor StatusContactValidated=Estado do Contato CountryIsInEEC=País da Comunidadeee Económica Europeia +ThirdPartyName=Nome do fornecedor ThirdParty=Fornecedor ThirdParties=Empresas ThirdPartyAll=Fornecedores (Todos) ThirdPartyType=Tipo de Fornecedor ToCreateContactWithSameName=Criar automaticamente um contato fisico com a mesma informação ParentCompany=Casa Mãe +Subsidiary=Subsidiário +Subsidiaries=Subsidiários +NoSubsidiary=Sem subsidiário RegisteredOffice=Domicilio Social Address=Endereço CountryCode=Código País +CountryId=ID do país +Call=Ligar PhonePerso=Telef. Particular +No_Email=Não envie e-mails em massa Zip=Código Postal Town=Município +DefaultLang=Linguagem por padrão VATIsUsed=Sujeito a ICMS VATIsNotUsed=Não Sujeito a ICMS +CopyAddressFromSoc=Preencha o endereço com o endereço do fornecedor +NoEmailDefined=Não tem email definido +LocalTax1IsUsedES=Sujeito a RE +LocalTax1IsNotUsedES=Não sujeito a RE +LocalTax2IsUsedES=Sujeito a IRPF +LocalTax2IsNotUsedES=Não sujeito a IRPF WrongCustomerCode=Código cliente incorreto WrongSupplierCode=Código fornecedor incorreto ProfId5Short=Prof. id 5 ProfId6Short=Prof. id 6 ProfId5=ID profesional 5 ProfId6=ID profesional 6 +ProfId1AR=Prof Id 1 (CUIT/CUIL) +ProfId2AR=Prof Id 2 (Receitas brutas) ProfId1BE=Núm da Ordem +ProfId1CL=Prof Id 1 (R.U.T.) +ProfId1CO=Prof Id 1 (R.U.T.) +ProfId2DE=Prof Id 2 (USt.-Nr) +ProfId3DE=Prof Id 3 (Handelsregister-Nr.) +ProfId1ES=Prof Id 1 (CIF/NIF) +ProfId2ES=Prof Id 2 (Número do seguro social) +ProfId3ES=Prof Id 3 (CNAE) +ProfId4ES=Prof Id 4 (Collegiate number) +ProfId5FR=- +ProfId2IN=Prof Id 2 (PAN) +ProfId3IN=Prof Id 3 (Taxa de Serviço) +ProfId1MA=Id prof. 1 (R.C.) +ProfId3MA=Id prof. 3 (I.F.) +ProfId4MA=Id prof. 4 (C.N.S.S.) +ProfId1MX=Prof Id 1 (R.F.C). +ProfId2MX=Prof Id 2 (R..P. IMSS) +ProfId3MX=Prof Id 3 (Carta Profissional) +ProfId1NL=KVK nummer +ProfId4NL=Burgerservicenummer (BSN) +ProfId1RU=Id prof 1 (I.E.) +ProfId2RU=Id prof 2 (I.M.) +ProfId3RU=Id prof. 3 (CGC) +ProfId4RU=Id prof. 4 (Livre) VATIntra=Cadastro Nacional Pessoa Juridica - CNPJ CompanyHasRelativeDiscount=Este cliente tem um Desconto por default de %s%% CompanyHasNoRelativeDiscount=Este cliente não tem Descontos relativos por default @@ -48,7 +87,11 @@ DefaultDiscount=Desconto por Fefeito AvailableGlobalDiscounts=Descontos Fixos Disponíveis AddContact=Criar Contato AddContactAddress=Novo Contato/Endereço +EditContact=Editar contato +EditContactAddress=Editar contato/endereco Contact=Contato +ContactsAddresses=Contatos/Enderecos +NoContactDefinedForThirdParty=Nenhum contato definido para este terceiro NoContactDefined=Nenhum contato definido para este fornecedor DefaultContact=Contato por Padrao AddThirdParty=Criar Fornecedor @@ -73,8 +116,8 @@ NoContactForAnyContract=Este contato não é contato de nenhum contrato NoContactForAnyInvoice=Este contato não é contato de nenhuma fatura NewContact=Novo Contato NewContactAddress=Novo Contato/Endereço -LastContacts=Ultimos contatos -MyContacts=Os Meus Contatos +LastContacts=Últimos contatos +MyContacts=Meus Contatos EditDeliveryAddress=Modificar Endereço de Envio ThisUserIsNot=Este usuário nem é um cliente potencial, nem um cliente, nem um fornecedor VATIntraCheckDesc=o link %s permite consultar à serviço europeo de control de números de ICMS intracomunitario. Se requer acesso a internet para que o serviço funcione @@ -94,8 +137,10 @@ NbOfAttachedFiles=N de Arquivos Anexos AttachANewFile=Adicionar um Novo Arquivo ExportCardToFormat=Exportar Ficha para o Formato ContactNotLinkedToCompany=Contato não Vinculado a um Fornecedor -ExportDataset_company_1=Fornecedor (Empresas/Instituciones) e Atributos +ExportDataset_company_1=Terceiros (Empresas/Fondacoes/Pessoas Fisicas) e propriedades ExportDataset_company_2=Contatos de Fornecedor e Atributos +ImportDataset_company_1=Terceiros (Empresas/Fondacoes/Pessoas Fisicas) e propriedades +ImportDataset_company_2=Contatos/Enderecos (dos terceiros e nao) e atributos ImportDataset_company_3=Dados Bancários PriceLevel=Nível de Preços DeliveriesAddress=Endereço(ões) de Envio @@ -111,10 +156,21 @@ SupplierCategory=Categoria de Fornecedor JuridicalStatus200=Estado Juridico DeleteFile=Apagar um Arquivo ConfirmDeleteFile=? Tem certeza que quer eliminar este Arquivo? +AllocateCommercial=Assinado ao representate de vendas SelectCountry=Selecionar um País SelectCompany=Selecionar um Fornecedor AutomaticallyGenerated=Gerado Automaticamente +YouMustCreateContactFirst=E obrigatorio cadastrar contatos email para um terceiro para ser possivel adicionar notificacoes por email. ListSuppliersShort=Lista de Fornecedores ListProspectsShort=Lista de Clientes Potenciais ListCustomersShort=Lista de Clientes +ThirdPartiesArea=Area terceiros +LastModifiedThirdParties=Os ultimos %s terceiros modificados +UniqueThirdParties=Total de terceiros unicos +ActivityStateFilter=Status das atividades +ProductsIntoElements=Lista de produtos para %s +CurrentOutstandingBill=Notas aberta correntes +OutstandingBill=Max. permitido para uma nota aberta +OutstandingBillReached=Chegou ao max permitido para nostas abertas MonkeyNumRefModelDesc=Devolve um número baixo o formato %syymm-nnnn para os códigos de clientes e %syymm-nnnn para os códigos dos Fornecedores, donde yy é o ano, mm o mês e nnnn um contador seq�êncial sem ruptura e sem Voltar a 0. +ManagingDirectors=Nome do Representante(CEO,Diretor,Presidente...) diff --git a/htdocs/langs/pt_BR/compta.lang b/htdocs/langs/pt_BR/compta.lang index 379901d57da..ce185ab2ac4 100644 --- a/htdocs/langs/pt_BR/compta.lang +++ b/htdocs/langs/pt_BR/compta.lang @@ -1,24 +1,49 @@ # Dolibarr language file - Source file is en_US - compta +TaxModuleSetupToModifyRules=Vá para
configuração do módulo Impostos para modificar regras de cálculo OptionMode=Opção de Administração Contabilidade OptionModeTrue=Opção Depositos/Despesas OptionModeTrueDesc=Neste método, o balanço calcula-se sobre a base das faturas pagas.\nA validade dos valores não está garantida pois a Administração da Contabilidade pasa rigurosamente pelas entradas/saidas das contas mediante as faturas.\nNota : Nesta Versão, Dolibarr utiliza a data da fatura ao estado ' Validada ' e não a data do estado ' paga '. OptionModeVirtualDesc=neste método, o balanço se calcula sobre a base das faturas validadas. pagas o não, aparecen ao resultado em quanto sejam discolocaçãos. FeatureIsSupportedInInOutModeOnly=função disponível somente ao modo contas CREDITOS-dividas (Véase a configuração do módulo contas) +VATReportBuildWithOptionDefinedInModule=Os valores aqui apresentados são calculados usando as regras definidas pela configuração do módulo Fiscal. +RemainingAmountPayment=Pagamento montante remanescente: +AmountToBeCharged=O valor total a pagar: +Accountparent=Conta pai +Accountsparent=Contas pai BillsForSuppliers=Faturas de Fornecedores Income=Depositos PaymentsNotLinkedToInvoice=pagamentos vinculados a Nenhuma fatura, por o que nenhum Fornecedor PaymentsNotLinkedToUser=pagamentos não vinculados a um usuário +Piece=Contabilidade Doc. +AmountHTVATRealPaid=líquido pago VATSummary=Resumo ICMS +LT2SummaryES=IRPF Saldo +VATPaid=IVA pago +SalaryPaid=Salários pagos +LT2PaidES=IRPF pago +LT2CustomerES=IRPF de vendas +LT2SupplierES=IRPF de compras +ToGet=Para restituir +SpecialExpensesArea=Área para todos os pagamentos especiais +MenuSpecialExpenses=Despesas especiais PaymentCustomerInvoice=Cobrança fatura a cliente PaymentSupplierInvoice=Pagamento fatura de fornecedor PaymentSocialContribution=pagamento gasto social PaymentVat=Pagamento ICMS +PaymentSalary=Pagamento de salário +DateStartPeriod=Período de início e data +DateEndPeriod=Período e data final NewVATPayment=Novo Pagamento de ICMS +newLT2PaymentES=Novo pagamento do IRPF +LT2PaymentES=Pagamento de IRPF +LT2PaymentsES=Pagamentos de IRPF VATPayment=Pagamento ICMS VATPayments=Pagamentos ICMS +SocialContributionsPayments=Pagamento de contribuições sociais ShowVatPayment=Ver Pagamentos ICMS TotalVATReceived=Total do ICMS Recebido AccountNumberShort=N� de conta +SalesTurnoverMinimum=Volume de negócios mínimo de vendas ByThirdParties=Por Fornecedor ByUserAuthorOfInvoice=Por autor da fatura AccountancyExport=exportação Contabilidade @@ -26,17 +51,67 @@ ErrorWrongAccountancyCodeForCompany=Código contabilidade incorreto para %s NbOfCheques=N� de Cheques ConfirmPaySocialContribution=? Tem certeza que quer classificar esta gasto social como paga? ConfirmDeleteSocialContribution=? Tem certeza que quer eliminar esta gasto social? +CalcModeVATDebt=Modo% S VAT compromisso da contabilidade% s. +CalcModeVATEngagement=Modo% SVAT sobre os rendimentos e as despesas% s. +CalcModeDebt=Modo % s declarações de dívidas% s diz Compromisso da contabilidade . +CalcModeEngagement=Modo % s rendimentos e as despesas% s contabilidade do caixa > +AnnualSummaryDueDebtMode=Balanço de receitas e despesas, resumo anual +AnnualSummaryInputOutputMode=Balanço de receitas e despesas, resumo anual AnnualByCompaniesDueDebtMode=balanço de depositos e despesas, desglosado por Fornecedores, em modo %sCréditos-dividas%s chamada Contabilidade de compromisso. AnnualByCompaniesInputOutputMode=balanço de depositos e despesas, desglosado por Fornecedores, em modo %sdepositos-despesas%s chamada Contabilidade de Caixa. SeeReportInInputOutputMode=Ver o Relatório %sdepositos-despesas%s chamado Contabilidade de Caixa para um cálculo sobre as faturas pagas SeeReportInDueDebtMode=Ver o Relatório %sCréditos-dividas%s chamada Contabilidade de compromisso para um cálculo das faturas Pendentes de pagamento +RulesAmountWithTaxIncluded=- Valores apresentados estão com todos os impostos incluídos RulesResultDue=- os montantes mostrados são montantes totais
- Inclui as faturas, gastos e ICMS debidos, que estão pagas ou não.
- Baseia-se na data de validação para as faturas e o ICMS e na data de vencimento para as gastos.
-RulesResultInOut=- os montantes mostrados são montantes totais
- Inclui os pagamentos realizados para as faturas, gastos e ICMS.
- Baseia-se na data de pagamento das mismas.
+RulesResultInOut=- Inclui os pagamentos feitos em reais em notas fiscais, despesas e IVA.
- Baseia-se as datas de pagamento das faturas, despesas e IVA. RulesCADue=- Inclui as faturas a clientes, estejam pagas ou não.
- Baseia-se na data de validação das mesmas.
RulesCAIn=- Inclui os pagamentos efetuados das faturas a clientes.
- Baseia-se na data de pagamento das mesmas
+DepositsAreNotIncluded=- Faturas e depósito não estão incluído +DepositsAreIncluded=- Faturas de Depósito estão incluídos +LT2ReportByCustomersInInputOutputModeES=Relatório de fornecedores do IRPF +VATReportByCustomersInInputOutputMode=Relatório do IVA cliente recolhido e pago +VATReportByCustomersInDueDebtMode=Relatório do IVA cliente recolhido e pago +VATReportByQuartersInInputOutputMode=Relatório da taxa do IVA cobrado e pago +VATReportByQuartersInDueDebtMode=Relatório da taxa do IVA cobrado e pago SeeVATReportInDueDebtMode=Ver o Relatório %sIVA a dever%s para um modo de cálculo com a opção sobre a divida +RulesVATInServices=- No caso dos serviços, o relatório inclui os regulamentos IVA efetivamente recebidas ou emitidas com base na data de pagamento. +RulesVATInProducts=- Para os bens materiais, que inclui as notas fiscais de IVA com base na data da fatura. +RulesVATDueServices=- No caso dos serviços, o relatório inclui faturas de IVA devido, remunerado ou não, com base na data da fatura. +RulesVATDueProducts=- Para os bens materiais, que inclui as notas fiscais de IVA, com base na data da fatura. OptionVatInfoModuleComptabilite=Nota: Para os bens materiais, sería necessário utilizar a data de entregas para para ser mais justo. PercentOfInvoice=%%/fatura NotUsedForGoods=Bens não utilizados +ProposalStats=As estatísticas sobre as propostas OrderStats=Estatísticas de comandos +InvoiceStats=As estatísticas sobre as contas +ThirdPartyMustBeEditAsCustomer=Fornecedor deve ser definido como um cliente +SellsJournal=Diário de Vendas +PurchasesJournal=Diário de Compras +DescSellsJournal=Diário de Vendas +DescPurchasesJournal=Diário de Compras CodeNotDef=Não Definida +AddRemind=Exibir o valor disponível +RemainToDivide=Saldo disponível +WarningDepositsNotIncluded=Depósitos faturas não estão incluídos nesta versão com este módulo de contabilidade. +DatePaymentTermCantBeLowerThanObjectDate=Data Prazo de pagamento não pode ser inferior a data da compra ou aquisição +Pcg_version=Versão Pcg +Pcg_type=Tipo Pcg +Pcg_subtype=PCG subtipo +InvoiceLinesToDispatch=Linhas de nota fiscal para envio +InvoiceDispatched=Faturas remetidas +AccountancyDashboard=Resumo Contabilidade +ByProductsAndServices=Por produtos e serviços +RefExt=Ref externo +ToCreateAPredefinedInvoice=Para criar uma nota fiscal predefinido, criar uma fatura padrão, em seguida, sem validá-lo, clique no botão "Convert to fatura pré-definido". +LinkedOrder=ligado ao pedido +CalculationRuleDesc=Para calcular o total do VAT, há dois métodos:
Método 1 é arredondamento cuba em cada linha, em seguida, soma-los.
Método 2 é somando tudo cuba em cada linha, em seguida, o arredondamento resultado.
Resultado final pode difere de alguns centavos. O modo padrão é o modo% s. +CalculationRuleDescSupplier=De acordo com o fornecedor, escolher o método adequado aplicar mesma regra de cálculo e obter mesmo resultado esperado pelo seu fornecedor. +TurnoverPerProductInCommitmentAccountingNotRelevant=Relatório Volume de negócios por produto, quando se usa um modo de contabilidade de caixa não é relevante. Este relatório está disponível somente quando utilizar o modo de contabilidade engajamento (ver configuração do módulo de contabilidade). +COMPTA_PRODUCT_BUY_ACCOUNT=Código de contabilidade padrão para comprar produtos +COMPTA_PRODUCT_SOLD_ACCOUNT=Código de contabilidade padrão para vender produtos +COMPTA_SERVICE_BUY_ACCOUNT=Código de contabilidade padrão para comprar serviços +COMPTA_SERVICE_SOLD_ACCOUNT=Código de contabilidade padrão para vender serviços +COMPTA_VAT_ACCOUNT=Código de contabilidade padrão para cobrança do VAT +COMPTA_VAT_BUY_ACCOUNT=Código de contabilidade padrão para pagar o VAT +COMPTA_ACCOUNT_CUSTOMER=Código Contabilidade por padrão para fornecedores de clientes +COMPTA_ACCOUNT_SUPPLIER=Código da contabilidade por padrão para fornecedor diff --git a/htdocs/langs/pt_BR/contracts.lang b/htdocs/langs/pt_BR/contracts.lang index e7e2ce0e884..5965f1174a4 100644 --- a/htdocs/langs/pt_BR/contracts.lang +++ b/htdocs/langs/pt_BR/contracts.lang @@ -69,6 +69,8 @@ ListOfServicesToExpireWithDuration=Lista de servicos a vencer em %s dias ListOfServicesToExpireWithDurationNeg=Lista de serviços expirados a mais de %s dias ListOfServicesToExpire=Lista de servicos a vencer NoteListOfYourExpiredServices=Esta lista contém apenas contratos de serviços de terceiros as quais você está ligado como representante de vendas. +StandardContractsTemplate=Modelo de contratos simples +ContactNameAndSignature=Para %s, nome e assinatura: TypeContact_contrat_external_BILLING=Contato cliente de faturação do contrato TypeContact_contrat_external_CUSTOMER=Contato cliente seguimento do contrato TypeContact_contrat_external_SALESREPSIGN=Contato cliente assinante do contrato diff --git a/htdocs/langs/pt_BR/errors.lang b/htdocs/langs/pt_BR/errors.lang index 59321791fd1..501ddd1d734 100644 --- a/htdocs/langs/pt_BR/errors.lang +++ b/htdocs/langs/pt_BR/errors.lang @@ -1,6 +1,13 @@ # Dolibarr language file - Source file is en_US - errors +NoErrorCommitIsDone=Nenhum erro, cometemos +ErrorButCommitIsDone=Erros encontrados, mas que, apesar disso validar +ErrorBadEMail=EMail% s está errado +ErrorBadUrl=Url% s está errado ErrorLoginAlreadyExists=o login %s já existe. ErrorGroupAlreadyExists=o grupo %s já existe. +ErrorRecordNotFound=Registro não encontrado. +ErrorFailToCopyFile=Falha ao copiar o arquivo '% s' para '% s'. +ErrorFailToRenameFile=Falha ao renomear o arquivo '% s' para '% s'. ErrorFailToDeleteFile=Error à eliminar o Arquivo '%s'. ErrorFailToCreateFile=Erro ao criar o arquivo '' ErrorFailToRenameDir=Error à renombar a pasta '%s' a '%s'. @@ -9,10 +16,18 @@ ErrorFailedToDeleteJoinedFiles=impossível eliminar a entidade já que tem Arqui ErrorThisContactIsAlreadyDefinedAsThisType=Este contato já está definido como contato para este tipo. ErrorFromToAccountsMustDiffers=a conta origem e destino devem ser diferentes. ErrorBadThirdPartyName=Nome de Fornecedor incorreto +ErrorProdIdIsMandatory=Obrigatório ErrorBadCustomerCodeSyntax=a sintaxis do código cliente é incorreta +ErrorBadBarCodeSyntax=A sintaxe do código de barras esta incorreta +ErrorBarCodeRequired=Código de barras necessário +ErrorBarCodeAlreadyUsed=Código de barras já utilizado ErrorUrlNotValid=O Endereço do Site está incorreta ErrorBadSupplierCodeSyntax=a sintaxis do código fornecedor é incorreta ErrorBadParameters=parâmetros incorretos +ErrorBadValueForParameter=Valor errado, parâmetro incorreto +ErrorBadImageFormat=O arquivo de imagem não tem um formato suportado +ErrorBadDateFormat=Valor tem o formato de data errada +ErrorWrongDate=A data não está correta! ErrorFailedToWriteInDir=impossível escribir na pasta %s ErrorFoundBadEmailInFile=Encontrada sintaxis incorreta em email em %s linhas em Arquivo (Exemplo linha %s com email ErrorUserCannotBeDelete=o usuário não pode ser eliminado. Quizá esé associado a elementos de Dolibarr. @@ -23,17 +38,46 @@ ErrorFeatureNeedJavascript=Esta Funcionalidade precisa de javascript ativo para ErrorTopMenuMustHaveAParentWithId0=um menu do tipo 'Superior' não pode ter um menu pai. Coloque 0 ao ID pai o busque um menu do tipo 'esquerdo' ErrorLeftMenuMustHaveAParentId=um menu do tipo 'esquerdo' deve de ter um ID de pai ErrorFileNotFound=Arquivo não encontrado (Rota incorreta, permissões incorretos o acesso prohibido por o parâmetro openbasedir) +ErrorDirNotFound=Diretório% s não encontrado (Bad caminho, permissões erradas ou acesso negado por OpenBasedir PHP ou parâmetro safe_mode) ErrorFunctionNotAvailableInPHP=a função %s é requerida por esta Funcionalidade, mas não se encuetra disponível nesta Versão/Instalação de PHP. ErrorDirAlreadyExists=já existe uma pasta com ese Nome. +ErrorFileAlreadyExists=Um arquivo com este nome já existe. +ErrorPartialFile=O servidor não recebeu o arquivo completamente. +ErrorNoTmpDir=Diretório não existe. +ErrorUploadBlockedByAddon=Carregar bloqueado por um plug-in PHP / Apache. +ErrorFileSizeTooLarge=Tamanho de arquivo é muito grande. +ErrorSizeTooLongForIntType=Tamanho muito longo (máximo dígitos% s) +ErrorSizeTooLongForVarcharType=Tamanho muito longo (% s caracteres no máximo) +ErrorNoValueForSelectType=Por favor, preencha valor para lista de seleção +ErrorNoValueForCheckBoxType=Por favor, preencha valor para a lista de caixa de seleção +ErrorNoValueForRadioType=Por favor, preencha valor para a lista de rádio +ErrorBadFormatValueList=O valor da lista não pode ter mais do que um vir:% s, mas precisa de pelo menos um: chave ou valores ErrorFieldCanNotContainSpecialCharacters=o campo %s não deve contener caracter0es especiais +ErrorFieldCanNotContainSpecialNorUpperCharacters=O campo% s não deve contém caracteres especiais, nem caracteres maiúsculos. ErrorNoAccountancyModuleLoaded=Módulo de Contabilidade não ativado -ErrorExportDuplicateProfil=o Nome do perfil já existe para este lote de exportação +ErrorExportDuplicateProfil=Este nome de perfil já existe para este lote de exportação. ErrorLDAPSetupNotComplete=a configuração Dolibarr-LDAP é incompleta. ErrorLDAPMakeManualTest=foi criado unn Arquivo .ldif na pasta %s. Trate de gastor manualmente este Arquivo a partir da linha de comandos para Obter mais detalles acerca do error. ErrorCantSaveADoneUserWithZeroPercentage=No se pode cambiar uma acção ao estado no comenzada si tiene un usuario realizante de a acción. ErrorRefAlreadyExists=a referencia utilizada para a criação já existe ErrorRecordHasChildren=não se pode eliminar o registo porque tem hijos. +ErrorRecordIsUsedCantDelete=Não é possível excluir registro. Ele já é usado ou incluídos em outro objeto. +ErrorModuleRequireJavascript=Javascript não deve ser desativado para ter esse recurso funcionando. Para ativar / desativar o Javascript, vá ao menu Home-> Configuração-> Display. +ErrorContactEMail=Um erro técnico ocorrido. Por favor, contate o administrador para seguinte e-mail% s en fornecer o código de erro% s em sua mensagem, ou ainda melhor, adicionando uma cópia de tela da página. +ErrorWrongValueForField=Valor errado para o número do campo% s (valor '% s' não corresponde regra% s) +ErrorFieldValueNotIn=Valor errado para o número do campo% s (valor '% s' não é um valor disponível no campo% s da tabela% s) +ErrorFieldRefNotIn=Valor errado para o número do campo% s (valor '% s' não é um% s ref existente) +ErrorsOnXLines=Erros no registro de origem% s (s) +ErrorSpecialCharNotAllowedForField=Os caracteres especiais não são permitidos para o campo "% s" +ErrorDatabaseParameterWrong=Parâmetro de configuração do banco de dados '% s' tem um valor não é compatível para usar Dolibarr (deve ter o valor '% s'). +ErrorNumRefModel=Uma referência existe no banco de dados (% s) e não é compatível com esta regra de numeração. Remover registro ou referência renomeado para ativar este módulo. ErrorQtyTooLowForThisSupplier=Quantidade insuficiente para este fornecedor +ErrorModuleSetupNotComplete=Configuração do módulo parece ser incompleto. Vá em Setup - Módulos para ser concluído. +ErrorBadMaskFailedToLocatePosOfSequence=Erro, máscara sem número de sequência +ErrorBadMaskBadRazMonth=Erro, valor de redefinição ruim +ErrorProductWithRefNotExist=O produto com referência não existem '% s' +ErrorDeleteNotPossibleLineIsConsolidated=Não e possívelexcluir porque registro está ligada a uma transação bancária que está conciliada +ErrorProdIdAlreadyExist=% S é atribuída a outro terço ErrorFailedToSendPassword=Erro ao enviar a senha ErrorPasswordDiffers=As Senhas não são identicas, volte a introduzi-las ErrorForbidden=acesso não autorizado.
Tentando acessar a uma página, zona o função sem estar em uma Sessão autentificada o que não se autoriza para a sua conta de usuário. @@ -50,8 +94,39 @@ ErrorFailedToChangePassword=Error na modificação da senha ErrorLoginDoesNotExists=a conta de usuário de %s não foi encontrado. ErrorLoginHasNoEmail=Este usuário não tem e-mail. impossível continuar. ErrorBadValueForCode=Valor incorreto para o código. volte a \ttentar com um Novo valor... +ErrorBothFieldCantBeNegative=Campos% se% s não pode ser tanto negativo +ErrorWebServerUserHasNotPermission=Conta de usuário usado para executar servidor não tem permissão +ErrUnzipFails=Falha ao descompactar com ZipArchive +ErrNoZipEngine=Não esta instaladoo programa para descompactar o arquivo% s neste PHP +ErrorFileMustBeADolibarrPackage=O arquivo deve ser um pacote zip Dolibarr +ErrorFileRequired=É preciso um arquivo de pacote Dolibarr +ErrorPhpCurlNotInstalled=O PHP CURL não está instalado, isto é essencial para conversar com Paypal +ErrorFailedToAddToMailmanList=Falha ao adicionar registro% s para% s Mailman lista ou base SPIP +ErrorFailedToRemoveToMailmanList=Falha ao remover registro% s para% s Mailman lista ou base SPIP +ErrorNewValueCantMatchOldValue=O novo valor não pode ser igual ao anterior +ErrorFailedToValidatePasswordReset=Falha ao reinicializar senha. Pode ser o reinit já foi feito (este link pode ser usado apenas uma vez). Se não, tente reiniciar o processo reinit. +ErrorToConnectToMysqlCheckInstance=Conecte-se ao banco de dados falhar. Verifique servidor MySQL está rodando (na maioria dos casos, você pode iniciá-lo a partir de linha de comando com o "sudo / etc / init.d / mysql start '). +ErrorDateMustBeBeforeToday=A data não pode ser maior do que hoje +ErrorPaymentModeDefinedToWithoutSetup=A modalidade de pagamento foi definido para tipo% s mas a configuração do módulo de fatura não foi concluída para definir as informações para mostrar para esta modalidade de pagamento. +ErrorPHPNeedModule=Erro, o PHP deve ter módulo% s instalado para usar este recurso. +ErrorOpenIDSetupNotComplete=Você arquivo de configuração Dolibarr configuração para permitir a autenticação OpenID, mas a URL de serviço OpenID não está definido em constante% s +ErrorWarehouseMustDiffers=A conta origem e destino devem ser diferentes +ErrorBadFormat=Formato ruim! +ErrorPaymentDateLowerThanInvoiceDate=Data de Pagamento (% s) não pode "ser antes da data da fatura para faturar. +ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Erro, esse membro ainda não está vinculado a qualquer fornecedor. Fazer a ligação membro a um terceiro existente ou criar uma novo fornecedor antes de criar assinatura com nota fiscal. +ErrorThereIsSomeDeliveries=Erro, há algumas entregas ligados a este envio. Supressão recusou. +WarningMandatorySetupNotComplete=Parâmetros de configuração obrigatórios ainda não estão definidos +WarningSafeModeOnCheckExecDir=Atenção, a opção PHP safe_mode está em modo de comando devem ser armazenados dentro de um diretório declarado pelo php parâmetro safe_mode_exec_dir. WarningAllowUrlFopenMustBeOn=o parâmetro allow_url_fopen deve ser especificado a on ao Arquivo php.ini para discolocar deste módulo completamente ativo. deve modificar este Arquivo manualmente WarningBuildScriptNotRunned=o script %s ainda não ha ejecutado a construcção de gráficos. WarningBookmarkAlreadyExists=já existe um marcador com este título o esta URL. WarningPassIsEmpty=Atenção: a senha da base de dados está vazia. Esto é buraco na segurança. deve agregar uma senha e a sua base de dados e alterar a sua Arquivo conf.php para reflejar esto. +WarningConfFileMustBeReadOnly=Atenção, o seu arquivo de configuração (htdocs / conf / conf.php) pode ser substituído pelo servidor web. Esta é uma falha de segurança grave. Modificar permissões em arquivos para estar no modo de somente leitura para usuário do sistema operacional utilizado pelo servidor web. Se você usa o formato Windows e FAT para o seu disco, você deve saber que este sistema de arquivos não permite adicionar permissões em arquivos, por isso não pode ser completamente seguro. +WarningsOnXLines=Advertências sobre registro de origem% s (s) +WarningNoDocumentModelActivated=Não existe um modelo, para a geração de documentos, foi ativado. A modelo será escolhida por padrão até que você verifique a sua configuração do módulo. +WarningLockFileDoesNotExists=Atenção, uma vez que a instalação estiver concluída, você deve desabilitar a instalação / migrar ferramentas, adicionando um install.lock arquivo no diretório% s. Faltando este arquivo é uma falha de segurança. WarningUntilDirRemoved=Esta alerta seguirá ativa mientras a pasta exista (alerta visivel para Os Usuários admin somente). +WarningCloseAlways=Atenção, o fechamento é feito mesmo se o valor difere entre elementos de origem e de destino. Ative esse recurso com cautela. +WarningUsingThisBoxSlowDown=Atenção, utilizando esta caixa de abrandar a sério todas as páginas que mostram a caixa. +WarningClickToDialUserSetupNotComplete=Configuração de informações ClickToDial para o usuário não são completas (ver guia ClickToDial no seu cartão de usuário). +WarningNotRelevant=Operação irrelevante para este conjunto de dados diff --git a/htdocs/langs/pt_BR/exports.lang b/htdocs/langs/pt_BR/exports.lang index e835f6556d9..d680c4d1145 100644 --- a/htdocs/langs/pt_BR/exports.lang +++ b/htdocs/langs/pt_BR/exports.lang @@ -1,19 +1,19 @@ # Dolibarr language file - Source file is en_US - exports +ExportsArea=Área Exportações ImportableDatas=Conjunto de dados importaveis SelectExportDataSet=Escolha um conjunto predefinido de dados que deseja exportar... SelectImportDataSet=Escolha um conjunto predefinido de dados que deseja importar... -NotImportedFields=Fields of source file not imported +SelectImportFields=Escolha campos de arquivo de fonte que você deseja importar e seu campo de destino no banco de dados, movendo-os para cima e para baixo com a seta, ou selecione um perfil de importação pré-definido: +NotImportedFields=Os campos de arquivo de origem não importado SaveImportModel=Guardar este perfil de importação assim pode reutiliza-lo posteriormente... ImportModelName=Nome do perfil de importação ImportModelSaved=Perfil de importação guardado com o nome de %s. ImportableFields=Campos Importáveis ImportedFields=Campos a Importar DatasetToImport=Conjunto de dados a importar -NoDiscardedFields=No fields in source file are discarded -FieldOrder=Field order -FieldTitle=Field title +NoDiscardedFields=Não há campos em arquivo de origem são descartados +FieldOrder=Ordem de campo NowClickToGenerateToBuildExportFile=Agora, faça click em "Gerar" para gerar o arquivo exportação... -LibraryShort=Library LibraryUsed=Bibliotéca Utilizada FormatedImportDesc2=O primeiro passo consiste em escolher o tipo de dado que deve importar, logo o arquivo e a continuação escolher os campos que deseja importar. FormatedExportDesc2=O primeiro passo consiste em escolher um dos conjuntos de dados predefinidos, a continuação escolher os campos que quer exportar para o arquivo e em que ordem. @@ -30,59 +30,63 @@ LineTotalHT=Valor do HT por linha LineTotalTTC=Acrescido de ICMS da linha LineTotalVAT=Valor ICMS por Linha TypeOfLineServiceOrProduct=Tipo de Linha (0 -FileWithDataToImport=File with data to import -FileToImport=Source file to import -FileMustHaveOneOfFollowingFormat=File to import must have one of following format -DownloadEmptyExample=Download example of empty source file -ChooseFormatOfFileToImport=Choose file format to use as import file format by clicking on picto %s to select it... -ChooseFileToImport=Upload file then click on picto %s to select file as source import file... -SourceFileFormat=Source file format -FieldsInSourceFile=Fields in source file -FieldsInTargetDatabase=Target fields in Dolibarr database (bold=mandatory) -Field=Field -NoFields=No fields -MoveField=Move field column number %s -ExampleOfImportFile=Example_of_import_file -SaveImportProfile=Save this import profile -ErrorImportDuplicateProfil=Failed to save this import profile with this name. An existing profile already exists with this name. -ImportSummary=Import setup summary -TablesTarget=Targeted tables -FieldsTarget=Targeted fields -TableTarget=Targeted table -FieldTarget=Targeted field -FieldSource=Source field -DoNotImportFirstLine=Do not import first line of source file -NbOfSourceLines=Number of lines in source file -NowClickToTestTheImport=Check import parameters you have defined. If they are correct, click on button "%s" to launch a simulation of import process (no data will be changed in your database, it's only a simulation for the moment)... -RunSimulateImportFile=Launch the import simulation -SomeMandatoryFieldHaveNoSource=Some mandatory fields have no source from data file -InformationOnSourceFile=Information on source file -InformationOnTargetTables=Information on target fields -SelectAtLeastOneField=Switch at least one source field in the column of fields to export -SelectFormat=Choose this import file format -RunImportFile=Launch import file -NowClickToRunTheImport=Check result of import simulation. If everything is ok, launch the definitive import. -DataLoadedWithId=All data will be loaded with the following import id: %s -ErrorMissingMandatoryValue=Mandatory data is empty in source file for field %s. -TooMuchErrors=There is still %s other source lines with errors but output has been limited. -TooMuchWarnings=There is still %s other source lines with warnings but output has been limited. -EmptyLine=Empty line (will be discarded) -CorrectErrorBeforeRunningImport=You must first correct all errors before running definitive import. -FileWasImported=File was imported with number %s. -YouCanUseImportIdToFindRecord=You can find all imported records in your database by filtering on field import_key='%s'. -NbOfLinesOK=Number of lines with no errors and no warnings: %s. -NbOfLinesImported=Number of lines successfully imported: %s. -DataComeFromNoWhere=Value to insert comes from nowhere in source file. -DataComeFromFileFieldNb=Value to insert comes from field number %s in source file. -DataComeFromIdFoundFromRef=Value that comes from field number %s of source file will be used to find id of parent object to use (So the objet %s that has the ref. from source file must exists into Dolibarr). -DataIsInsertedInto=Data coming from source file will be inserted into the following field: -DataIDSourceIsInsertedInto=The id of parent object found using the data in source file, will be inserted into the following field: -DataCodeIDSourceIsInsertedInto=The id of parent line found from code, will be inserted into following field: -SourceRequired=Data value is mandatory -SourceExample=Example of possible data value -ExampleAnyRefFoundIntoElement=Any ref found for element %s -CSVFormatDesc=Comma Separated Value file format (.csv).
This is a text file format where fields are separated by separator [ %s ]. If separator is found inside a field content, field is rounded by round character [ %s ]. Escape character to escape round character is [ %s ]. -CsvOptions=Csv Options -Separator=Separator -SpecialCode=Special code -FilteredFieldsValues=Value for filter +FileToImport=Arquivo de origem de importação +FileMustHaveOneOfFollowingFormat=Arquivo para importação deve ter um dos seguinte formato +DownloadEmptyExample=Baixar exemplo de arquivo de origem vazio +ChooseFormatOfFileToImport=Escolha o formato de arquivo a ser usado como formato de arquivo de importação clicando no para selecioná-lo ... +ChooseFileToImport=Carregar arquivo e clique no picto% s para selecionar o arquivo como arquivo de importação de fonte ... +FieldsInSourceFile=Campos em arquivo de origem +FieldsInTargetDatabase=Campos de destino no banco de dados Dolibarr (negrito = obrigatório) +MoveField=Mover campo número da colunas +ExampleOfImportFile=Exemplo de arquivo de importação +SaveImportProfile=Guardar este perfil de importação +ErrorImportDuplicateProfil=Falha ao salvar este perfil de importação com este nome. Um perfil existente já existe com este nome. +ImportSummary=Resumo da configuração de importação +TablesTarget=Mesas alvejados +FieldsTarget=Alvo +TableTarget=Alvo +FieldTarget=Campo de destino +FieldSource=Campo Fonte +DoNotImportFirstLine=Não importar primeira linha de arquivo de origem +NowClickToTestTheImport=Verifique os parâmetros de importação que você definiu. Se eles estiverem corretos, clique no botão "% s" para iniciar uma simulação do processo de importação (os dados não serão alterados em seu banco de dados, é apenas uma simulação para o momento) ... +FieldNeedSource=Este campo requer dados do arquivo de origem +SomeMandatoryFieldHaveNoSource=Alguns campos obrigatórios não têm nenhuma fonte de arquivo de dados +InformationOnSourceFile=Informações sobre arquivo de origem +SelectAtLeastOneField=Mude pelo menos um campo de origem na coluna de campos para exportar +SelectFormat=Escolha este formato de arquivo de importação +RunImportFile=Arquivo de importação de lançamento +NowClickToRunTheImport=Verifique o resultado da simulação de importação. Se tudo estiver ok, inicie a importação definitiva. +DataLoadedWithId=Todos os dados serão carregados com o seguinte ID de importação:% s +ErrorMissingMandatoryValue=Dados obrigatórios esta vazio no arquivo de origem para o campo. +TooMuchErrors=Há ainda outras linhas de origem com erros mas a produção tem sido limitado. +TooMuchWarnings=Há ainda outras linhas de origem com avisos, mas a produção tem sido limitado. +EmptyLine=Linha vazia (serão descartados) +FileWasImported=O arquivo foi importado com o números. +YouCanUseImportIdToFindRecord=Você pode encontrar todos os registros importados em seu banco de dados, filtrando em campo import_key. +NbOfLinesOK=Número de linhas sem erros e sem avisos: +NbOfLinesImported=Número de linhas de importados com sucesso: +DataComeFromNoWhere=Valor para inserir vem do erro,no arquivo de origem. +DataComeFromFileFieldNb=Valor para inserir vem do campo de número do arquivo de origem. +DataComeFromIdFoundFromRef=Valor que vem do campo de número do arquivo de origem, será usado para encontrar id do objeto. (Então o objeto que tem a ref. De arquivo de origem deve existir em Dolibarr). +DataComeFromIdFoundFromCodeId=O código que vem de número do campo do arquivo de origem será usado para encontrar id do objeto pai de usar (Assim, o código do arquivo de origem deve existe no dicionário). Note que, se você sabe id, você também pode usá-lo em arquivo de origem em vez de código. Importação deve trabalhar em ambos os casos. +DataIsInsertedInto=Dados provenientes do arquivo de origem será inserido o seguinte campo: +DataIDSourceIsInsertedInto=O id do objeto pai encontrado usando os dados em arquivo de origem, será inserido o seguinte campo: +DataCodeIDSourceIsInsertedInto=O ID da linha pai encontrado a partir do código, será inserido no campo a seguir: +SourceExample=Exemplo de possível valor dos dados +ExampleAnyRefFoundIntoElement=Qualquer ref encontrada para o elemento +ExampleAnyCodeOrIdFoundIntoDictionary=Qualquer código (ou id) encontrado em dicionário +CSVFormatDesc=Formato de arquivo de valores separados por vírgulas . Este é um formato de arquivo de texto, onde os campos são separados pelo separador. Se separador é encontrado dentro de um conteúdo de campo, o campo é arredondado pelo caráter rodada . Fuja personagem para escapar caráter rodada é +Excel95FormatDesc=Formato de arquivo do Excel. (Xls) Este é o formato Excel 95 nativa (BIFF5). +Excel2007FormatDesc=Formato de arquivo do Excel (. Xlsx) Este é o formato Excel 2007 nativo (SpreadsheetML). +TsvFormatDesc=Formato de arquivo Tab Separated Value (. TSV) Este é um formato de arquivo de texto, onde os campos são separados por um tabulador [Tab]. +ExportFieldAutomaticallyAdded=O campo foi adicionado automaticamente. Ele vai evitar que você tenha linhas semelhantes a serem tratados como registros duplicados (com este campo adicionado, todas as linhas serão possuem seu próprio ID e será diferente). +CsvOptions=Opções csv +Enclosure=Recinto +SuppliersProducts=Fornecedores Produtos +SpecialCode=Código especial +ExportStringFilter=Permite substituir um ou mais caracteres no texto +ExportDateFilter='AAAA' YYYYMM 'AAAAMMDD': filtros em um ano / mês / dia
'AAAA + AAAA' YYYYMM + YYYYMM 'AAAAMMDD + AAAAMMDD': filtros mais uma série de anos / meses / dias
> AAAA ''> YYYYMM ''> AAAAMMDD ': filtros nos seguintes anos / meses / dias
' filtros "NNNNN + NNNNN 'mais de uma faixa de valores
'> NNNNN' filtros por valores mais baixos
'> NNNNN' filtros por valores mais elevados +SelectFilterFields=Se você deseja filtrar alguns valores, apenas os valores de entrada aqui. +FilteredFields=Campos filtrados +FilteredFieldsValues=Valor para o filtro diff --git a/htdocs/langs/pt_BR/help.lang b/htdocs/langs/pt_BR/help.lang index 736edf84ab0..6e92cbfd935 100644 --- a/htdocs/langs/pt_BR/help.lang +++ b/htdocs/langs/pt_BR/help.lang @@ -1,8 +1,25 @@ # Dolibarr language file - Source file is en_US - help +CommunitySupport=Fórum/Wiki suporte +EMailSupport=E-mails de suporte +RemoteControlSupport=Suporte em tempo real / remoto +OtherSupport=Outros suportes +ToSeeListOfAvailableRessources=Entrar em contato com/consulte os recursos disponíveis: ClickHere=Clickque aqui HelpCenter=Central de ajuda DolibarrHelpCenter=Centro de suporte e ajuda Dolibarr +ToGoBackToDolibarr=Caso contrário, clique aqui para usar Dolibarr +TypeOfSupport=Fonte de suporte NeedHelpCenter=Precisa de ajuda ou suporte ? +Efficiency=eficiência TypeHelpOnly=Somente ajuda +TypeHelpDev=Ajuda+Desenvolvimento +TypeHelpDevForm=Ajuda+Desenvolvimento+Formação ToGetHelpGoOnSparkAngels1=Algumas empresas podem prover um suporte online rápido (às vezes imediato) e mais eficiente ao assumirem o controle de seu computador. Tais ajudantes podem ser encontrados na página %s: ToGetHelpGoOnSparkAngels3=Você também pode acessar a lista de todos os treinadores disponíveis para o Dolibarr, para isto clique no botão +ToGetHelpGoOnSparkAngels2=Às vezes, não há nenhuma empresa disponível no momento de fazer sua pesquisa, por isso acho que para mudar o filtro para procurar "tudo disponibilidade". Você será capaz de enviar mais pedidos. +BackToHelpCenter=Caso contrário, clique aqui para ir para trás para ajudar a home page . +LinkToGoldMember=Você pode ligar para um dos técnicos pré-selecionada por Dolibarr para o seu idioma, clicando em seu Widget (status e preço máximo são atualizados automaticamente): +PossibleLanguages=Os idiomas suportados +MakeADonation=Ajude o projeto Dolibarr, faça uma doação +SubscribeToFoundation=Ajuda projeto Dolibarr, assine a fundação +SeeOfficalSupport=Para obter suporte oficial do Dolibarr no seu idioma:
%s diff --git a/htdocs/langs/pt_BR/holiday.lang b/htdocs/langs/pt_BR/holiday.lang index 97a3b9139ef..f38f71b6a06 100644 --- a/htdocs/langs/pt_BR/holiday.lang +++ b/htdocs/langs/pt_BR/holiday.lang @@ -4,14 +4,14 @@ Holidays=Ferias CPTitreMenu=Ferias MenuReportMonth=Relatorio mensal MenuAddCP=Aplicar para ferias -NotActiveModCP=Voce tem que abilitar o modulo de ferias para ver esta pagina. -NotConfigModCP=Voce precisa configurar o modulo de ferias para ver esta pagina. Para faze-lo, clickque aqui . +NotActiveModCP=Vocẽ tem que habilitar o modulo de ferias para ver esta pagina. +NotConfigModCP=Você precisa configurar o modulo de ferias para ver esta pagina. Para faze-lo, clickque aqui . NoCPforUser=Voce nao tem demandado as ferias. AddCP=Aplique-se para as ferias. DateDebCP=Data inicio DateFinCP=Data fim DateCreateCP=Data criacão -ToReviewCP=Awaiting approval +ToReviewCP=Aguardando aprovação RefuseCP=Negado ValidatorCP=Aprovador ListeCP=Lista de feriados @@ -20,25 +20,29 @@ SendRequestCP=Criando demanda para ferias DelayToRequestCP=Demandas para ferias teram que ser feitas no minimo %s dias antes. MenuConfCP=Editar balancete das ferias UpdateAllCP=Atualizar ferias +SoldeCPUser=Equilíbrio dos feriados dias. ErrorEndDateCP=Você deve selecionar uma data final posterior à data inicial. -ErrorSQLCreateCP=An SQL error occurred during the creation: -ErrorIDFicheCP=An error has occurred, the request for holidays does not exist. +ErrorSQLCreateCP=Ocorreu um erro no SQL durante a criação: +ErrorIDFicheCP=Ocorreu um erro, no pedido de ferias não existe. ReturnCP=Retorne à página anterior ErrorUserViewCP=Você não está autorizado a ler essa requisição de férias. -InfosCP=Information of the demand of holidays +InfosCP=Informações da demanda das férias +InfosWorkflowCP=Fluxo de Trabalho de Informação RequestByCP=Requisitado por NbUseDaysCP=Número de dias utilizados das férias DeleteCP=Eliminar ActionValidCP=Confirmar ActionRefuseCP=Não autorizar TitleDeleteCP=Apagar a requisição de férias -ConfirmDeleteCP=Confirm the deletion of this request for holidays? +ConfirmDeleteCP=Confirme a eliminação deste pedido para férias? ErrorCantDeleteCP=Você não tem privilégios para apanhar essa requisição de férias +CantCreateCP=Você não tem o direito de aplicar para férias. +InvalidValidatorCP=Você deve escolher um aprovador ao seu pedido de férias. UpdateButtonCP=Modificar -CantUpdate=You cannot update this request of holidays. +CantUpdate=Você não pode atualizar esta solicitação de férias. NoDateDebut=Você deve selecionar uma data inicial. NoDateFin=Você deve selecionar uma data final. -ErrorDureeCP=Your request for holidays does not contain working day. +ErrorDureeCP=O seu pedido de férias não contém dia de trabalho. TitleValidCP=Aprovar a requisição de férias ConfirmValidCP=Você tem certeza que deseja aprovar a requisição de férias? TitleToValidCP=Enviar requisição de férias @@ -48,32 +52,77 @@ ConfirmRefuseCP=Você tem certeza que não deseja autorizar a requisição de f NoMotifRefuseCP=Você deve selecionar uma razão para não autorizar a requisição. TitleCancelCP=Cancelar a requisição de férias ConfirmCancelCP=Você tem certeza que deseja cancelar a requisição de férias? -DetailRefusCP=Reason for refusal -DateRefusCP=Date of refusal +DetailRefusCP=Motivo da recusa +DateRefusCP=Data da recusa DateCancelCP=Data do cancelamento +DefineEventUserCP=Atribuir uma licença excepcional para um usuário +addEventToUserCP=atribuir férias MotifCP=Razão UserCP=Usuário -ActionByCP=Performed by -UserUpdateCP=For the user +ErrorAddEventToUserCP=Ocorreu um erro ao adicionar a licença excepcional. +AddEventToUserOkCP=A adição da licença excepcional tenha sido concluída. +MenuLogCP=Ver registos de ferias +LogCP=Calculo de atualizações de ferias +ActionByCP=Interpretada por +PrevSoldeCP=Balanço anterior +NewSoldeCP=Novo Balanco +alreadyCPexist=Um pedido de ferias já foi feito neste período. UserName=Apelidos -FirstDayOfHoliday=First day of holiday -LastDayOfHoliday=Last day of holiday -HolidaysMonthlyUpdate=Monthly update -ManualUpdate=Manual update -HolidaysCancelation=Holidays cancelation +HolidaysMonthlyUpdate=A atualização mensal +ManualUpdate=Atualização manual +HolidaysCancelation=Feriados cancelados +ConfCP=A configuração do módulo de ferias +DescOptionCP=Descrição da opção ValueOptionCP=Valor +GroupToValidateCP=Grupo com a capacidade de aprovar ferias +ConfirmConfigCP=Validar a configuração +LastUpdateCP=Última atualização automática das férias +UpdateConfCPOK=Atualizado com sucesso. +ErrorUpdateConfCP=Ocorreu um erro durante a atualização, por favor, tente novamente. +AddCPforUsers=Por favor, adicione o balanço dos feriados de usuários, define_ferias" estilo="fonte -weight: normal; color: vermelha; texto decoração: sublinhar; clicando aqui . +DelayForSubmitCP=Prazo para solicitar feriados +AlertapprobatortorDelayCP=Impedir a approvação se o pedido de férias não coincidir com a data limite +AlertValidatorDelayCP=Prevenir o aprovador se o pedido de férias exceder atraso +AlertValidorSoldeCP=Impedir a aprovador se o pedido de férias exceder o equilíbrio +nbUserCP=Número de usuários suportados nas férias de módulo +nbHolidayDeductedCP=Número de feriados a ser deduzido por dia de feriado tomado +nbHolidayEveryMonthCP=Número de feriados adicionados a cada mês +Module27130Name=Gestão das férias +Module27130Desc=Gestão das férias +TitleOptionMainCP=Principais configurações de ferias +TitleOptionEventCP=Configurações de feriados relacionados a eventos ValidEventCP=Confirmar +UpdateEventCP=Eventos de atualização +NameEventCP=Nome do evento +OkCreateEventCP=A adição do evento correu bem. +ErrorCreateEventCP=Erro ao criar o evento. +UpdateEventOkCP=A atualização do evento correu bem. +ErrorUpdateEventCP=Erro ao atualizar o evento. +DeleteEventCP=Excluir Evento +DeleteEventOkCP=O evento foi excluído. +ErrorDeleteEventCP=Erro ao excluir o evento. +TitleDeleteEventCP=Excluir uma licença excepcional +TitleCreateEventCP=Criar uma licença excepcional +TitleUpdateEventCP=Editar ou excluir uma licença excepcional DeleteEventOptionCP=Eliminar UpdateEventOptionCP=Modificar -TitleAdminCP=Configuration of Holidays -Hello=Hello -HolidaysToValidate=Validate holidays -HolidaysToValidateBody=Below is a request for holidays to validate -HolidaysToValidateDelay=This request for holidays will take place within a period of less than %s days. -HolidaysToValidateAlertSolde=The user who made this request for holidays do not have enough available days. -HolidaysValidated=Validated holidays -HolidaysValidatedBody=Your request for holidays for %s to %s has been validated. -HolidaysRefused=Denied holidays -HolidaysRefusedBody=Your request for holidays for %s to %s has been denied for the following reason : -HolidaysCanceled=Canceled holidays -HolidaysCanceledBody=Your request for holidays for %s to %s has been canceled. +ErrorMailNotSend=Ocorreu um erro durante o envio de e-mail: +NoCPforMonth=Não deixe este mês. +nbJours=Número de dias +HolidaysToValidate=Validar feriados +HolidaysToValidateBody=Abaixo está um pedido de férias para validar +HolidaysToValidateDelay=Este pedido de ferias terá lugar dentro de um período de menos dias. +HolidaysToValidateAlertSolde=O usuário que fez o pedido de feriados não têm número suficiente de dias disponíveis. +HolidaysValidated=Feriados validados +HolidaysValidatedBody=O seu pedido de ferias foi validado. +HolidaysRefused=Feriados negados +HolidaysRefusedBody=O seu pedido de ferias foi negado pelo seguinte motivo: +HolidaysCanceled=Feriados cancelados +HolidaysCanceledBody=O seu pedido de ferias foi cancelada. +Permission20000=Leia você próprios feriados +Permission20001=Criar / modificar as suas férias +Permission20002=Criar / modificar feriados para todos +Permission20003=Excluir pedidos férias +Permission20004=Usuários de configuração ferias +Permission20005=Revisão dos feriados modificados +Permission20006=Leia feriados relatório mensal diff --git a/htdocs/langs/pt_BR/install.lang b/htdocs/langs/pt_BR/install.lang index b8b4a56d90e..18726415589 100644 --- a/htdocs/langs/pt_BR/install.lang +++ b/htdocs/langs/pt_BR/install.lang @@ -125,3 +125,5 @@ MigrationProjectUserResp=Dados da migração do campo fk_user_resp de llx_projet MigrationProjectTaskTime=Atualizar tempo gasto em sgundos MigrationActioncommElement=Atualizar dados nas ações MigrationPaymentMode=Migração de dados para o modo de pagamento +ShowNotAvailableOptions=Mostrar as opções não disponíveis +HideNotAvailableOptions=Esconder as opção não disponível diff --git a/htdocs/langs/pt_BR/languages.lang b/htdocs/langs/pt_BR/languages.lang index 867184dd1e4..c9d38574c00 100644 --- a/htdocs/langs/pt_BR/languages.lang +++ b/htdocs/langs/pt_BR/languages.lang @@ -3,6 +3,7 @@ Language_ar_AR=Arabe Language_ar_SA=Arabe Language_bg_BG=Bulgaro Language_ca_ES=Catalao +Language_cs_CZ=Tcheco Language_da_DA=Danes Language_da_DK=Danes Language_de_DE=Alemao @@ -13,6 +14,8 @@ Language_en_IN=Ingles (India) Language_en_NZ=Ingles (Nova Zelandia) Language_en_SA=Ingles (Arabia Saudita) Language_en_US=Ingles (Estados Unidos) +Language_es_DO=Espanhol (República Dominicana) +Language_es_CL=Espanhol (Chile) Language_es_MX=Espanhol (Mexico) Language_et_EE=Estone Language_fa_IR=Persio @@ -23,6 +26,7 @@ Language_fr_CH=Françes (Suiça) Language_fr_FR=Françes Language_he_IL=Ebreo Language_hu_HU=Ungeres +Language_id_ID=Indonésio Language_is_IS=Islandes Language_ja_JP=Japones Language_nb_NO=Norveges (Bokmal) @@ -31,5 +35,6 @@ Language_pl_PL=Polones Language_pt_BR=Portugues (Brasil) Language_pt_PT=Portugues Language_ru_UA=Russo (Ukrania) +Language_th_TH=Thai Language_zh_CN=Chines Language_zh_TW=Chines (Tradicional) diff --git a/htdocs/langs/pt_BR/mails.lang b/htdocs/langs/pt_BR/mails.lang index a9b1a5b77c7..c70135df930 100644 --- a/htdocs/langs/pt_BR/mails.lang +++ b/htdocs/langs/pt_BR/mails.lang @@ -34,6 +34,14 @@ MailtoEMail=Hyper-link ao e-mail ActivateCheckRead=Permitir uso do atalho "Desenscrever" ActivateCheckReadKey=Chave principal para criptar URL de uso para funções "Ler destinatario" e "Desenscrever" EMailSentToNRecipients=E-mail enviado para %s destinatarios. +XTargetsAdded=%s destinatários adicionados à lista de destino +EachInvoiceWillBeAttachedToEmail=Documento usando o modelo de fatura padrão que será criado e anexado a cada e-mail. +MailTopicSendRemindUnpaidInvoices=Lembrete da fatura %s (%s) +SendRemind=Enviar lembrete por e-mails +RemindSent=%s lembrete(s) de envio +AllRecipientSelectedForRemind=Todos os endereços de e-mails dos representantes selecionados (note que será enviada uma mensagem por fatura) +NoRemindSent=Sem lembrete de e-mail enviado +ResultOfMassSending=Resultado do lembretes de envio em massa de e-mails MailingModuleDescContactCompanies=Contatos de Fornecedores (clientes potenciais, clientes, Fornecedores...) MailingModuleDescDolibarrUsers=Usuários de Dolibarr que tem e-mail MailingModuleDescEmailsFromFile=E-Mails de um Arquivo (e-mail;Nome;Vários) @@ -57,6 +65,7 @@ LimitSendingEmailing=Observação: Envios online de mailings em massa são limit ToClearAllRecipientsClickHere=Para limpar a lista dos destinatários deste mailing, faça click ao botão ToAddRecipientsChooseHere=Para Adicionar destinatários, escoja os que figuran em listas a continuação NbOfEMailingsReceived=Mailings em massa recebidos +NbOfEMailingsSend=E-mails em massa enviados YouCanUseCommaSeparatorForSeveralRecipients=Pode usar o caracter0 de separação coma para especificar multiplos destinatários. TagCheckMail=Seguir quando o e-mail sera lido TagUnsubscribe=Atalho para se desenscrever diff --git a/htdocs/langs/pt_BR/main.lang b/htdocs/langs/pt_BR/main.lang index 3b5a071445b..753bf7aa1d3 100644 --- a/htdocs/langs/pt_BR/main.lang +++ b/htdocs/langs/pt_BR/main.lang @@ -23,7 +23,6 @@ NoError=Sem erro ErrorFieldFormat=O campo '%s' tem um valor incorreto ErrorFileDoesNotExists=O Arquivo %s não existe ErrorFailedToOpenFile=Impossível abrir o arquivo %s -ErrorUnknown=Unknown error ErrorLogoFileNotFound=O arquivo logo '%s' não se encontra ErrorFailedToSendMail=Erro ao envio do e-mail (emissor ErrorAttachedFilesDisabled=A Administração dos arquivos associados está desativada neste servidor @@ -38,8 +37,7 @@ ErrorCantLoadUserFromDolibarrDatabase=Impossível encontrar o usuário %s ErrorNoVATRateDefinedForSellerCountry=Erro, nenhum tipo de ICMS definido para o país '%s'. ErrorNoSocialContributionForSellerCountry=Erro, nenhum tipo de contribuição social definido para o pais '%s'. ErrorFailedToSaveFile=Erro, o registo do arquivo falhou. -SetDate=Set date -SelectDate=Select a date +SelectDate=Selecionar uma data SeeAlso=Ver tambem %s BackgroundColorByDefault=Cor do fundo padrão FileWasNotUploaded=O arquivo foi selecionado, mas nao foi ainda enviado. Clique no "Anexar arquivo" para proceder. @@ -59,7 +57,6 @@ RequestLastAccess=Petição último acesso e a base de dados RequestLastAccessInError=Petição último acesso e a base de dados errado ReturnCodeLastAccessInError=Código devolvido último acesso e a base de dados errado InformationLastAccessInError=informação sobre o último acesso e a base de dados errado -TechnicalInformation=Technical information PrecisionUnitIsLimitedToXDecimals=Dolibarr está configurado para limitar a precisão dos preços unitários a %s Decimais. WarningYouHaveAtLeastOneTaskLate=Atenção, tem um elemento a menos que passou a data de tolerância. yes=sim @@ -98,6 +95,7 @@ NumberByMonth=Numero por mes Limit=Límite DevelopmentTeam=Equipe de Desenvolvimento Logout=Sair +NoLogoutProcessWithAuthMode=No recurso de desconexão aplicativo com modo de autenticação Connection=Login Now=Agora DateStart=Data Inicio @@ -208,7 +206,7 @@ AmountInCurrency=Valores Apresentados em %s NbOfThirdParties=Numero de Fornecedores NbOfObjects=Numero de Objetos NbOfReferers=Numero de Referencias -Referers=Referencias +Referers=Referindo-se objetos Entities=Entidadees CustomerPreview=Historico Cliente SupplierPreview=Historico Fornecedor @@ -218,6 +216,7 @@ ShowSupplierPreview=Ver Historico Fornecedor ShowAccountancyPreview=Ver Historico Contabilidade ShowProspectPreview=Ver Historico Cliente Potencial SendByMail=Enviado por e-mail +NoMobilePhone=Sem celular Owner=Proprietário Refresh=Atualizar CanBeModifiedIfOk=Pode modificarse se é valido @@ -236,6 +235,8 @@ HidePassword=Mostrar comando com senha oculta UnHidePassword=Mostrar comando com senha e a vista AddFile=Adicionar arquivo ListOfFiles=Lista de arquivos disponiveis +FreeZone=Entrada livre +FreeLineOfType=Entrada livre de tipo CloneMainAttributes=Clonar o objeto com estes atributos PDFMerge=Fusão de PDF Merge=Fusão @@ -280,6 +281,6 @@ OriginFileName=Nome original do arquivo SetDemandReason=Escolher fonte ViewPrivateNote=Ver anotaçoes XMoreLines=%s linha(s) escondidas -PublicUrl=Public URL +PublicUrl=URL pública Saturday=Sabado SaturdayMin=Sab diff --git a/htdocs/langs/pt_BR/margins.lang b/htdocs/langs/pt_BR/margins.lang index d242c1fa544..56a1e83753d 100644 --- a/htdocs/langs/pt_BR/margins.lang +++ b/htdocs/langs/pt_BR/margins.lang @@ -10,6 +10,7 @@ margesSetup=Configuração das margens de lucro MarginDetails=Detalhes de margem ProductMargins=Margem de produtos CustomerMargins=Margems de clientes +SalesRepresentativeMargins=Tolerância aos representante de vendas ProductService=Produto ou serviço StartDate=Data inicio EndDate=Data fim @@ -26,5 +27,5 @@ MargeNette=Mergem neta MARGIN_TYPE_DETAILS=Margem grosa: Preço de venda - Preço de compra
Margem neta: Preço de venda - Preço de custo UnitCharges=Taxas unitárias Charges=Despesas -AgentContactType=Tipo contato usado para comissoes -AgentContactTypeDetails=Define qual tipo (ligado as faturas) sera asociado com os agentes comerciais +AgentContactType=Tipo contato do agente comercial +AgentContactTypeDetails=Define o tipo de contato (conectado as faturas) sera usado para relatorio de margem dos agentes comerciais diff --git a/htdocs/langs/pt_BR/members.lang b/htdocs/langs/pt_BR/members.lang index 03ef04fcc56..ae3ad502035 100644 --- a/htdocs/langs/pt_BR/members.lang +++ b/htdocs/langs/pt_BR/members.lang @@ -1,5 +1,11 @@ # Dolibarr language file - Source file is en_US - members UserNotLinkedToMember=Usuário não vinculado a um membro +ThirdpartyNotLinkedToMember=Fornecedores não ligados a um membro +ErrorMemberIsAlreadyLinkedToThisThirdParty=Outro membro já está vinculado a um terceiro. Remover este link em primeiro lugar porque um terceiro não pode ser ligado a apenas um membro (e vice-versa). +ErrorUserPermissionAllowsToLinksToItselfOnly=Por razões de segurança, você deve ter permissões para editar todos os usuários sejam capazes de ligar um membro a um usuário que não é seu. +ThisIsContentOfYourCard=Este é os detalhes do seu cartão +CardContent=Conteúdo da sua ficha de membro +SetLinkToThirdParty=Link para um fornecedor Dolibarr MembersListResiliated=Lista dos Membros cancelados MenuMembersUpToDate=Membros ao día MenuMembersNotUpToDate=Membros não ao día @@ -16,12 +22,19 @@ SearchAMember=procurar um membro MemberStatusDraft=rascunho (a Confirmar) MemberStatusActiveLate=filiação não à día MemberStatusActiveLateShort=não à día +MemberStatusPaid=Assinatura em dia +MemberStatusPaidShort=Até à data MemberStatusResiliated=membro dado de baixa +MembersStatusPaid=Assinatura em dia +MembersStatusPaidShort=Até à data +MembersStatusNotPaid=Assinatura desatualizado +MembersStatusNotPaidShort=Expirada MembersStatusResiliated=Membros cancelados MembersStatusResiliatedShort=Membros cancelados PaymentSubscription=Subscrição de Pagamento EditMember=edição membro SubscriptionEndDate=data final filiação +NewSubscriptionDesc=Este formulário permite que você grave a sua assinatura como um novo membro da fundação. Se você quiser renovar a sua assinatura (se já for membro), por favor, entre em contato com Conselho de Fundadores não por e-mail. Subscriptions=Filiações SubscriptionLate=Em Atraso SubscriptionNotReceived=filiação não recibida @@ -40,17 +53,53 @@ ConfirmValidateMember=Tem certeza que quer Confirmar a este membro? FollowingLinksArePublic=os vínculos seguintes são páginas acessiveis a todos e não protegidas por Nenhuma habilitação Dolibarr. PublicMemberList=Lista público de Membros BlankSubscriptionForm=Formulário de inscrição +BlankSubscriptionFormDesc=Dolibarr pode fornecer uma URL pública para permitir que os visitantes externos de pedir para se inscrever para a fundação. Se um módulo de pagamento on-line estiver ativado, uma forma de pagamento também será fornecido automaticamente. +EnablePublicSubscriptionForm=Habilite a forma pública auto-assinatura ExportDataset_member_1=Membros e Filiações +LastSubscriptionsModified=Assinaturas Últimas modificadas Date=Data MemberNotOrNoMoreExpectedToSubscribe=não submetida a cotação MemberModifiedInDolibarr=membro modificado em Dolibarr DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Assunto do email em caso de inscrição automática DescADHERENT_AUTOREGISTER_MAIL=Email a enviar em caso de convite para inscrição automática +DescADHERENT_ETIQUETTE_TEXT=Texto impresso em folhas de endereço de membros +DescADHERENT_CARD_TYPE=Formato da página fichas +DescADHERENT_CARD_TEXT_RIGHT=Texto impresso em cartões de membros (alinhar à direita) +GlobalConfigUsedIfNotDefined=Texto definido na configuração do módulo fundação será usada se não for definido aqui +MayBeOverwrited=Este texto pode ser sobrescrito pelo valor definido para o tipo de membro HTPasswordExport=geração Arquivo htpassword NoThirdPartyAssociatedToMember=nenhum Fornecedor associado a este membro ThirdPartyDolibarr=Fornecedores Dolibarr MembersAndSubscriptions=Membros e Subscrições +MoreActions=Ação complementar em gravação +MoreActionsOnSubscription=Ação complementar, sugerido por padrão durante a gravação de uma assinatura +LinkToGeneratedPages=Gerar cartões de visitas +LinkToGeneratedPagesDesc=Esta tela permite gerar arquivos PDF com cartões de visita para todos os seus membros ou um membro particular. +DocForAllMembersCards=Gerar cartões de visita para todos os membros +DocForOneMemberCards=Gerar cartões de visita para um determinado membro +DocForLabels=Gerar folhas de endereço LastSubscriptionDate=Data da Última Adesão LastSubscriptionAmount=Valor Última Adesão +MembersStatisticsByRegion=Membros por região estatísticas +NoValidatedMemberYet=Nenhum membro validados encontrado +MembersByCountryDesc=Esta tela mostrará estatísticas sobre usuários por países. Gráfico depende, contudo, do Google serviço gráfico on-line e está disponível apenas se uma conexão à Internet é está funcionando. +MembersByStateDesc=Esta tela mostrará estatísticas sobre usuários por estado / província / cantão. +MembersByTownDesc=Esta tela mostrará estatísticas sobre usuários por cidade. +MembersStatisticsDesc=Escolha as estatísticas que você quer ler ... MenuMembersStats=Estatísticas +LastMemberDate=Data do membro Nature=Tipo de produto +Public=Informações são públicas +NewMemberbyWeb=Novo membro adicionado. Aguardando aprovação +NewMemberForm=Formulário para novo membro +NbOfSubscriptions=Número de inscrições +TurnoverOrBudget=Volume de negócios (para uma empresa) ou de orçamento (para uma fundação) +CanEditAmount=Visitante pode escolher/editar quantidade da sua subscrição +MEMBER_NEWFORM_PAYONLINE=Ir na página de pagamento online integrado +DOLIBARRFOUNDATION_PAYMENT_FORM=Para fazer o seu pagamento de assinatura usando uma transferência bancária, consulte a página
http://wiki.dolibarr.org/index.php/Subscribe .
Para pagar utilizando um cartão de crédito ou Paypal, clique no botão na parte inferior desta página.
+ByProperties=Por características +MembersStatisticsByProperties=Membros estatísticas por características +MembersByNature=Membros, por natureza, +VATToUseForSubscriptions=Taxa de VAT para utilizar as assinaturas +NoVatOnSubscription=Não TVA para assinaturas +MEMBER_PAYONLINE_SENDEMAIL=E-mail para avisar quando Dolibarr receber uma confirmação de um pagamento validados para subscrição diff --git a/htdocs/langs/pt_BR/opensurvey.lang b/htdocs/langs/pt_BR/opensurvey.lang index 0af7f264904..d3f3b24aced 100644 --- a/htdocs/langs/pt_BR/opensurvey.lang +++ b/htdocs/langs/pt_BR/opensurvey.lang @@ -4,4 +4,22 @@ CreatePoll=Criar uma enquete PollTitle=Titulo enquete TypeDate=Tipo data TypeClassic=Tipo estandard +CommentsOfVoters=Comentários de eleitores +ConfirmRemovalOfPoll=Você tem certeza que deseja remover este voto (e todos os votos) +RemovePoll=Remover enquete +CheckBox=Checkbox Simples +YesNoList=Lista (vazio/sim/não) +PourContreList=Lista (vazio / a favor / contra) +ExportSpreadsheet=Planilha resultado Export ExpireDate=Data Límite +NbOfVoters=Nr. de eleitores +SurveyResults=Resultado +YouAreInivitedToVote=Você foi convidado para votar nesta enquete +ErrorPollDoesNotExists=Erro, enquete% s não existe. +AddEndHour=Adicionar hora final +votes=voto(s) +NoCommentYet=Nenhum comentário foi publicado para este voto ainda +CanEditVotes=Posso mudar voto de outras pessoas +CanComment=Os eleitores podem comentar na enquete +ErrorOpenSurveyDateFormat=A data deve ter o formato AAAA-MM-DD +SurveyExpiredInfo=O período de votação desta enquete expirou. diff --git a/htdocs/langs/pt_BR/orders.lang b/htdocs/langs/pt_BR/orders.lang index a78b096c812..0aa1fdc97e7 100644 --- a/htdocs/langs/pt_BR/orders.lang +++ b/htdocs/langs/pt_BR/orders.lang @@ -16,6 +16,7 @@ ShippingExist=Existe envio DraftOrWaitingApproved=Rascunho aprovado mas ainda não controlado MenuOrdersToBill=Pedidos por Faturar MenuOrdersToBill2=Pedidos a se faturar +SearchACustomerOrder=Procure um pedido do cliente UnvalidateOrder=Desaprovar pedido AddToDraftOrders=Adicionar a projeto de pedido NoDraftOrders=Não há projetos de pedidos @@ -55,6 +56,7 @@ OrderSource3=Campanha telefônica AddDeliveryCostLine=Adicionar uma linha de despesas de fretes indicando o peso do pedido PDFEinsteinDescription=Modelo de pedido completo (logo...) PDFEdisonDescription=O modelo simplificado do pedido +PDFProformaDescription=A proforma fatura completa (logomarca...) OrderByEMail=E-mail OrderByWWW=Online CreateInvoiceForThisCustomer=Faturar pedidos @@ -65,3 +67,4 @@ Ordered=Pedido OrderCreated=Seus pedidos foram criados OrderFail=Um erro ocorreu durante a criação de seus pedidos CreateOrders=Criar pedidos +ToBillSeveralOrderSelectCustomer=Para criar uma nota fiscal para várias encomendas, clique primeiro no cliente, em seguida, escolha "%s". diff --git a/htdocs/langs/pt_BR/other.lang b/htdocs/langs/pt_BR/other.lang index e39010be6a3..6eb1573ace5 100644 --- a/htdocs/langs/pt_BR/other.lang +++ b/htdocs/langs/pt_BR/other.lang @@ -3,7 +3,8 @@ SecurityCode=Código Segurança AddTrip=Criar Deslocamento ToolsDesc=Esta area e dedicada para o grupo de ferramentas varias não disponivel em outros menus.

Estas ferramentas podem se acionar atraves do menu ao lado. Birthday=Aniversário -BirthdayDate=Data Aniversário +BirthdayDate=Data de aniversário +DateToBirth=Data de nascimento BirthdayAlertOn=Alerta de aniversário ativo BirthdayAlertOff=Alerta de aniversário desativado Notify_FICHINTER_VALIDATE=Intervenção validada @@ -14,10 +15,13 @@ Notify_ORDER_SUPPLIER_APPROVE=Pedido fornecedor aprovado Notify_ORDER_SUPPLIER_REFUSE=Pedido fornecedor recusado Notify_ORDER_VALIDATE=Pedido cliente validado Notify_PROPAL_VALIDATE=Proposta cliente validada +Notify_PROPAL_CLOSE_SIGNED=Propal Cliente fechado assinado +Notify_PROPAL_CLOSE_REFUSED=Propal Cliente fechado recusou Notify_WITHDRAW_TRANSMIT=Revogação de transmissão Notify_WITHDRAW_CREDIT=Revogação de credito Notify_WITHDRAW_EMIT=Revogação de performance Notify_ORDER_SENTBYMAIL=Pedido cliente enviado por e-mail +Notify_COMPANY_SENTBYMAIL=E-mails enviados a partir do cartão de terceiros Notify_PROPAL_SENTBYMAIL=Proposta comercial enviada por e-mail Notify_BILL_PAYED=Fatura cliente paga Notify_BILL_CANCEL=Fatura cliente cancelada @@ -27,24 +31,28 @@ Notify_ORDER_SUPPLIER_SENTBYMAIL=Pedido fornecedor enviado por e-mail Notify_BILL_SUPPLIER_VALIDATE=Fatura fornecedor validada Notify_BILL_SUPPLIER_PAYED=Fatura fornecedor paga Notify_BILL_SUPPLIER_SENTBYMAIL=Fatura fornecedor enviada por e-mail +Notify_BILL_SUPPLIER_CANCELED=Fornecedor fatura cancelada Notify_FICHEINTER_VALIDATE=Intervenção validada Notify_SHIPPING_VALIDATE=Envio validado Notify_SHIPPING_SENTBYMAIL=Envio enviado por e-mail Notify_MEMBER_SUBSCRIPTION=Membro inscrito Notify_MEMBER_RESILIATE=Membro resiliado Notify_MEMBER_DELETE=Membro apagado +Notify_PROJECT_CREATE=criação de projeto +Notify_TASK_CREATE=Tarefa criada +Notify_TASK_MODIFY=Tarefa alterada +Notify_TASK_DELETE=Tarefa excluída TotalSizeOfAttachedFiles=Tamanho Total dos Arquivos/Documentos Anexos LinkedObject=Arquivo Anexo PredefinedMailTest=Esse e um teste de envio.⏎\nAs duas linhas estao separadas por retono de linha.⏎\n⏎\n__SIGNATURE__ PredefinedMailTestHtml=Esse e um email de teste (a palavra test deve ser em bold).
As duas linhas estao separadas por retorno de linha.

__SIGNATURE__ -PredefinedMailContentSendInvoice=Estimado __CONTACTCIVNAME__ ,\n\nem anexo enviamos a nossa fatura __FACREF__ .\n\n__PERSONALIZED__\nAtenciosamente\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Estimado __CONTACTCIVNAME__ ,\n\ninformamos que a fatura __FACREF__ nos consta como não paga. Por favor revisar a fatura anexada e nos dar uma posicao.\n\n__PERSONALIZED__\nAtenciosamente\n__SIGNATURE__ -PredefinedMailContentSendProposal=Estimado __CONTACTCIVNAME__ ,\n\nem anexo enviamos a proposta solicitada __PROPREF__ .\n\n__PERSONALIZED__\nAtenciosamente\n__SIGNATURE__ -PredefinedMailContentSendOrder=Estimado __CONTACTCIVNAME__ ,\n\nem anexo segue o pedido solicitado __ORDERREF__ .\n\n__PERSONALIZED__\nAtenciosamente\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Estimado __CONTACTCIVNAME__ , \n⏎\nem anexo segue a nossa ordem __ORDERREF__⏎\n⏎\n__PERSONALIZED__\nAtenciosamente⏎\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Estimado __CONTACTCIVNAME__ , ⏎\n⏎\nem anexo segue a nossa fatura __FACREF__.⏎\n⏎\n__PERSONALIZED__\nAtenciosamente⏎\n__SIGNATURE__ -PredefinedMailContentSendShipping=Estimado __CONTACTCIVNAME__ ,⏎\n⏎\nem anexo segue o envio referencia __SHIPPINGREF__⏎\n⏎\n__PERSONALIZED__\nAtenciosamente⏎\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Estimado __CONTACTCIVNAME__ ,⏎\n⏎\nSegue em anexo a intervencao __FICHINTERREF__⏎\n⏎\n__PERSONALIZED__\nAtenciosamente⏎\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ Você vai encontrar aqui a factura __ FACREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__ CONTACTCIV NAM E__ Gostaríamos de avisar que a fatura __ FACREF__ parece não ter sido pago. Portanto, esta é a fatura em anexo novamente, como um lembrete. __PERSONALIZED __ Sincerely __ SIGNATURE __ +PredefinedMailContentSendProposal=__ CONTACTCIV NAME__ Você vai encontrar aqui a proposta comercial __ PROPREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIV NAME__ Você vai encontrar aqui a ordem __ ORDERREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ Você vai encontrar aqui o nosso pedido __ ORDERREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ Você vai encontrar aqui a factura __ FACREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ Você vai encontrar aqui o envio __ SHIPPINGREF__ __ PERSONALIZED__Sincerely __ SIGNATURE__ DemoDesc=Dolibarr não é um ERP monolítico, mas está composto de módulos funcionais simples e opcionais. Uma demonstração que inclua todos estes módulos não tem sentido, já que nunca mais todos os módulos são utilizados. De todas maneras existe disponíveis muitos perfis de demonstração ChooseYourDemoProfil=Escalha o perfil demo que mais se adequa as sua atividade.... DemoFundation=Administração de Membros de uma associação @@ -76,8 +84,10 @@ EnableGDLibraryDesc=deve ativar o instalar a Bibliotéca GD na sua PHP para pode EnablePhpAVModuleDesc=deve instalar um módulo PHP compatible com a sua antivírus. (Clamav : php4-clamavlib ó php5-clamavlib) ProfIdShortDesc=Prof Id %s é uma informação dePendente do país do Fornecedor.
Por Exemplo, para o país %s, é o código %s. NumberOfCustomerInvoices=Número de faturas a clientes nos últimos 12 meses +NumberOfSupplierOrders=Numero de pedidos dos fornecedores nos ultimos 12 meses NumberOfSupplierInvoices=Número de faturas de Fornecedores nos últimos 12 meses NumberOfUnitsCustomerInvoices=Número de unidades em faturas a clientes nos últimos 12 meses +NumberOfUnitsSupplierOrders=Numero de unidades nos pedidos a fornecedor nos ultimos 12 meses NumberOfUnitsSupplierInvoices=Número de unidades em faturas de Fornecedores nos últimos 12 meses EMailTextInterventionValidated=A intervenção %s foi validada EMailTextInvoiceValidated=A fatura %s foi validada. @@ -100,6 +110,12 @@ SelectAColor=Escolha a cor StartUpload=Iniciar o "upload" CancelUpload=Cancelar o "upload" FileIsTooBig=Tamanho do arquivo grande de mais +RequestToResetPasswordReceived=Recebemos a pedido de mudar a sua senha do Dolibarr +NewKeyIs=Estas sao as suas novas chaves de acesso +NewKeyWillBe=Sua nova chave de acesso do software sera +ClickHereToGoTo=Clickar aqui para ir a %s +YouMustClickToChange=Voce tem que clickar no seguinte atalho para validar a sua troca de senha +ForgetIfNothing=Se voce nao pediu esta mudanca, simplismente esquece deste email. Suas credenciais estao seguras. AddCalendarEntry=Adicionar entrada ao calendário ContractValidatedInDolibarr=Contrato %s Confirmado ContractCanceledInDolibarr=Contrato %s Cancelado diff --git a/htdocs/langs/pt_BR/paypal.lang b/htdocs/langs/pt_BR/paypal.lang index 0234a965e9e..c9d3eba7af7 100644 --- a/htdocs/langs/pt_BR/paypal.lang +++ b/htdocs/langs/pt_BR/paypal.lang @@ -18,3 +18,6 @@ PredefinedMailContentLink=Clique no link seguro abaixo para fazer o pagamento (P YouAreCurrentlyInSandboxMode=No momento esta no modo "caixa de areia" NewPaypalPaymentFailed=Tentado novo pagamento Paypal mas sem hesito. PAYPAL_PAYONLINE_SENDEMAIL=Endereço e-mail para aviso apos o pagamento (positivo ou nao) +ReturnURLAfterPayment=Retornar URL após o pagamento +ValidationOfPaypalPaymentFailed=Validação do pagamento do Paypal falhou +PaypalConfirmPaymentPageWasCalledButFailed=Pagamento completo mas nenhum pagamento foi recebido no PayPal diff --git a/htdocs/langs/pt_BR/products.lang b/htdocs/langs/pt_BR/products.lang index 768ae7bcb34..30771083e0d 100644 --- a/htdocs/langs/pt_BR/products.lang +++ b/htdocs/langs/pt_BR/products.lang @@ -1,8 +1,14 @@ # Dolibarr language file - Source file is en_US - products -ProductRef=Ref. Produto +ProductRef=Ref produto. ProductLabel=Nome do Produto +ProductVatMassChange=Mudança VAT Massa +ProductVatMassChangeDesc=Esta página pode ser utilizado para modificar uma taxa VAT definido em produtos ou serviços a partir de um valor para outro. Atenção, esta mudança é feita em todos os banco de dados. +MassBarcodeInit=Inicialização de código de barras. +MassBarcodeInitDesc=Esta página pode ser usado para inicializar um código de barras em objetos que não têm código de barras definidas. Verifique antes que a instalação do módulo de código de barras é completa. ProductAccountancyBuyCode=Codigo contabilidade (compras) ProductAccountancySellCode=Codigo contabilidade (vendas) +ProductsOnSellAndOnBuy=Produtos não para venda ou compra +ServicesOnSellAndOnBuy=Serviços não para venda ou compra LastRecorded=últimos Produtos/Serviços em Venda Registados LastRecordedProductsAndServices=Os %s últimos Produtos/Perviços Registados LastModifiedProductsAndServices=Os %s últimos Produtos/Serviços Registados @@ -23,6 +29,8 @@ SellingPriceTTC=Preço de venda (incl. taxas) CurrentPrice=Preço atual NewPrice=Novo Preço MinPrice=Preço mínimo de venda +MinPriceHT=Minimo preço de venda (líquido de imposto) +MinPriceTTC=Minimo preço de venda (inc. taxa) CantBeLessThanMinPrice=O preço de venda não deve ser inferior ao mínimo para este produto (%s ICMS) ContractStatusClosed=Encerrado ErrorProductBadRefOrLabel=O valor da referencia ou etiqueta é incorreto @@ -32,6 +40,7 @@ AddToOtherBills=Adicionar a Outras faturas AllWays=Rota para encontrar o sua produto ao estoque NoCat=O sua produto não pertence a nenhuma categoria NoteNotVisibleOnBill=Nota (Não é visivel as faturas, orçamentos, etc.) +MultiPricesAbility=Vários preços por produto / serviço MultiPricesNumPrices=Numero de preços MultiPriceLevelsName=Categoria de preços AssociatedProductsAbility=Ativar produtos associados @@ -53,6 +62,12 @@ PriceQtyMin=Preco para esta qtd min. (sem desconto) VATRateForSupplierProduct=Percentual ICMS (para este fornecedor/produto) DiscountQtyMin=Desconto padrao para qtd RecordedServices=Serviços gravados +PredefinedProductsToSell=Produtos pré-definidas para vender +PredefinedServicesToSell=Serviços predefinidos para vender +PredefinedProductsAndServicesToSell=Produtos / serviços pré-definidas para vender +PredefinedProductsToPurchase=Produto pré-definidas para compra +PredefinedServicesToPurchase=Serviços pré-definidos para compra +PredefinedProductsAndServicesToPurchase=Produtos / serviços predefinidos para compra. ServiceNb=Serviço n� %s ListProductServiceByPopularity=Lista de produtos/serviços por popularidade ListProductByPopularity=Lista de produtos por popularidade @@ -63,13 +78,17 @@ CloneProduct=Clonar produto ou serviço ConfirmCloneProduct=Voce tem certeza que deseja clonar o produto ou servico %s ? CloneContentProduct=Clonar todas as principais informações de um produto/serviço ClonePricesProduct=Clonar principais informações e preços +CloneCompositionProduct=Produtos / serviços copias virtuais ProductIsUsed=Este produto é usado NewRefForClone=Ref. do novo produto/serviço CustomerPrices=Preços de clientes SuppliersPrices=Preços de fornecedores +SuppliersPricesOfProductsOrServices=Preços (de produtos ou serviços) Fornecedores CustomCode=Codigo NCM CountryOrigin=Pais de origem HiddenIntoCombo=Escondido nas listas de seleções +ProductCodeModel=Modelo de ref. de produto +ServiceCodeModel=Modelo de ref. de serviço AddThisProductCard=Criar ficha produto HelpAddThisProductCard=Esta opção permite de criar ou clonar um produto caso nao exista. AddThisServiceCard=Criar ficha serviço @@ -88,6 +107,7 @@ UnitPmp=Unidades VWAP CostPmpHT=Total unidades VWAP ProductUsedForBuild=Automaticamente consumidos pela produção ProductBuilded=Produção completada +ProductsOrServiceMultiPrice=Preços Clientes (de produtos ou serviços, multi-preços) ProductSellByQuarterHT=Total de produtos vendidos no trimestre ServiceSellByQuarterHT=Total de servicos vendidos no trimestre Quarter1=1° Trimestre @@ -95,14 +115,20 @@ Quarter2=2° Trimestre Quarter3=3° Trimestre Quarter4=4° Trimestre BarCodePrintsheet=Imprimir codigo de barras +PageToGenerateBarCodeSheets=Com esta ferramenta, você pode imprimir folhas de etiquetas de código de barras. Escolha o formato de sua página de etiqueta, tipo de código de barras e valor de código de barras, em seguida, clique no botão% s. NumberOfStickers=Numero de etiquetas a se imprimir numa pagina PrintsheetForOneBarCode=Imprimir varias etiquetas para um codigo de barras BuildPageToPrint=Gerar pagina a se imprimir FillBarCodeTypeAndValueManually=Preencher codigo de barras e valor manualmente. -BarCodeDataForProduct=Barcode information of product %s : -BarCodeDataForThirdparty=Barcode information of thirdparty %s : -PriceByCustomer=Price by customer -PriceCatalogue=Unique price per product/service -PricingRule=Pricing Rules -AddCustomerPrice=Add price by customers -PriceByCustomerLog=Price by customer log +FillBarCodeTypeAndValueFromProduct=Preencha o código de barras e valor a partir do código de barras de um produto. +FillBarCodeTypeAndValueFromThirdParty=Preencha o código de barras e valor a partir do código de barras de um fornecedor. +DefinitionOfBarCodeForProductNotComplete=Definição do código ou valor do código de barras não completar para o produto% s. +DefinitionOfBarCodeForThirdpartyNotComplete=Definição do código ou valor do código não completa para fornecedor% s. +BarCodeDataForProduct=Informações de código de barras do produto% s: +BarCodeDataForThirdparty=Informações de código de barras do fornecedor: +ResetBarcodeForAllRecords=Definir o valor de código de barras para todos os registros (isto também irá repor valor de código de barras já definido com novos valores) +PriceCatalogue=Preço único por produto / serviço +PricingRule=As regras de tarifação +AddCustomerPrice=Adicione preço por parte dos clientes +ForceUpdateChildPriceSoc=Situado mesmo preço em outros pedidos dos clientes +PriceByCustomerLog=Preço por cliente diff --git a/htdocs/langs/pt_BR/projects.lang b/htdocs/langs/pt_BR/projects.lang index 58ea5b37023..3fc16bb3b6c 100644 --- a/htdocs/langs/pt_BR/projects.lang +++ b/htdocs/langs/pt_BR/projects.lang @@ -1,6 +1,13 @@ # Dolibarr language file - Source file is en_US - projects +ProjectId=Id do projeto SharedProject=Projeto Compartilhado PrivateProject=Contatos do Projeto +MyProjectsDesc=Exibe apenas os projetos você for um contato(seja qual for o tipo). +ProjectsPublicDesc=Exibe todos os projetos que esta autorizado a ver. +ProjectsDesc=Essa exibição apresenta todos os projetos (suas permissões de usuário conceder-lhe permissão para ver tudo). +MyTasksDesc=Esta exibição é limitado a projetos ou tarefas que você é um contato (seja qual for o tipo). +TasksPublicDesc=Essa exibição apresenta todos os projetos e tarefas que você tem permissão para ler. +TasksDesc=Essa exibição apresenta todos os projetos e tarefas (suas permissões de usuário concede-lhe ver tudo). Myprojects=Os Meus Projetos AddProject=Criar Projeto ConfirmDeleteAProject=Tem certeza que quer eliminar este projeto? @@ -11,21 +18,70 @@ ShowProject=Adicionar Projeto NbOpenTasks=No Tarefas Abertas NbOfProjects=No de Projetos TimeSpent=Tempo Dedicado +TimesSpent=Tempo gasto RefTask=Ref. Tarefa +TaskTimeSpent=O tempo gasto nas tarefas +TaskTimeUser=Usuário NewTimeSpent=Novo Tempo Dedicado MyTimeSpent=O Meu Tempo Dedicado MyTasks=As minhas Tarefas +TaskDateStart=Data de início da tarefa +TaskDateEnd=Data final da tarefa AddDuration=Indicar Duração MyActivity=A Minha Atividade MyActivities=Minhas Tarefas/Atividades MyProjects=Os Meus Projetos +ProgressDeclared=o progresso declarado +ProgressCalculated=calculado do progresso ListOrdersAssociatedProject=Lista de Pedidos Associados ao Projeto ListSupplierInvoicesAssociatedProject=Lista de Faturas de Fornecedor Associados ao Projeto +ListTripAssociatedProject=Lista de viagens e despesas associadas com o projeto ActivityOnProjectThisWeek=Atividade ao Projeto esta Semana ActivityOnProjectThisMonth=Atividade ao Projeto este Mês ActivityOnProjectThisYear=Atividade ao Projeto este Ano ChildOfTask=Link da Tarefa NotOwnerOfProject=Não é responsável deste projeto privado CantRemoveProject=Este projeto não pode ser eliminado porque está referenciado por muito objetos (facturas, pedidos e outros). ver a lista no separador referencias. +ValidateProject=Validar projeto +ConfirmValidateProject=Você tem certeza que deseja validar esse projeto? +ConfirmCloseAProject=Tem certeza de que quer encerrar esse projeto? +ReOpenAProject=Abrir projeto +ConfirmReOpenAProject=Tem certeza de que quer voltar a abrir este projeto? +ProjectContact=Contatos do projeto +ActionsOnProject=Eventos do projeto +YouAreNotContactOfProject=Você não é um contato deste projeto privado +ConfirmDeleteATimeSpent=Tem certeza de que deseja excluir este tempo? +DoNotShowMyTasksOnly=Veja também as tarefas não alocada para mim +ShowMyTasksOnly=Ver apenas tarefas que me forem atribuídos +NoTasks=Não há tarefas para este projeto +LinkedToAnotherCompany=Ligado a outros terceiros +TaskIsNotAffectedToYou=Tarefa não alocado para você +ErrorTimeSpentIsEmpty=Tempo gasto está vazio +ThisWillAlsoRemoveTasks=Esta ação também vai apagar todas as tarefas do projeto (tarefas% s no momento) e todas as entradas de tempo gasto. +IfNeedToUseOhterObjectKeepEmpty=Se alguns objetos (nota fiscal, ordem, ...), pertencentes a um terceiro, deve estar vinculado ao projeto de criar, manter este vazio para que o projeto de vários fornecedores. +CloneProject=Copiar projeto +CloneTasks=Copiar tarefas +CloneContacts=Copiar contatos +CloneNotes=Copiar notas +CloneProjectFiles=Copiar arquivos do projetos +CloneTaskFiles=Copia(s) do(s) arquivo(s) do projeto(s) finalizado +ConfirmCloneProject=Tem certeza que deseja copiar este projeto? +ProjectReportDate=Alterar a data da tarefa de acordo com a data de início do projeto +ErrorShiftTaskDate=Impossível mudar data da tarefa de acordo com a nova data de início do projeto +TaskCreatedInDolibarr=Tarefa %s criada +TaskModifiedInDolibarr=Tarefa %s alterada +TaskDeletedInDolibarr=Tarefa %s excluída TypeContact_project_internal_PROJECTLEADER=Chefe de projeto TypeContact_project_external_PROJECTLEADER=Chefe de projeto +TypeContact_project_internal_PROJECTCONTRIBUTOR=Colaborador +TypeContact_project_external_PROJECTCONTRIBUTOR=Colaborador +TypeContact_project_task_internal_TASKEXECUTIVE=Tarefa executada +TypeContact_project_task_external_TASKEXECUTIVE=Tarefa executada +TypeContact_project_task_internal_TASKCONTRIBUTOR=Colaborador +TypeContact_project_task_external_TASKCONTRIBUTOR=Colaborador +SelectElement=Selecionar componente +AddElement=Link para componente +DocumentModelBaleine=Modelo de relatório de um projeto completo (logo. ..) +PlannedWorkload =carga horária planejada +WorkloadOccupation=Carga horária empregada +ProjectReferers=Fazendo referência a objetos diff --git a/htdocs/langs/pt_BR/shop.lang b/htdocs/langs/pt_BR/shop.lang index 1d6a79d78ea..82aed1ab666 100644 --- a/htdocs/langs/pt_BR/shop.lang +++ b/htdocs/langs/pt_BR/shop.lang @@ -1,2 +1,3 @@ # Dolibarr language file - Source file is en_US - shop +FailedConnectDBCheckModuleSetup=Falha na conexão com banco de dados do osCommerce. Verifique a configuração do módulo LastCustomers=últimos clientes diff --git a/htdocs/langs/pt_BR/stocks.lang b/htdocs/langs/pt_BR/stocks.lang index 6a7aa57fb5b..3d27d28b0ef 100644 --- a/htdocs/langs/pt_BR/stocks.lang +++ b/htdocs/langs/pt_BR/stocks.lang @@ -3,44 +3,46 @@ WarehouseCard=Ficha Armazém Warehouse=Armazém Warehouses=Armazens NewWarehouse=Novo Armazém ou Zona de Armazenagem -WarehouseEdit=Modify warehouse +WarehouseEdit=modificar armazém MenuNewWarehouse=Novo Armazém WarehouseOpened=Armazém Aberto WarehouseClosed=Armazém Encerrado WarehouseSource=Armazém Origem -WarehouseSourceNotDefined=No warehouse defined, -AddOne=Add one -WarehouseTarget=Armazém Destino +WarehouseSourceNotDefined=Sem armazém definido, +WarehouseTarget=Destino do armazenamento ValidateSending=Confirmar Envio CancelSending=Cancelar Envio DeleteSending=Eliminar Envio Stock=Estoque Stocks=Estoques -ErrorWarehouseRefRequired=O nome de referencia do armazém é obrigatório -ErrorWarehouseLabelRequired=A etiqueta do armazém é obrigatória +ErrorWarehouseRefRequired=Nome de referência do armazenamento é necessária +ErrorWarehouseLabelRequired=A etiqueta do armazenamento é obrigatória CorrectStock=Corrigir Estoque -ListOfStockMovements=Lista de movimentos de estoque +ListOfWarehouses=Lista de armazenamento StocksArea=Área estoques +NumberOfDifferentProducts=Número de produtos diferentes StockCorrection=Correção estoque +StockTransfer=Banco de transferência StockMovements=Movimentos de estoque -UnitPurchaseValue=Unit purchase price +LabelMovement=Etiqueta Movimento +UnitPurchaseValue=Preço de compra da unidade TotalStock=Total em estoque StockTooLow=Estoque insuficiente -StockLowerThanLimit=Stock lower than alert limit +StockLowerThanLimit=Da ação inferior limite de alerta EnhancedValueOfWarehouses=Valor de estoques UserWarehouseAutoCreate=Criar existencias automaticamente na criação de um usuário OrderDispatch=Recepção de estoques RuleForStockManagementDecrease=Regra de Administração de decrementos de estoque RuleForStockManagementIncrease=Regra de Administração de incrementos de estoque -DeStockOnBill=Decrementar os estoques físicos sobre as faturas/recibos +DeStockOnBill=Diminuir ações reais em clientes validação facturas / notas de crédito DeStockOnValidateOrder=Decrementar os estoques físicos sobre os pedidos DeStockOnShipment=Decrementar os estoques físicos sobre os envios (recomendado) ReStockOnBill=Incrementar os estoques físicos sobre as faturas/recibos ReStockOnValidateOrder=Incrementar os estoques físicos sobre os pedidos -ReStockOnDispatchOrder=Increase real stocks on manual dispatching into warehouses, after supplier order receiving -OrderStatusNotReadyToDispatch=Order has not yet or no more a status that allows dispatching of products in stock warehouses. -NoPredefinedProductToDispatch=No predefined products for this object. So no dispatching in stock is required. -DispatchVerb=Dispatch +ReStockOnDispatchOrder=Aumentar os estoques reais no envio manual para armazenamento, depois de receber ordem fornecedor +ReStockOnDeleteInvoice=Aumentar os estoques reais sobre exclusão fatura +OrderStatusNotReadyToDispatch=Não tem ordem ainda não ou nato tem um status que permite envio de produtos em para armazenamento. +NoPredefinedProductToDispatch=Não há produtos pré-definidos para este objeto. Portanto, não envio em estoque é necessária. PhysicalStock=Estoque físico RealStock=Estoque real VirtualStock=Estoque virtual @@ -48,22 +50,51 @@ MininumStock=Estoque mínimo StockUp=Estoque máximo MininumStockShort=Estoque min. StockUpShort=Estoque max. -IdWarehouse=Id. armazém -DescWareHouse=Descrição armazém -LieuWareHouse=Localização armazém -AverageUnitPricePMPShort=Weighted average input price -AverageUnitPricePMP=Weighted average input price -SellPriceMin=Selling Unit Price -EstimatedStockValueSellShort=Value to sell -EstimatedStockValueSell=Value to Sell -EstimatedStockValueShort=Input stock value -EstimatedStockValue=Input stock value -DeleteAWarehouse=Delete a warehouse -ConfirmDeleteWarehouse=Are you sure you want to delete the warehouse %s ? -PersonalStock=Personal stock %s -ThisWarehouseIsPersonalStock=This warehouse represents personal stock of %s %s -SelectWarehouseForStockDecrease=Choose warehouse to use for stock decrease -SelectWarehouseForStockIncrease=Choose warehouse to use for stock increase -DesiredStock=Desired stock -AlertOnly=Alerts only -ForThisWarehouse=For this warehouse +IdWarehouse=Id. armazenamento +DescWareHouse=Descrição do armazenamento +LieuWareHouse=Localização do armazenamento +WarehousesAndProducts=Armazenamento de produtos +AverageUnitPricePMPShort=Preço médio de entrada +AverageUnitPricePMP=Preço médio de entrada +SellPriceMin=Venda Preço unitário +EstimatedStockValueShort=O valor das ações de entrada +EstimatedStockValue=O valor das ações de entrada +DeleteAWarehouse=Excluir um arquivo +ConfirmDeleteWarehouse=Tem certeza de que deseja apagar o arquivo +PersonalStock=Estoque Pessoal +ThisWarehouseIsPersonalStock=Este armazenamento representa estoque pessoal de: +SelectWarehouseForStockDecrease=Escolha arquivo para usar a redução estoque +SelectWarehouseForStockIncrease=Escolha arquivo para usar no aumento de estoque +NoStockAction=Nenhuma estoque +LastWaitingSupplierOrders=Encomendas à espera de recepções +DesiredStock=Estoque desejado +StockToBuy=Para encomendar +Replenishment=Reabastecimento +ReplenishmentOrders=Pedidos de reposição +VirtualDiffersFromPhysical=De acordo com a aumentar / diminuir opções de ações, estoque físico e virtual de estoque (ordens físicas + correntes) poderão diferir +UseVirtualStockByDefault=Use estoque virtuais por padrão, em vez de estoque físico, para o recurso de reposição +UseVirtualStock=Use estoque virtuais +UsePhysicalStock=Use estoque físico +CurentSelectionMode=Modo de seleção atual +CurentlyUsingVirtualStock=Estoque virtual +CurentlyUsingPhysicalStock=Estoque físico +RuleForStockReplenishment=Regra para as ações de reposição +SelectProductWithNotNullQty=Selecione pelo menos um produto com um qty não nulo e um fornecedor +WarehouseForStockDecrease=Os arquivos serão utilizados para redução estoque +WarehouseForStockIncrease=O arquivos serão utilizados para aumento de +ForThisWarehouse=Para este armazenamento +ReplenishmentStatusDesc=Esta lista de todos os produtos com um estoque menor do que o estoque desejado (ou inferior ao valor de alerta se checkbox "alerta só" está marcada), e sugerir-lhe para criar ordens de fornecedor para preencher a diferença. +ReplenishmentOrdersDesc=Esta lista de todos os pedidos de fornecedores esta aberto +Replenishments=Reconstituições +NbOfProductBeforePeriod=Quantidade de produtos em estoque antes do período selecionado +NbOfProductAfterPeriod=Quantidade de produtos em estoque período selecionado depois +MassMovement=Movimento de massas +MassStockMovement=Movimento de estoque em massa +SelectProductInAndOutWareHouse=Selecione um produto, uma quantidade, um armazém de origem e um armazém de destino e clique em "% s". Uma vez feito isso para todos os movimentos necessários, clique em "% s". +RecordMovement=Gravar a transferência +ReceivingForSameOrder=Recebimentos para este fim +StockMovementRecorded=Movimentos de estoque gravados +RuleForStockAvailability=Regras sobre os requisitos de ações +StockMustBeEnoughForInvoice=Banco de nível deve ser o suficiente para adicionar o produto / serviço em fatura +StockMustBeEnoughForOrder=Banco de nível deve ser o suficiente para adicionar o produto / serviço em ordem +StockMustBeEnoughForShipment=Banco de nível deve ser o suficiente para adicionar o produto / serviço no transporte diff --git a/htdocs/langs/pt_BR/users.lang b/htdocs/langs/pt_BR/users.lang index d0420c20bae..16e656e8069 100644 --- a/htdocs/langs/pt_BR/users.lang +++ b/htdocs/langs/pt_BR/users.lang @@ -1,59 +1,76 @@ # Dolibarr language file - Source file is en_US - users +HRMArea=área de gestão de recursos humanos UserCard=Ficha de Usuário ContactCard=Ficha de Contato -NoContactCard=Não existe nenhuma ficha dos contatos -EditPassword=Modificar Senha -SendNewPassword=Enviar Nova Senha -ReinitPassword=Gerar Nova Senha -PasswordChangedTo=Senha Modificada em: %s -SubjectNewPassword=A sua Senha -AvailableRights=Permissões Disponíveis -UserRights=Permissões de Usuário -UserGUISetup=Interface Usuário +NoContactCard=Nenhum cartão para os contatos +EditPassword=Alterar senha +SendNewPassword=Enviar nova senha +ReinitPassword=Gerar nova senha +PasswordChangedTo=Senha alterada em: %s +SubjectNewPassword=Sua nova senha para o Dolibarr +AvailableRights=Permissões disponíveis +OwnedRights=As minhas permissões +GroupRights=Permissões do grupo +UserRights=Permissões do usuário +UserGUISetup=Interface do usuário DisableUser=Desativar -DisableAUser=Desativar um Usuário -DeleteAUser=Eliminar um Usuário +DisableAUser=Desativar um usuário +DeleteUser=Excluir +DeleteAUser=Excluir um usuário DisableGroup=Desativar DisableAGroup=Desativar um Grupo EnableAUser=Reativar um Usuário EnableAGroup=Reativar um Grupo -ConfirmDisableUser=Tem certeza que quer desativar o usuário %s ? -ConfirmDisableGroup=Tem certeza que quer desativar o grupo %s ? -ConfirmDeleteUser=Tem certeza que quer eliminar o usuário %s ? -ConfirmDeleteGroup=Tem certeza que quer eliminar o grupo %s ? -ConfirmEnableUser=Tem certeza que quer reativar o usuário %s ? -ConfirmEnableGroup=Tem certeza que quer reativar o grupo %s ? -ConfirmReinitPassword=Tem certeza que quer gerar uma nova senha o usuário %s ? -ConfirmSendNewPassword=Tem certeza que quer enviar uma nova senha o usuário %s ? -NewUser=Novo Usuário -CreateUser=Criar Usuário -SearchAUser=Procurar um Usuário -LoginNotDefined=O Usuário não está Definido -ListOfUsers=Lista de Usuário -SuperAdministratorDesc=Administrador global +DeleteGroup=Excluir +DeleteAGroup=Excluir um Grupo +ConfirmDisableUser=Você tem certeza que quer desativar o usuário %s ? +ConfirmDisableGroup=Você tem certeza que quer desativar o grupo %s ? +ConfirmDeleteUser=Você tem certeza que quer excluir o usuário %s ? +ConfirmDeleteGroup=Você tem certeza que quer excluir o grupo %s ? +ConfirmEnableUser=Você tem certeza que quer reativar o usuário %s ? +ConfirmEnableGroup=Você tem certeza que quer reativar o grupo %s ? +ConfirmReinitPassword=Você tem certeza que quer gerar uma nova senha para o usuário %s ? +ConfirmSendNewPassword=Você tem certeza que quer enviar uma nova senha para o usuário %s ? +NewUser=Novo usuário +CreateUser=Criar usuário +SearchAGroup=Buscar um grupo +SearchAUser=Buscar um usuário +LoginNotDefined=O usuário não está definido +NameNotDefined=O nome não está definido +ListOfUsers=Lista de usuário +SuperAdministratorDesc=Administrador geral AdministratorDesc=Entidade do administrador DefaultRights=Permissões por Padrao -DefaultRightsDesc=Defina aqui as permissões por default, é decir: as permissões que se atribuirão automaticamente a um novo usuário no momento de a sua criação. -DolibarrUsers=Usuário +DefaultRightsDesc=Defina aqui padrão permissões que são concedidas automaticamente para um novo usuário criado (Vá em fichas de usuário para alterar as permissões de um usuário existente). +DolibarrUsers=Usuário Dolibarr +LastName=Sobrenome +FirstName=Primeiro nome +ListOfGroups=Lista de grupos +NewGroup=Novo grupo +CreateGroup=Criar grupo +RemoveFromGroup=Remover do grupo PasswordChangedAndSentTo=Senha alterada e enviada a %s. -PasswordChangeRequestSent=Pedido para alterar a senha para %s enviada a %s. +PasswordChangeRequestSent=Solicitação para alterar a senha para %s enviada a %s. MenuUsersAndGroups=Usuários e Grupos -LastUsersCreated=Os %s últimos Usuários criados -ShowUser=Ver usuário -NonAffectedUsers=Usuários não destinados ao grupo -UserModified=Usuário corretamente modificado -PhotoFile=Arquivo foto -UserWithDolibarrAccess=Usuário com acesso a Dolibarr -ListOfUsersInGroup=Lista de Usuários deste grupo +LastUsersCreated=Os %s últimos usuários criados +ShowGroup=Visualizar grupo +ShowUser=Visualizar usuário +NonAffectedUsers=Usuários não atribuídos +UserModified=Usuário modificado com sucesso +GroupModified=Grupo modificado com sucesso +PhotoFile=Arquivo de foto +UserWithDolibarrAccess=Usuário com acesso ao Dolibarr +ListOfUsersInGroup=Lista de usuários deste grupo ListOfGroupsForUser=Lista de grupos deste usuário -UsersToAdd=Usuário a Adicionar a este grupo -GroupsToAdd=Grupos a Adicionar a este usuário -NoLogin=Sem Usuário +UsersToAdd=Usuário a adicionar a este grupo +GroupsToAdd=Grupos para adicionar a este usuário +NoLogin=Sem usuário LinkToCompanyContact=Atalho para terceiro / contato -LinkedToDolibarrMember=Atalho para o membro -LinkedToDolibarrUser=Atalho para o usuario de Dolibarr -LinkedToDolibarrThirdParty=Atalho para o terceiro do Dolibarr -CreateDolibarrThirdParty=Criar um Fornecedor +LinkedToDolibarrMember=Atalho para membro +LinkedToDolibarrUser=Atalho para o usuário de Dolibarr +LinkedToDolibarrThirdParty=Atalho para um fornecedor do Dolibarr +CreateDolibarrLogin=Criar uma usuário +CreateDolibarrThirdParty=Criar um fornecedor LoginAccountDisable=A conta está desativada, indique um Novo login para a ativar. LoginAccountDisableInDolibarr=A conta está desativada no Dolibarr LoginAccountDisableInLdap=A conta está desativada ao domínio @@ -84,3 +101,5 @@ DontDowngradeSuperAdmin=Somente um Super Administrador pode rebaixar um Super Ad HierarchicalResponsible=Responsabilidade hierárquica HierarchicView=Visão hierárquica UseTypeFieldToChange=Use campo Tipo para mudar +OpenIDURL=URL do OpenID +LoginUsingOpenID=Usar o OpenID para efetuar o login diff --git a/htdocs/langs/pt_BR/withdrawals.lang b/htdocs/langs/pt_BR/withdrawals.lang index 36c191317d3..5e456d79df7 100644 --- a/htdocs/langs/pt_BR/withdrawals.lang +++ b/htdocs/langs/pt_BR/withdrawals.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - withdrawals -StandingOrdersArea=Área de Débitos Diretos +StandingOrdersArea=Área ordens permanentes CustomersStandingOrdersArea=Área de Débitos Diretos de Clientes NewStandingOrder=Novo Débito Direto StandingOrderToProcess=A Processar @@ -8,7 +8,8 @@ RequestStandingOrderToTreat=Pedidos de Débitos Diretos a Tratar RequestStandingOrderTreated=Pedidos de Débitos Diretos Processados CustomersStandingOrders=Débitos Diretos de Clientes CustomerStandingOrder=Débito Direto de Cliente -NbOfInvoiceToWithdraw=No de Faturas Pendentes de Levantamento +NbOfInvoiceToWithdraw=Nb. da fatura para realizar pedido +NbOfInvoiceToWithdrawWithInfo=Nb. da fatura para realizar pedido para os clientes com informações de conta bancária definida InvoiceWaitingWithdraw=Faturas em Espera de Levantamento WithdrawsRefused=Débitos Diretos Rejeitados NoInvoiceToWithdraw=Nenhuma fatura a cliente com modo de pagamento 'Débito Directo' em espera. Ir ao separador 'Débito Directo' na ficha da fatura para fazer um pedido. @@ -21,5 +22,47 @@ ThirdPartyBankCode=Código Banco do Fornecedor ThirdPartyDeskCode=Código da Escritório do Fornecedor NoInvoiceCouldBeWithdrawed=Não há fatura de débito direto com sucesso. Verifique se a fatura da empresa tem um válido IBAN. ClassCredited=Classificar Acreditados -ClassCreditedConfirm=Tem certeza que quer classificar este débito direto como realizado sobre a sua conta bancaria? +ClassCreditedConfirm=Você tem certeza que querer marcar este pagamento como realizado em a sua conta bancaria? +TransData=Data da transferência +TransMetod=Método de transferência +StandingOrderReject=Emitir uma recusa +InvoiceRefused=Nota Fiscal recusada +WithdrawalRefused=Retirada recusada +WithdrawalRefusedConfirm=Você tem certeza que quer entrar com uma rejeição de retirada para a sociedade +RefusedInvoicing=Cobrança da rejeição +NoInvoiceRefused=Não carregue a rejeição +StatusWaiting=Aguardando +StatusTrans=Enviado StatusRefused=Negado +StatusMotif0=Não especificado +StatusMotif1=Saldo insuficiente +StatusMotif2=Solicitação contestada +StatusMotif3=Não há pedido de retirada +StatusMotif4=Pedido do Cliente +StatusMotif5=RIB inutilizável +StatusMotif8=Outras razões +CreateAll=Retirar tudo +CreateGuichet=Apenas do escritório +OrderWaiting=Aguardando resolução +NotifyTransmision=Retirada de Transmissão +NotifyEmision=Emissões de retirada +NotifyCredit=Revogação de crédito +NumeroNationalEmetter=Nacional Número Transmissor +BankToReceiveWithdraw=Conta bancária para receber saques +CreditDate=A crédito +WithdrawalFileNotCapable=Não foi possível gerar arquivo recibo de retirada para o seu país +ShowWithdraw=Mostrar Retire +IfInvoiceNeedOnWithdrawPaymentWontBeClosed=No entanto, se fatura não tem pelo menos um pagamento retirada ainda processado, não vai ser definido como pago para permitir a gestão de remoção prévia. +DoStandingOrdersBeforePayments=Essa guia permite que você solicite uma ordem permanente. Depois de concluído, você pode digitar o pagamento para fechar a fatura. +WithdrawalFile=Arquivo Retirada +SetToStatusSent=Defina o status "arquivo enviado" +ThisWillAlsoAddPaymentOnInvoice=Isto também se aplica aos pagamentos de faturas e classificá-los como "Paid" +InfoCreditSubject=Pagamento pendente pelo banco +InfoCreditMessage=O pedido pendente foi pago pelo banco
Dados de pagamento:% s +InfoTransSubject=Transmissão de pedido pendente para o banco +InfoTransMessage=O pedido pendente foi enviada ao banco por% s% s.

+InfoTransData=Valor:% s
Método:% s
Data:% s +InfoFoot=Esta é uma mensagem automática enviada por Dolibarr +InfoRejectSubject=Pedido pedente recusado +InfoRejectMessage=Olá,

a ordem permanente da fatura% s relacionadas à companhia% s, com um montante de% s foi recusado pelo banco.

-
% S +ModeWarning=Opção para modo real não foi definido, paramos depois desta simulação From 2deadea40a46331314700fcc0105f0e831f675ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Jun 2014 20:24:00 +0200 Subject: [PATCH 062/502] New: Filter on event status --- htdocs/comm/action/fiche.php | 10 +++--- htdocs/comm/action/index.php | 5 ++- htdocs/comm/action/listactions.php | 5 ++- htdocs/core/class/html.formactions.class.php | 37 ++++++++++++++------ htdocs/core/lib/agenda.lib.php | 12 +++++-- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/main.lang | 1 + htdocs/langs/pt_BR/salaries.lang | 4 +++ 8 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 htdocs/langs/pt_BR/salaries.lang diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 520cb5d175a..a965d51ae74 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -395,7 +395,7 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form = new Form($db); -$htmlactions = new FormActions($db); +$formactions = new FormActions($db); if ($action == 'create') { @@ -467,7 +467,7 @@ if ($action == 'create') if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print '
'; } else print ''; @@ -512,7 +512,7 @@ if ($action == 'create') if (GETPOST("afaire") == 1) $percent=0; else if (GETPOST("afaire") == 2) $percent=100; } - $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); + $formactions->form_select_status_action('formaction',$percent,1,'complete'); print ''; // Location @@ -740,7 +740,7 @@ if ($id > 0) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; } @@ -766,7 +766,7 @@ if ($id > 0) // Status print ''; // Location diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 92b87d94ad1..044ded65d82 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -347,7 +347,10 @@ else $sql.= ')'; } if ($type) $sql.= " AND ca.id = ".$type; -if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } +if ($status == '0') { $sql.= " AND a.percent = 0"; } +if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable +if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running +if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($filtera > 0 || $filtert > 0 || $filterd > 0) { diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 48e21690d2a..da9534a0f07 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -153,7 +153,10 @@ if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($type) $sql.= " AND c.id = ".$type; -if ($status == 'done') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } +if ($status == '0') { $sql.= " AND a.percent = 0"; } +if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable +if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running +if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($filtera > 0 || $filtert > 0 || $filterd > 0) { diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 522b2c30662..81a7ea1f048 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -48,13 +48,15 @@ class FormActions /** * Show list of action status * - * @param string $formname Name of form where select in included - * @param string $selected Preselected value (-1..100) - * @param int $canedit 1=can edit, 0=read only - * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @param string $formname Name of form where select is included + * @param string $selected Preselected value (-1..100) + * @param int $canedit 1=can edit, 0=read only + * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @param string $showempty Show an empty line if select is used + * @param string $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) * @return void */ - function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete') + function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete',$showempty=0,$onlyselect=0) { global $langs,$conf; @@ -64,6 +66,7 @@ class FormActions '50' => $langs->trans("ActionRunningShort"), '100' => $langs->trans("ActionDoneShort") ); + // +ActionUncomplete if (! empty($conf->use_javascript_ajax)) { @@ -112,18 +115,32 @@ class FormActions } } \n"; + } + if (! empty($conf->use_javascript_ajax) || $onlyselect) + { + //var_dump($selected); + if ($selected == 'done') $selected='100'; print ''; if ($selected == 0 || $selected == 100) $canedit=0; - print ' =0)?'':' disabled="disabled"').'>'; - print '%'; + + if (empty($onlyselect)) + { + print ' =0)?'':' disabled="disabled"').'>'; + print '%'; + } } else - { + { print ' %'; } } @@ -220,7 +237,7 @@ class FormActions global $langs,$user,$form; if (! is_object($form)) $form=new Form($db); - + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $caction=new CActionComm($this->db); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 08aacfca14e..bdb068d71b5 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -43,8 +43,8 @@ * @param string $actioncode Preselected value of actioncode for filter on type * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') { - +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') +{ global $conf, $user, $langs, $db; // Filters @@ -87,13 +87,19 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); + print ''; print ''; + print ''; + print ''; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index caddad9d997..0f8851792b3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -356,6 +356,7 @@ ActionNotApplicable=Not applicable ActionRunningNotStarted=To start ActionRunningShort=Started ActionDoneShort=Finished +ActionUncomplete=Uncomplete CompanyFoundation=Company/Foundation ContactsForCompany=Contacts for this third party ContactsAddressesForCompany=Contacts/addresses for this third party diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 89c2589941b..4f13b1a1bad 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -355,6 +355,7 @@ ActionsDoneShort=Effectuées ActionNotApplicable=Non applicable ActionRunningNotStarted=A réaliser ActionRunningShort=En cours +ActionUncomplete=Incomplet ActionDoneShort=Terminé CompanyFoundation=Société ou institution ContactsForCompany=Contacts de ce tiers diff --git a/htdocs/langs/pt_BR/salaries.lang b/htdocs/langs/pt_BR/salaries.lang new file mode 100644 index 00000000000..ae54678cc61 --- /dev/null +++ b/htdocs/langs/pt_BR/salaries.lang @@ -0,0 +1,4 @@ +# Dolibarr language file - Source file is en_US - salaries +NewSalaryPayment=Novo pagamento de salário +SalaryPayment=Pagamento de salário +SalariesPayments=Pagamentos de salários From e2790895aded14982ef0c14185304e1f3a0bed32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Jun 2014 21:48:57 +0200 Subject: [PATCH 063/502] Prepare 3.7 development. --- ChangeLog | 12 +++++++++++ htdocs/filefunc.inc.php | 2 +- .../install/mysql/migration/3.6.0-3.7.0.sql | 20 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 htdocs/install/mysql/migration/3.6.0-3.7.0.sql diff --git a/ChangeLog b/ChangeLog index 71957fbb206..fc4b94027f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,18 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 3.7 compared to 3.6.* ***** +For users: +- + +For translators: +- Update language files. + +For developers: +- + + ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: - New: Update ckeditor to version 4. diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index bff0fa716f1..c30388050cf 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.0-beta'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.0-alpha'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql new file mode 100644 index 00000000000..cf91c37aaf7 --- /dev/null +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -0,0 +1,20 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 3.7.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To restrict request to Mysql version x.y use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE + +-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); +-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + + From 722847cbe6f10eb341b4e80324ea5d5cc2386143 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Jun 2014 21:57:49 +0200 Subject: [PATCH 064/502] Add option to enable keypad (in most cases, we don't need this). --- htdocs/cashdesk/include/keypad.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/cashdesk/include/keypad.php b/htdocs/cashdesk/include/keypad.php index e8c3780f348..cc56a2d1192 100644 --- a/htdocs/cashdesk/include/keypad.php +++ b/htdocs/cashdesk/include/keypad.php @@ -15,8 +15,17 @@ * along with this program. If not, see . */ +/** + * Return a string to outptu a keypad + * + * @param string $keypadname Key pad name + * @param string $formname Form name + * @return string HTML code to show a js keypad. + */ function genkeypad($keypadname, $formname) { + if (empty($conf->global->CASHDESK_SHOW_KEYPAD)) return ''; + // défine the font size of button $btnsize=32; $sz=''."\n"; @@ -33,7 +42,7 @@ function genkeypad($keypadname, $formname) $sz.=''."\n"; $sz.=''."\n"; $sz.='
'."\n"; - + $sz.=''."\n"; $sz.=''."\n"; From 8acd702cd13c9c7086e4394b792f4ed8f8556cc5 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Thu, 26 Jun 2014 22:34:40 +0200 Subject: [PATCH 065/502] Using hidden constant to use the feature MARGININFO_HIDE_SHOW = 0 feature not used MARGININFO_HIDE_SHOW = 1 feature used, displayed on open MARGININFO_HIDE_SHOW = 2 feature used, not displayed on open --- htdocs/core/class/commonobject.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 655d474aef3..e55766c377e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3232,10 +3232,14 @@ abstract class CommonObject if (! $user->rights->margins->liretous) return; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print ""; + if ($conf->global->MARGININFO_HIDE_SHOW > 0) + print ""; + if ($conf->global->MARGININFO_HIDE_SHOW == 2) // hide by default + print ''; + print '
'.$langs->trans("Ref").''.$langs->trans("Date").'
'.(isset($element->total_ht)?price($element->total_ht):' ').''; + if (! $qualifiedfortotal) print ''; + print (isset($element->total_ht)?price($element->total_ht):' '); + if (! $qualifiedfortotal) print ''; + print ''.(isset($element->total_ttc)?price($element->total_ttc):' ').''; + if (! $qualifiedfortotal) print ''; + print (isset($element->total_ttc)?price($element->total_ttc):' '); + if (! $qualifiedfortotal) print ''; + print ''.$element->getLibStatut(5).'
'.$langs->trans("Number").': '.$i.'
'.$langs->trans("Type").''; - $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); print '
'.$langs->trans("Type").''; - $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); + $formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto"); print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$object->percentage; - $htmlactions->form_select_status_action('formaction',$percent,1); + $formactions->form_select_status_action('formaction',$percent,1); print '
'; print $langs->trans("Type"); print '  '; - print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0)); + print '
'; + print $langs->trans("Status"); + print '  '; + $formactions->form_select_status_action('formaction',$status,1,'complete',1,2); print '
'; print ''; print ''; From 4cd3a4f4aad0e056355ab6794a7429fb2d18bf44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jun 2014 01:34:27 +0200 Subject: [PATCH 066/502] Fix: bad indice --- htdocs/core/modules/modDon.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 1e4dfd2c914..b1b265146a4 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -68,36 +68,36 @@ class modDon extends DolibarrModules // Constants $this->const = array (); - - $this->const[1] = array ( + + $this->const[0] = array ( "DON_ADDON_MODEL", "chaine", "html_cerfafr", "Nom du gestionnaire de generation de recu de dons", "0" ); - $this->const[2] = array ( + $this->const[1] = array ( "DONATION_ART200", "yesno", "0", "Option Française - Eligibilité Art200 du CGI", - "0" + "0" ); - $this->const[3] = array ( + $this->const[2] = array ( "DONATION_ART238", "yesno", "0", "Option Française - Eligibilité Art238 bis du CGI", - "0" + "0" ); - $this->const[4] = array ( + $this->const[3] = array ( "DONATION_ART885", "yesno", "0", "Option Française - Eligibilité Art885-0 V bis du CGI", - "0" + "0" ); - $this->const[5] = array ( + $this->const[4] = array ( "DONATION_MESSAGE", "chaine", "Thank you", From 6ce1ef08cf30f6ad1e5555bab69a15defa5af8e4 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Jun 2014 09:09:08 +0200 Subject: [PATCH 067/502] [ task #867 ] Remove ESAEB external module code from core --- ChangeLog | 1 + .../class/bonprelevement.class.php | 69 +------------------ 2 files changed, 3 insertions(+), 67 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc4b94027f6..bb23bc6940e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +New: [ task #867 ] Remove ESAEB external module code from core - For translators: diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 417f4362000..27e6c84d92e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1220,8 +1220,7 @@ class BonPrelevement extends CommonObject /** * Generate a withdrawal file. Generation Formats: - * France: CFONB - * Spain: AEB19 (if external module EsAEB is enabled) + * European countries: SEPA * Others: Warning message * File is generated with name this->filename * @@ -1242,72 +1241,8 @@ class BonPrelevement extends CommonObject $found=0; - // Build file for Spain - if ($mysoc->country_code=='ES') - { - if (! empty($conf->esaeb->enabled)) - { - $found++; - - dol_include_once('/esaeb/class/esaeb19.class.php'); - - //Head - $esaeb19 = new AEB19DocWritter; - $esaeb19->configuraPresentador($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_PRESENTADOR,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet); - $idOrdenante = $esaeb19->agregaOrdenante($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_ORDENANTE,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet, $this->emetteur_number_key, $this->emetteur_numero_compte); - $this->total = 0; - $sql = "SELECT pl.rowid, pl.fk_soc, pl.client_nom, pl.code_banque, pl.code_guichet, pl.cle_rib, pl.number, pl.amount,"; - $sql.= " f.facnumber, pf.fk_facture"; - $sql.= " FROM"; - $sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; - $sql.= " ".MAIN_DB_PREFIX."facture as f,"; - $sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; - $sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; - $sql.= " AND pf.fk_facture = f.rowid"; - - //Lines - $i = 0; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - - $client = new Societe($this->db); - - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - $client->fetch($obj->fk_soc); - - $esaeb19->agregaRecibo( - $idOrdenante, - $client->idprof1, - $obj->client_nom, - $obj->code_banque, - $obj->code_guichet, - $obj->cle_rib, - $obj->number, - $obj->amount, - "Fra.".$obj->facnumber." ".$obj->amount - ); - - $this->total = $this->total + $obj->amount; - - $i++; - } - } - else - { - $result = -2; - } - - fputs($this->file, $esaeb19->generaRemesa()); - } - } - // Build file for European countries - if (! $found && $mysoc->isInEEC()) + if (! $mysoc->isInEEC()) { $found++; From 773caf808ef3293fdcc8e0c741a4bada053be3cc Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Jun 2014 09:09:54 +0200 Subject: [PATCH 068/502] [ task #867 ] Remove ESAEB external module code from core --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 27e6c84d92e..bcdef07aede 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1237,8 +1237,6 @@ class BonPrelevement extends CommonObject $this->file = fopen($this->filename,"w"); - // TODO Move code for es and fr into an external module file with selection into setup of prelevement module - $found=0; // Build file for European countries From a153480bc659ab8f332aa2b6b6cfe37b30927a19 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 27 Jun 2014 13:39:01 +0200 Subject: [PATCH 069/502] Fix : [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action Change trigger call to new function call_trigger --- ChangeLog | 4 +-- .../compta/paiement/class/paiement.class.php | 26 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb23bc6940e..107834b0a19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: -New: [ task #867 ] Remove ESAEB external module code from core -- +- New: [ task #867 ] Remove ESAEB external module code from core +- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action For translators: - Update language files. diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 93f5f017c44..014926a90df 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -240,10 +240,8 @@ class Paiement extends CommonObject if (! $error) { // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_CUSTOMER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + $result=$this->call_trigger('PAYMENT_CUSTOMER_CREATE', $user); + if ($result < 0) { $error++; } // Fin appel triggers } } @@ -355,11 +353,13 @@ class Paiement extends CommonObject if (! $notrigger) { // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + $result=$this->call_trigger('PAYMENT_DELETE', $user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // Fin appel triggers } $this->db->commit(); @@ -508,11 +508,9 @@ class Paiement extends CommonObject if (! $error && ! $notrigger) { // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_ADD_TO_BANK',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + $result=$this->call_trigger('PAYMENT_ADD_TO_BANK', $user); + if ($result < 0) { $error++; } + // Fin appel triggers } } else From e5a06635dc56a5f848861e04f8a2d859fc6655f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jun 2014 20:50:46 +0200 Subject: [PATCH 070/502] Fix css for agenda box Make different view of agenda into different tabs. --- htdocs/comm/action/index.php | 44 ++++++++++++++++++++++-------- htdocs/comm/action/listactions.php | 16 +++++++++-- htdocs/core/lib/agenda.lib.php | 39 ++++++++++++++++++-------- htdocs/theme/eldy/style.css.php | 1 + 4 files changed, 74 insertions(+), 26 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 044ded65d82..cfe6c3c210d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -84,13 +84,19 @@ $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GET if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { $action='show_month'; $day=''; } // View by month -if (GETPOST('viewweek')) { +if (GETPOST('viewweek') || $action == 'show_week') { $action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d")); } // View by week -if (GETPOST('viewday')) { +if (GETPOST('viewday') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day +if (empty($action)) +{ + if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_month'; + else $action=$conf->global->AGENDA_DEFAULT_VIEW; +} + $langs->load("agenda"); $langs->load("other"); $langs->load("commercial"); @@ -134,6 +140,10 @@ $companystatic=new Societe($db); $contactstatic=new Contact($db); $now=dol_now(); +$nowarray=dol_getdate($now); +$nowyear=$nowarray['year']; +$nowmonth=$nowarray['mon']; +$nowday=$nowarray['mday']; // Define list of all external calendars $listofextcals=array(); @@ -226,7 +236,6 @@ if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions"); $param=''; -$region=''; if ($status) $param="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtera) $param.="&filtera=".$filtera; @@ -243,26 +252,29 @@ $param.="&maxprint=".$maxprint; // Show navigation bar if (empty($action) || $action=='show_month') { - $nav ="".img_previous($langs->trans("Previous"))."\n"; + $nav ="".img_previous($langs->trans("Previous"))."\n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%b %Y"); $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="   (".$langs->trans("Today").")"; $picto='calendar'; } if ($action=='show_week') { - $nav ="".img_previous($langs->trans("Previous"))."\n"; + $nav ="".img_previous($langs->trans("Previous"))."\n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,1,$year),"%Y").", ".$langs->trans("Week")." ".$week; $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="   (".$langs->trans("Today").")"; $picto='calendarweek'; } if ($action=='show_day') { - $nav ="".img_previous($langs->trans("Previous"))."\n"; + $nav ="".img_previous($langs->trans("Previous"))."\n"; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"daytextshort"); $nav.=" \n"; - $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="".img_next($langs->trans("Next"))."\n"; + $nav.="   (".$langs->trans("Today").")"; $picto='calendarday'; } @@ -273,9 +285,17 @@ $param.='&year='.$year.'&month='.$month.($day?'&day='.$day:''); -$head = calendars_prepare_head(''); +$tabactive=''; +if ($action == 'show_month') $tabactive='cardmonth'; +if ($action == 'show_week') $tabactive='cardweek'; +if ($action == 'show_day') $tabactive='cardday'; +if ($action == 'show_list') $tabactive='cardlist'; -dol_fiche_head($head, 'card', $langs->trans('Events'), 0, $picto); +$paramnoaction=preg_replace('/action=[a-z_]+/','',$param); + +$head = calendars_prepare_head($paramnoaction); + +dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode); dol_fiche_end(); @@ -919,7 +939,7 @@ else // View by day $newparam=preg_replace('/viewday=[0-9]+&?/i','',$newparam); $newparam.='&viewday=1'; // Code to show just one day - $style='cal_current_month'; + $style='cal_current_month cal_current_month_oneday'; $today=0; $todayarray=dol_getdate($now,'fast'); if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index da9534a0f07..18aab7bdc1a 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -43,6 +43,12 @@ $pid=GETPOST("projectid",'int',3); $status=GETPOST("status",'alpha'); $type=GETPOST('type'); +if (empty($action)) +{ + if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_list'; + else $action=$conf->global->AGENDA_DEFAULT_VIEW; +} + $filter=GETPOST("filter",'',3); $filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3); $filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); @@ -195,9 +201,15 @@ if ($resql) } - $head = calendars_prepare_head(''); + $tabactive=''; + if ($action == 'show_month') $tabactive='cardmonth'; + if ($action == 'show_week') $tabactive='cardweek'; + if ($action == 'show_day') $tabactive='cardday'; + if ($action == 'show_list') $tabactive='cardlist'; - dol_fiche_head($head, 'card', $langs->trans('Events'), 0, 'list'); + $head = calendars_prepare_head(''); + + dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1); dol_fiche_end(); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index bdb068d71b5..7df4543b12d 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -54,6 +54,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; print ''; + print ''; print ''; print '
'.$langs->trans('Margins').'
'; @@ -68,13 +69,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $langs->trans("ActionsAskedBy"); print '  '; - print ''; - - print ''; - print ''; @@ -120,7 +116,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; // Buttons - print ''; + print '';*/ // Legend if ($conf->use_javascript_ajax && is_array($showextcals)) @@ -171,6 +167,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; + print ''; print '
'; print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); - print '
'; - print $langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy"); - print '  '; + print '   '.$langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy"); + print '  '; print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); print '
'; + /*print ''; print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' '; print '
'; print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' '; @@ -128,7 +124,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' '; print '
'; print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' '; - print '
'; print ''; } @@ -465,11 +462,29 @@ function calendars_prepare_head($param) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php'.($param?'?'.$param:''); - $head[$h][1] = $langs->trans("Agenda"); - $head[$h][2] = 'card'; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_month'.($param?'&'.$param:''); + $head[$h][1] = $langs->trans("ViewCal"); + $head[$h][2] = 'cardmonth'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_week'.($param?'&'.$param:''); + $head[$h][1] = $langs->trans("ViewWeek"); + $head[$h][2] = 'cardweek'; + $h++; + + //$paramday=$param; + //if (preg_match('/&month=\d+/',$paramday) && ! preg_match('/&day=\d+/',$paramday)) $paramday.='&day=1'; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param?'&'.$param:''); + $head[$h][1] = $langs->trans("ViewDay"); + $head[$h][2] = 'cardday'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/comm/action/listactions.php'.($param?'?'.$param:''); + $head[$h][1] = $langs->trans("ViewList"); + $head[$h][2] = 'cardlist'; + $h++; + + $object=new stdClass(); // Show more tabs from modules diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 63b789a4597..84c449f8e90 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2243,6 +2243,7 @@ td.hidden { table.cal_month { border-spacing: 0px; } .cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; } +.cal_current_month_oneday { border-right: solid 1px #E0E0E0; } .cal_other_month { border-top: 0; border-left: solid 1px #C0C0C0; border-right: 0; border-bottom: solid 1px #C0C0C0; } .cal_current_month_right { border-right: solid 1px #E0E0E0; } .cal_other_month_right { border-right: solid 1px #C0C0C0; } From 7d72b6c3a1d5eeb8185365524344a4b51128fe69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 14:06:29 +0200 Subject: [PATCH 071/502] Add comments --- htdocs/core/class/CMailFile.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index d766fa4a813..ed9464a14b3 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -657,6 +657,7 @@ class CMailFile { $out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2; } + // Return-Path is important because it is used by SPF. Some MTA does not read Return-Path from header but from command line. See option MAIN_MAIL_ALLOW_SENDMAIL_F for that. $out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2; if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2; if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2; From b7ee10a0747062a2f1d16bcf30b2da801846327f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 28 Jun 2014 17:17:37 +0200 Subject: [PATCH 072/502] New : can add all products in a shipment, even if qty is 0 with SHIPMENT_GETS_ALL_ORDER_PRODUCTS --- htdocs/expedition/class/expedition.class.php | 2 ++ htdocs/expedition/fiche.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 93c7f63b4ad..c0c647698e8 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -590,6 +590,8 @@ class Expedition extends CommonObject $cpt = $this->db->num_rows($resql); for ($i = 0; $i < $cpt; $i++) { + if($obj->qty <= 0) continue; + dol_syslog(get_class($this)."::valid movement index ".$i); $obj = $this->db->fetch_object($resql); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 89d0995fb45..ff6b23c10be 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -163,7 +163,7 @@ if ($action == 'add') { $qty = "qtyl".$i; if (! isset($batch_line[$i])) { - if (GETPOST($qty,'int') > 0) + if (GETPOST($qty,'int') > 0 || (GETPOST($qty,'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; $idl = "idl".$i; From a8e439188761a14970e6922adff1fccfd5de7c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 18:04:32 +0200 Subject: [PATCH 073/502] Prepare calendars to be able to show calendars with selection on several users. --- htdocs/comm/action/fiche.php | 2 +- htdocs/comm/action/index.php | 23 ++++++---- htdocs/comm/action/listactions.php | 2 +- htdocs/core/lib/agenda.lib.php | 70 ++++++++++++++++++++---------- htdocs/langs/en_US/agenda.lang | 1 + htdocs/theme/eldy/style.css.php | 2 +- 6 files changed, 64 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a965d51ae74..0cf366080b9 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -532,7 +532,7 @@ if ($action == 'create') // Busy print '
'.$langs->trans("Busy").''; - print 'transparency?' checked="checked"':'').'>'; + print ''; print '
'; - print ''; - // Private note - if (empty($user->societe_id)) { + if (empty($user->societe_id)) + { print ''; print ''; print ''; + // print ' + print ''; } - if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { + // Lines from source + if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) + { // TODO for compatibility if ($origin == 'contrat') { // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva @@ -2293,6 +2296,8 @@ if ($action == 'create') $newclassname = 'Order'; elseif ($newclassname == 'Expedition') $newclassname = 'Sending'; + elseif ($newclassname == 'Fichinter') + $newclassname = 'Intervention'; print ''; print ''; @@ -2362,7 +2367,10 @@ if ($action == 'create') print "
'; + print ''; + print ''; + print ''; + print '"; + if ($mysoc->localtax1_assuj == "1") // Localtax1 RE + { + print '"; + } + + if ($mysoc->localtax2_assuj == "1") // Localtax2 IRPF + { + print '"; + } + print '"; + } + + print "
'; if ($event->type_code == 'BIRTHDAY') // It's a birthday { print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 18aab7bdc1a..494a5339f96 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -210,7 +210,7 @@ if ($resql) $head = calendars_prepare_head(''); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0); dol_fiche_end(); // Add link to show birthdays diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 7df4543b12d..8eddf330c0f 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -41,9 +41,10 @@ * @param int $socid Third party id * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend * @param string $actioncode Preselected value of actioncode for filter on type + * @param int $showbirthday Show check to toggle birthday events * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='') +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $showbirthday=0) { global $conf, $user, $langs, $db; @@ -56,9 +57,13 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''; print ''; - print ''; - print '
'; + print '
'; + + print '
'; + + //print ''; + //print ''; + + //print ''; + print ''; + // Buttons /*print '';*/ + //print '
'; print ''; @@ -66,12 +71,15 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print ''; print ''; /*print ''; @@ -113,7 +121,10 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh } print '
'; - print $langs->trans("ActionsAskedBy"); - print '  '; - print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); - print '   '.$langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy"); - print '  '; + //print $langs->trans("ActionsAskedBy"); + //print '  '; + //print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); + //print '   '.$langs->trans("or") . ' '; + print $langs->trans("ActionsForUser").'   '; + print ''; + //print '  '; print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); + print ajax_combobox('usertodo'); print '
'; - print '
'; @@ -126,10 +137,22 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' '; print ''; + print '
'; + + print ''; + // Legend - if ($conf->use_javascript_ajax && is_array($showextcals)) + if ($conf->use_javascript_ajax) { - print ''; + if ($showbirthday) print '
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; + + print ''; } - - print ''; - - print ''; print '
'; + print '
'; + print ''; + print '
'; + print '
'; + print '
'; + + //print $langs->trans("Calendars").': '; + //print ''; print '' . "\n"; - print ''; if (! empty($conf->use_javascript_ajax)) { - if (count($showextcals) > 0) + if (is_array($showextcals) && count($showextcals) > 0) { - print ''; + print '
' . $langs->trans("LocalAgenda").'  
'; foreach ($showextcals as $val) { $htmlname = dol_string_nospecial($val['name']); - print ''; + print '
' . $val ['name'] . '  
'; } } } - print ''; - print '
' . $langs->trans("LocalAgenda") . '
'; print '' . "\n"; - print ' ' . $val ['name']; - print '
'.$langs->trans("AgendaShowBirthdayEvents").'
'; - print '
'; + + print '
'; + + print ''; + print '
'; + print ''; } diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 687e3cae146..f399a81d91d 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -25,6 +25,7 @@ ListOfEvents= List of Dolibarr events ActionsAskedBy=Events reported by ActionsToDoBy=Events assigned to ActionsDoneBy=Events done by +ActionsAskedBy=Events for user AllMyActions= All my events/tasks AllActions= All events/tasks ViewList=List view diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 84c449f8e90..b5324b65a0b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2265,7 +2265,7 @@ li.cal_event { border: none; list-style-type: none; } .cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; } .cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; } .cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); } - +.cal_event_busy { } /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ From 0e36295e12bfb3cf22e3c0452bbdcac880692969 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 18:43:36 +0200 Subject: [PATCH 074/502] Add option FICHINTER_DISABLE_DETAILS --- htdocs/fichinter/fiche.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 00d4e35df8e..a66fb341cff 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -701,7 +701,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA $filename = $attachedfiles['names']; $mimetype = $attachedfiles['mimes']; - // Envoi de la propal + // Send by email require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) @@ -1301,7 +1301,7 @@ else if ($id > 0 || ! empty($ref)) } } - print "

"; + print "
"; if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { @@ -1318,7 +1318,6 @@ else if ($id > 0 || ! empty($ref)) } - print '
'; print ''; print ''; @@ -1347,6 +1346,7 @@ else if ($id > 0 || ! empty($ref)) if ($num) { + print '
'; print ''; print ''; @@ -1451,7 +1451,7 @@ else if ($id > 0 || ! empty($ref)) $db->free($resql); // Add new line - if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline') + if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) { if (! $num) print '
'; @@ -1520,7 +1520,7 @@ else if ($id > 0 || ! empty($ref)) if ($action != 'editdescription' && ($action != 'presend')) { // Validate - if ($object->statut == 0 && $user->rights->ficheinter->creer && count($object->lines) > 0) + if ($object->statut == 0 && $user->rights->ficheinter->creer && (count($object->lines) > 0 || ! empty($conf->global->FICHINTER_DISABLE_DETAILS))) { print ''; @@ -1623,7 +1623,7 @@ else if ($id > 0 || ! empty($ref)) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/')); $file=$fileparams['fullname']; - + // Define output language $outputlangs = $langs; $newlang = ''; From 03c6d8fdc3089c0c17335393c66481de2913f08a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 19:47:51 +0200 Subject: [PATCH 075/502] New: Can create proposal from an intervention. --- ChangeLog | 4 +- htdocs/comm/propal.php | 279 ++++++++++++++++++++++++-- htdocs/compta/facture.php | 88 ++++---- htdocs/core/class/html.form.class.php | 2 + htdocs/fichinter/fiche.php | 15 +- 5 files changed, 330 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6498158b912..d018c4ec8ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,8 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: -New: [ task #867 ] Remove ESAEB external module code from core -- +New: [ task #867 ] Remove ESAEB external module code from core. +New: Can create proposal from an intervention. For translators: - Update language files. diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index dbc76feeeef..3630ef2be10 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -237,11 +237,13 @@ else if ($action == 'add' && $user->rights->propal->creer) { $error ++; } - if (! $error) { + if (! $error) + { $db->begin(); // Si on a selectionne une propal a copier, on realise la copie - if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) { + if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) + { if ($object->fetch(GETPOST('copie_propal')) > 0) { $object->ref = GETPOST('ref'); $object->datep = $datep; @@ -287,7 +289,8 @@ else if ($action == 'add' && $user->rights->propal->creer) { $object->origin = GETPOST('origin'); $object->origin_id = GETPOST('originid'); - for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) { + for($i = 1; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i ++) + { if ($_POST ['idprod' . $i]) { $xid = 'idprod' . $i; $xqty = 'qty' . $i; @@ -304,8 +307,137 @@ else if ($action == 'add' && $user->rights->propal->creer) { } } - if (! $error) { - $id = $object->create($user); + if (! $error) + { + if ($origin && $originid) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $origin; + if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { + $element = $regs [1]; + $subelement = $regs [2]; + } + + // For compatibility + if ($element == 'order') { + $element = $subelement = 'commande'; + } + if ($element == 'propal') { + $element = 'comm/propal'; + $subelement = 'propal'; + } + if ($element == 'contract') { + $element = $subelement = 'contrat'; + } + if ($element == 'inter') { + $element = $subelement = 'ficheinter'; + } + if ($element == 'shipping') { + $element = $subelement = 'expedition'; + } + + $object->origin = $origin; + $object->origin_id = $originid; + + // Possibility to add external linked objects with hooks + $object->linked_objects [$object->origin] = $object->origin_id; + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) { + $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); + } + + $id = $object->create($user); + + if ($id > 0) + { + dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); + + $classname = ucfirst($subelement); + $srcobject = new $classname($db); + + dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines"); + $result = $srcobject->fetch($object->origin_id); + + if ($result > 0) + { + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject, 'fetch_lines')) $lines = $srcobject->fetch_lines(); + + $fk_parent_line=0; + $num=count($lines); + for ($i=0;$i<$num;$i++) + { + $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); + $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); + + // Positive line + $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); + + // Date start + $date_start = false; + if ($lines[$i]->date_debut_prevue) + $date_start = $lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) + $date_start = $lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) + $date_start = $lines[$i]->date_start; + + // Date end + $date_end = false; + if ($lines[$i]->date_fin_prevue) + $date_end = $lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) + $date_end = $lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) + $date_end = $lines[$i]->date_end; + + // Reset fk_parent_line for no child products and special product + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { + $fk_parent_line = 0; + } + + // Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option = $lines[$i]->array_options; + } + + $tva_tx=get_default_tva($mysoc, $object->thirdparty); + + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_option); + + if ($result > 0) { + $lineid = $result; + } else { + $lineid = 0; + $error ++; + break; + } + + // Defined the new fk_parent_line + if ($result > 0 && $lines[$i]->product_type == 9) { + $fk_parent_line = $result; + } + } + + // Hooks + $parameters = array('objFrom' => $srcobject); + $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if ($reshook < 0) + $error ++; + } else { + $mesgs [] = $srcobject->error; + $error ++; + } + } else { + $mesgs [] = $object->error; + $error ++; + } + } // Standard creation + else + { + $id = $object->create($user); + } if ($id > 0) { // Insertion contact par defaut si defini @@ -1105,6 +1237,61 @@ if ($action == 'create') { if ($socid > 0) $res = $soc->fetch($socid); + // Load objectsrc + if (! empty($origin) && ! empty($originid)) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $origin; + if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { + $element = $regs [1]; + $subelement = $regs [2]; + } + + if ($element == 'project') { + $projectid = $originid; + } else { + // For compatibility + if ($element == 'order' || $element == 'commande') { + $element = $subelement = 'commande'; + } + if ($element == 'propal') { + $element = 'comm/propal'; + $subelement = 'propal'; + } + if ($element == 'contract') { + $element = $subelement = 'contrat'; + } + if ($element == 'shipping') { + $element = $subelement = 'expedition'; + } + + dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); + + $classname = ucfirst($subelement); + $objectsrc = new $classname($db); + $objectsrc->fetch($originid); + if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) + $objectsrc->fetch_lines(); + $objectsrc->fetch_thirdparty(); + + $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); + $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); + $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); + + $soc = $objectsrc->thirdparty; + + $cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); + $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); + $remise_percent = (! empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(! empty($soc->remise_percent)?$soc->remise_percent:0)); + $remise_absolue = (! empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(! empty($soc->remise_absolue)?$soc->remise_absolue:0)); + $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); + + // Replicate extrafields + $objectsrc->fetch_optionals($originid); + $object->array_options = $objectsrc->array_options; + } + } + $object = new Propal($db); print ''; @@ -1243,16 +1430,62 @@ if ($action == 'create') { print $object->showOptionals($extrafields, 'edit'); } - print "
"; + + // Lines from source + if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) + { + // TODO for compatibility + if ($origin == 'contrat') { + // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva + $objectsrc->remise_absolue = $remise_absolue; + $objectsrc->remise_percent = $remise_percent; + $objectsrc->update_price(1, - 1, 1); + } + + print "\n"; + print "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print ''; + print ''; + + $newclassname = $classname; + if ($newclassname == 'Propal') + $newclassname = 'CommercialProposal'; + elseif ($newclassname == 'Commande') + $newclassname = 'Order'; + elseif ($newclassname == 'Expedition') + $newclassname = 'Sending'; + elseif ($newclassname == 'Fichinter') + $newclassname = 'Intervention'; + + print '
' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . '
' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . '
' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . "
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($objectsrc->total_localtax1) . "
' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . "
' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . "
\n"; + + print '
'; + /* * Combobox pour la fonction de copie */ - if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { - print ''; - } + if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) print ''; if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) @@ -1296,7 +1529,8 @@ if ($action == 'create') { print ''; } - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) + { print '
' . $langs->trans("CreateEmptyPropal") . '
'; if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $lib = $langs->trans("ProductsAndServices"); @@ -1325,6 +1559,7 @@ if ($action == 'create') { } if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE) || ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '

'; + $langs->load("bills"); print '
'; print ''; @@ -1332,6 +1567,22 @@ if ($action == 'create') { print '
'; print ""; + + + // Show origin lines + if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { + print '
'; + + $title = $langs->trans('ProductsAndServices'); + print_titre($title); + + print ''; + + $objectsrc->printOriginLinesList(); + + print '
'; + } + } else { /* * Show object in view mode @@ -1982,7 +2233,7 @@ if ($action == 'create') { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; - + // Define output language $outputlangs = $langs; $newlang = ''; @@ -1990,16 +2241,16 @@ if ($action == 'create') { $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; - + // Build document if it not exists if (! $file || ! is_readable($file)) { - + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } - + $result = propale_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $result); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 8b37f6196c9..555640a50ce 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -802,11 +802,11 @@ else if ($action == 'add' && $user->rights->facture->creer) $object->fetch_thirdparty(); // If creation from another object of another module (Example: origin=propal, originid=1) - if ($_POST['origin'] && $_POST['originid']) + if ($origin && $originid) { // Parse element/subelement (ex: project_task) - $element = $subelement = $_POST['origin']; - if (preg_match('/^([^_]+)_([^_]+)/i', $_POST['origin'], $regs)) { + $element = $subelement = $origin; + if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { $element = $regs [1]; $subelement = $regs [2]; } @@ -829,8 +829,8 @@ else if ($action == 'add' && $user->rights->facture->creer) $element = $subelement = 'expedition'; } - $object->origin = $_POST['origin']; - $object->origin_id = $_POST['originid']; + $object->origin = $origin; + $object->origin_id = $originid; // Possibility to add external linked objects with hooks $object->linked_objects [$object->origin] = $object->origin_id; @@ -889,19 +889,19 @@ else if ($action == 'add' && $user->rights->facture->creer) $langs->trans('Deposit'), $amountdeposit, // subprice 1, // quantity - $lines [$i]->tva_tx, 0, // localtax1_tx + $lines[$i]->tva_tx, 0, // localtax1_tx 0, // localtax2_tx 0, // fk_product 0, // remise_percent 0, // date_start 0, // date_end - 0, $lines [$i]->info_bits, // info_bits + 0, $lines[$i]->info_bits, // info_bits 0, // info_bits 'HT', 0, 0, // product_type 1, - $lines [$i]->special_code, + $lines[$i]->special_code, $object->origin, 0, 0, @@ -932,15 +932,15 @@ else if ($action == 'add' && $user->rights->facture->creer) $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); - if ($lines [$i]->subprice < 0) + if ($lines[$i]->subprice < 0) { // Negative line, we create a discount line $discount = new DiscountAbsolute($db); $discount->fk_soc = $object->socid; - $discount->amount_ht = abs($lines [$i]->total_ht); - $discount->amount_tva = abs($lines [$i]->total_tva); - $discount->amount_ttc = abs($lines [$i]->total_ttc); - $discount->tva_tx = $lines [$i]->tva_tx; + $discount->amount_ht = abs($lines[$i]->total_ht); + $discount->amount_tva = abs($lines[$i]->total_tva); + $discount->amount_ttc = abs($lines[$i]->total_ttc); + $discount->tva_tx = $lines[$i]->tva_tx; $discount->fk_user = $user->id; $discount->description = $desc; $discountid = $discount->create($user); @@ -953,38 +953,38 @@ else if ($action == 'add' && $user->rights->facture->creer) } } else { // Positive line - $product_type = ($lines [$i]->product_type ? $lines [$i]->product_type : 0); + $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Date start $date_start = false; - if ($lines [$i]->date_debut_prevue) - $date_start = $lines [$i]->date_debut_prevue; - if ($lines [$i]->date_debut_reel) - $date_start = $lines [$i]->date_debut_reel; - if ($lines [$i]->date_start) - $date_start = $lines [$i]->date_start; + if ($lines[$i]->date_debut_prevue) + $date_start = $lines[$i]->date_debut_prevue; + if ($lines[$i]->date_debut_reel) + $date_start = $lines[$i]->date_debut_reel; + if ($lines[$i]->date_start) + $date_start = $lines[$i]->date_start; // Date end $date_end = false; - if ($lines [$i]->date_fin_prevue) - $date_end = $lines [$i]->date_fin_prevue; - if ($lines [$i]->date_fin_reel) - $date_end = $lines [$i]->date_fin_reel; - if ($lines [$i]->date_end) - $date_end = $lines [$i]->date_end; + if ($lines[$i]->date_fin_prevue) + $date_end = $lines[$i]->date_fin_prevue; + if ($lines[$i]->date_fin_reel) + $date_end = $lines[$i]->date_fin_reel; + if ($lines[$i]->date_end) + $date_end = $lines[$i]->date_end; // Reset fk_parent_line for no child products and special product - if (($lines [$i]->product_type != 9 && empty($lines [$i]->fk_parent_line)) || $lines [$i]->product_type == 9) { + if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { $fk_parent_line = 0; } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines [$i], 'fetch_optionals')) { - $lines [$i]->fetch_optionals($lines [$i]->rowid); - $array_option = $lines [$i]->array_options; + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option = $lines[$i]->array_options; } - $result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $date_start, $date_end, 0, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $object->origin, $lines [$i]->rowid, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option); + $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, $date_start, $date_end, 0, $lines[$i]->info_bits, $lines[$i]->fk_remise_except, 'HT', 0, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_option); if ($result > 0) { $lineid = $result; @@ -995,7 +995,7 @@ else if ($action == 'add' && $user->rights->facture->creer) } // Defined the new fk_parent_line - if ($result > 0 && $lines [$i]->product_type == 9) { + if ($result > 0 && $lines[$i]->product_type == 9) { $fk_parent_line = $result; } } @@ -1841,6 +1841,7 @@ if ($action == 'create') if ($socid > 0) $res = $soc->fetch($socid); + // Load objectsrc if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) @@ -2252,10 +2253,9 @@ if ($action == 'create') $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); - // print '
' . $langs->trans('NotePrivate') . ''; @@ -2266,10 +2266,13 @@ if ($action == 'create') } $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); - // print '
' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . '
' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . '
\n"; // Button "Create Draft" - print '
'; + print '
'; + print ''; + print ' '; + print '
'; print "\n"; @@ -3620,7 +3628,7 @@ if ($action == 'create') include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; - + // Define output language $outputlangs = $langs; $newlang = ''; @@ -3631,7 +3639,7 @@ if ($action == 'create') // Build document if it not exists if (! $file || ! is_readable($file)) { - + if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f5d14b7529..e08a076624e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1115,6 +1115,7 @@ class Form * @param int $maxlength Maximum length of string into list (0=no limit) * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @return string HTML select string + * @see select_dolgroups */ function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0) { @@ -4196,6 +4197,7 @@ class Form * @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param int $force_entity 0 or Id of environment to force * @return void + * @see select_dolusers */ function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0) { diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index a66fb341cff..6ed1bbb2f59 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1543,6 +1543,17 @@ else if ($id > 0 || ! empty($ref)) else print ''; } + // Proposal + if (! empty($conf->propal->enabled) && $object->statut > 0) + { + $langs->load("propal"); + if ($object->statut < 2) + { + if ($user->rights->propal->creer) print ''; + else print ''; + } + } + // Invoicing if (! empty($conf->facture->enabled) && $object->statut > 0) { @@ -1582,7 +1593,7 @@ else if ($id > 0 || ! empty($ref)) /* * Built documents - */ + */ $filename=dol_sanitizeFileName($object->ref); $filedir=$conf->ficheinter->dir_output . "/".$object->ref; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; @@ -1616,7 +1627,7 @@ else if ($id > 0 || ! empty($ref)) /* * Action presend - */ + */ if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); From 6916d251b57ee09325a61e70f9a0d4ac5dc1feec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 20:49:10 +0200 Subject: [PATCH 076/502] New: Can filter events on a group of users. --- ChangeLog | 1 + htdocs/comm/action/index.php | 57 ++++++++++++++++++++++++--- htdocs/comm/action/listactions.php | 19 +++++---- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 47 +++------------------- htdocs/langs/en_US/agenda.lang | 3 +- 6 files changed, 72 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index d018c4ec8ea..8e94283923e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ English Dolibarr ChangeLog For users: New: [ task #867 ] Remove ESAEB external module code from core. New: Can create proposal from an intervention. +New: Can filter events on a group of users. For translators: - Update language files. diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d5434ac86bf..da5b7f95137 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -42,6 +42,7 @@ $filter=GETPOST("filter",'',3); $filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3); $filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); $filterd = GETPOST("userdone","int",3)?GETPOST("userdone","int",3):GETPOST("filterd","int",3); +$usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; @@ -296,9 +297,51 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,1); +print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,$usergroup); dol_fiche_end(); +$showextcals=$listofextcals; +// Legend +if ($conf->use_javascript_ajax) +{ + $s=''; + //print '
'; + + //print $langs->trans("Calendars").': '; + //print ''; + $s.='' . "\n"; + if (! empty($conf->use_javascript_ajax)) + { + $s.='
' . $langs->trans("LocalAgenda").'  
'; + if (is_array($showextcals) && count($showextcals) > 0) + { + foreach ($showextcals as $val) + { + $htmlname = dol_string_nospecial($val['name']); + $s.='' . "\n"; + $s.='
' . $val ['name'] . '  
'; + } + } + } + $s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; + + //print '
'; - - //print $langs->trans("Calendars").': '; - //print ''; - print '' . "\n"; - if (! empty($conf->use_javascript_ajax)) - { - if (is_array($showextcals) && count($showextcals) > 0) - { - print '
' . $langs->trans("LocalAgenda").'  
'; - foreach ($showextcals as $val) - { - $htmlname = dol_string_nospecial($val['name']); - print '' . "\n"; - print '
' . $val ['name'] . '  
'; - } - } - } - if ($showbirthday) print '
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; - - print '
'; print ''; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index f399a81d91d..6f17fd17e2e 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -25,7 +25,8 @@ ListOfEvents= List of Dolibarr events ActionsAskedBy=Events reported by ActionsToDoBy=Events assigned to ActionsDoneBy=Events done by -ActionsAskedBy=Events for user +ActionsForUser=Events for user +ActionsForUsersGroup=Events for all users of group AllMyActions= All my events/tasks AllActions= All events/tasks ViewList=List view From 567280e85ded29d00e4aa0a7b6b918a739c3c3cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 21:17:27 +0200 Subject: [PATCH 077/502] Fix: Too much br --- htdocs/comm/action/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 0cf366080b9..450d7475947 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -1049,7 +1049,7 @@ if ($id > 0) print $extrafields->showOutputField($key,$value); print "


'; + print ''; } dol_fiche_end(); From 56bc99a55837bfd4fe9c52fc425e323377a9de56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 21:40:10 +0200 Subject: [PATCH 078/502] Include iso code for countries --- htdocs/install/mysql/data/llx_00_c_pays.sql | 748 +++++++++++++------- 1 file changed, 500 insertions(+), 248 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_pays.sql index e40eff745e6..7500229407c 100644 --- a/htdocs/install/mysql/data/llx_00_c_pays.sql +++ b/htdocs/install/mysql/data/llx_00_c_pays.sql @@ -31,251 +31,503 @@ -- -- delete from llx_c_pays; -insert into llx_c_pays (rowid,code,libelle) values (0, '' , '-' ); -insert into llx_c_pays (rowid,code,libelle) values (1, 'FR', 'France' ); -insert into llx_c_pays (rowid,code,libelle) values (2, 'BE', 'Belgium' ); -insert into llx_c_pays (rowid,code,libelle) values (3, 'IT', 'Italy' ); -insert into llx_c_pays (rowid,code,libelle) values (4, 'ES', 'Spain' ); -insert into llx_c_pays (rowid,code,libelle) values (5, 'DE', 'Germany' ); -insert into llx_c_pays (rowid,code,libelle) values (6, 'CH', 'Switzerland' ); -insert into llx_c_pays (rowid,code,libelle) values (7, 'GB', 'United Kingdom' ); -insert into llx_c_pays (rowid,code,libelle) values (8, 'IE', 'Irland' ); -insert into llx_c_pays (rowid,code,libelle) values (9, 'CN', 'China' ); -insert into llx_c_pays (rowid,code,libelle) values (10, 'TN', 'Tunisia' ); -insert into llx_c_pays (rowid,code,libelle) values (11, 'US', 'United States' ); -insert into llx_c_pays (rowid,code,libelle) values (12, 'MA', 'Maroc' ); -insert into llx_c_pays (rowid,code,libelle) values (13, 'DZ', 'Algeria' ); -insert into llx_c_pays (rowid,code,libelle) values (14, 'CA', 'Canada' ); -insert into llx_c_pays (rowid,code,libelle) values (15, 'TG', 'Togo' ); -insert into llx_c_pays (rowid,code,libelle) values (16, 'GA', 'Gabon' ); -insert into llx_c_pays (rowid,code,libelle) values (17, 'NL', 'Nerderland' ); -insert into llx_c_pays (rowid,code,libelle) values (18, 'HU', 'Hongrie' ); -insert into llx_c_pays (rowid,code,libelle) values (19, 'RU', 'Russia' ); -insert into llx_c_pays (rowid,code,libelle) values (20, 'SE', 'Sweden' ); -insert into llx_c_pays (rowid,code,libelle) values (21, 'CI', 'Côte d''Ivoire' ); -insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Senegal' ); -insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' ); -insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' ); -insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' ); -insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Saudi Arabia' ); -insert into llx_c_pays (rowid,code,libelle) values (27, 'MC', 'Monaco' ); -insert into llx_c_pays (rowid,code,libelle) values (28, 'AU', 'Australia' ); -insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapour' ); -insert into llx_c_pays (rowid,code,libelle) values (30, 'AF', 'Afghanistan' ); -insert into llx_c_pays (rowid,code,libelle) values (31, 'AX', 'Iles Aland' ); -insert into llx_c_pays (rowid,code,libelle) values (32, 'AL', 'Albanie' ); -insert into llx_c_pays (rowid,code,libelle) values (33, 'AS', 'Samoa américaines'); -insert into llx_c_pays (rowid,code,libelle) values (34, 'AD', 'Andorre' ); -insert into llx_c_pays (rowid,code,libelle) values (35, 'AO', 'Angola' ); -insert into llx_c_pays (rowid,code,libelle) values (36, 'AI', 'Anguilla' ); -insert into llx_c_pays (rowid,code,libelle) values (37, 'AQ', 'Antarctique' ); -insert into llx_c_pays (rowid,code,libelle) values (38, 'AG', 'Antigua-et-Barbuda'); -insert into llx_c_pays (rowid,code,libelle) values (39, 'AM', 'Arménie' ); -insert into llx_c_pays (rowid,code,libelle) values (40, 'AW', 'Aruba' ); -insert into llx_c_pays (rowid,code,libelle) values (41, 'AT', 'Autriche' ); -insert into llx_c_pays (rowid,code,libelle) values (42, 'AZ', 'Azerbaïdjan' ); -insert into llx_c_pays (rowid,code,libelle) values (43, 'BS', 'Bahamas' ); -insert into llx_c_pays (rowid,code,libelle) values (44, 'BH', 'Bahreïn' ); -insert into llx_c_pays (rowid,code,libelle) values (45, 'BD', 'Bangladesh' ); -insert into llx_c_pays (rowid,code,libelle) values (46, 'BB', 'Barbade' ); -insert into llx_c_pays (rowid,code,libelle) values (47, 'BY', 'Biélorussie' ); -insert into llx_c_pays (rowid,code,libelle) values (48, 'BZ', 'Belize' ); -insert into llx_c_pays (rowid,code,libelle) values (49, 'BJ', 'Bénin' ); -insert into llx_c_pays (rowid,code,libelle) values (50, 'BM', 'Bermudes' ); -insert into llx_c_pays (rowid,code,libelle) values (51, 'BT', 'Bhoutan' ); -insert into llx_c_pays (rowid,code,libelle) values (52, 'BO', 'Bolivie' ); -insert into llx_c_pays (rowid,code,libelle) values (53, 'BA', 'Bosnie-Herzégovine'); -insert into llx_c_pays (rowid,code,libelle) values (54, 'BW', 'Botswana' ); -insert into llx_c_pays (rowid,code,libelle) values (55, 'BV', 'Ile Bouvet' ); -insert into llx_c_pays (rowid,code,libelle) values (56, 'BR', 'Brazil' ); -insert into llx_c_pays (rowid,code,libelle) values (57, 'IO', 'Territoire britannique de l''Océan Indien'); -insert into llx_c_pays (rowid,code,libelle) values (58, 'BN', 'Brunei' ); -insert into llx_c_pays (rowid,code,libelle) values (59, 'BG', 'Bulgarie' ); -insert into llx_c_pays (rowid,code,libelle) values (60, 'BF', 'Burkina Faso' ); -insert into llx_c_pays (rowid,code,libelle) values (61, 'BI', 'Burundi' ); -insert into llx_c_pays (rowid,code,libelle) values (62, 'KH', 'Cambodge' ); -insert into llx_c_pays (rowid,code,libelle) values (63, 'CV', 'Cap-Vert' ); -insert into llx_c_pays (rowid,code,libelle) values (64, 'KY', 'Iles Cayman' ); -insert into llx_c_pays (rowid,code,libelle) values (65, 'CF', 'République centrafricaine'); -insert into llx_c_pays (rowid,code,libelle) values (66, 'TD', 'Tchad' ); -insert into llx_c_pays (rowid,code,libelle) values (67, 'CL', 'Chili' ); -insert into llx_c_pays (rowid,code,libelle) values (68, 'CX', 'Ile Christmas' ); -insert into llx_c_pays (rowid,code,libelle) values (69, 'CC', 'Iles des Cocos (Keeling)'); -insert into llx_c_pays (rowid,code,libelle) values (70, 'CO', 'Colombie' ); -insert into llx_c_pays (rowid,code,libelle) values (71, 'KM', 'Comores' ); -insert into llx_c_pays (rowid,code,libelle) values (72, 'CG', 'Congo' ); -insert into llx_c_pays (rowid,code,libelle) values (73, 'CD', 'République démocratique du Congo'); -insert into llx_c_pays (rowid,code,libelle) values (74, 'CK', 'Iles Cook' ); -insert into llx_c_pays (rowid,code,libelle) values (75, 'CR', 'Costa Rica' ); -insert into llx_c_pays (rowid,code,libelle) values (76, 'HR', 'Croatie' ); -insert into llx_c_pays (rowid,code,libelle) values (77, 'CU', 'Cuba' ); -insert into llx_c_pays (rowid,code,libelle) values (78, 'CY', 'Chypre' ); -insert into llx_c_pays (rowid,code,libelle) values (79, 'CZ', 'République Tchèque'); -insert into llx_c_pays (rowid,code,libelle) values (80, 'DK', 'Danemark' ); -insert into llx_c_pays (rowid,code,libelle) values (81, 'DJ', 'Djibouti' ); -insert into llx_c_pays (rowid,code,libelle) values (82, 'DM', 'Dominique' ); -insert into llx_c_pays (rowid,code,libelle) values (83, 'DO', 'République Dominicaine'); -insert into llx_c_pays (rowid,code,libelle) values (84, 'EC', 'Equateur' ); -insert into llx_c_pays (rowid,code,libelle) values (85, 'EG', 'Egypte' ); -insert into llx_c_pays (rowid,code,libelle) values (86, 'SV', 'Salvador' ); -insert into llx_c_pays (rowid,code,libelle) values (87, 'GQ', 'Guinée Equatoriale'); -insert into llx_c_pays (rowid,code,libelle) values (88, 'ER', 'Erythrée' ); -insert into llx_c_pays (rowid,code,libelle) values (89, 'EE', 'Estonia' ); -insert into llx_c_pays (rowid,code,libelle) values (90, 'ET', 'Ethiopie' ); -insert into llx_c_pays (rowid,code,libelle) values (91, 'FK', 'Iles Falkland' ); -insert into llx_c_pays (rowid,code,libelle) values (92, 'FO', 'Iles Féroé' ); -insert into llx_c_pays (rowid,code,libelle) values (93, 'FJ', 'Iles Fidji' ); -insert into llx_c_pays (rowid,code,libelle) values (94, 'FI', 'Finlande' ); -insert into llx_c_pays (rowid,code,libelle) values (95, 'GF', 'Guyane française'); -insert into llx_c_pays (rowid,code,libelle) values (96, 'PF', 'Polynésie française'); -insert into llx_c_pays (rowid,code,libelle) values (97, 'TF', 'Terres australes françaises'); -insert into llx_c_pays (rowid,code,libelle) values (98, 'GM', 'Gambie' ); -insert into llx_c_pays (rowid,code,libelle) values (99, 'GE', 'Georgia' ); -insert into llx_c_pays (rowid,code,libelle) values (100, 'GH', 'Ghana' ); -insert into llx_c_pays (rowid,code,libelle) values (101, 'GI', 'Gibraltar' ); -insert into llx_c_pays (rowid,code,libelle) values (102, 'GR', 'Greece' ); -insert into llx_c_pays (rowid,code,libelle) values (103, 'GL', 'Groenland' ); -insert into llx_c_pays (rowid,code,libelle) values (104, 'GD', 'Grenade' ); ---insert into llx_c_pays (rowid,code,libelle) values (105, 'GP', 'Guadeloupe' ); -insert into llx_c_pays (rowid,code,libelle) values (106, 'GU', 'Guam' ); -insert into llx_c_pays (rowid,code,libelle) values (107, 'GT', 'Guatemala' ); -insert into llx_c_pays (rowid,code,libelle) values (108, 'GN', 'Guinea' ); -insert into llx_c_pays (rowid,code,libelle) values (109, 'GW', 'Guinea-Bissao' ); ---insert into llx_c_pays (rowid,code,libelle) values (110, 'GY', 'Guyana' ); -insert into llx_c_pays (rowid,code,libelle) values (111, 'HT', 'Haiti' ); -insert into llx_c_pays (rowid,code,libelle) values (112, 'HM', 'Iles Heard et McDonald'); -insert into llx_c_pays (rowid,code,libelle) values (113, 'VA', 'Saint-Siège (Vatican)'); -insert into llx_c_pays (rowid,code,libelle) values (114, 'HN', 'Honduras' ); -insert into llx_c_pays (rowid,code,libelle) values (115, 'HK', 'Hong Kong' ); -insert into llx_c_pays (rowid,code,libelle) values (116, 'IS', 'Islande' ); -insert into llx_c_pays (rowid,code,libelle) values (117, 'IN', 'India' ); -insert into llx_c_pays (rowid,code,libelle) values (118, 'ID', 'Indonésie' ); -insert into llx_c_pays (rowid,code,libelle) values (119, 'IR', 'Iran' ); -insert into llx_c_pays (rowid,code,libelle) values (120, 'IQ', 'Iraq' ); -insert into llx_c_pays (rowid,code,libelle) values (121, 'IL', 'Israel' ); -insert into llx_c_pays (rowid,code,libelle) values (122, 'JM', 'Jamaïque' ); -insert into llx_c_pays (rowid,code,libelle) values (123, 'JP', 'Japon' ); -insert into llx_c_pays (rowid,code,libelle) values (124, 'JO', 'Jordanie' ); -insert into llx_c_pays (rowid,code,libelle) values (125, 'KZ', 'Kazakhstan' ); -insert into llx_c_pays (rowid,code,libelle) values (126, 'KE', 'Kenya' ); -insert into llx_c_pays (rowid,code,libelle) values (127, 'KI', 'Kiribati' ); -insert into llx_c_pays (rowid,code,libelle) values (128, 'KP', 'North Corea' ); -insert into llx_c_pays (rowid,code,libelle) values (129, 'KR', 'South Corea' ); -insert into llx_c_pays (rowid,code,libelle) values (130, 'KW', 'Koweït' ); -insert into llx_c_pays (rowid,code,libelle) values (131, 'KG', 'Kirghizistan' ); -insert into llx_c_pays (rowid,code,libelle) values (132, 'LA', 'Laos' ); -insert into llx_c_pays (rowid,code,libelle) values (133, 'LV', 'Lettonie' ); -insert into llx_c_pays (rowid,code,libelle) values (134, 'LB', 'Liban' ); -insert into llx_c_pays (rowid,code,libelle) values (135, 'LS', 'Lesotho' ); -insert into llx_c_pays (rowid,code,libelle) values (136, 'LR', 'Liberia' ); -insert into llx_c_pays (rowid,code,libelle) values (137, 'LY', 'Libye' ); -insert into llx_c_pays (rowid,code,libelle) values (138, 'LI', 'Liechtenstein' ); -insert into llx_c_pays (rowid,code,libelle) values (139, 'LT', 'Lituanie' ); -insert into llx_c_pays (rowid,code,libelle) values (140, 'LU', 'Luxembourg' ); -insert into llx_c_pays (rowid,code,libelle) values (141, 'MO', 'Macao' ); -insert into llx_c_pays (rowid,code,libelle) values (142, 'MK', 'ex-République yougoslave de Macédoine'); -insert into llx_c_pays (rowid,code,libelle) values (143, 'MG', 'Madagascar' ); -insert into llx_c_pays (rowid,code,libelle) values (144, 'MW', 'Malawi' ); -insert into llx_c_pays (rowid,code,libelle) values (145, 'MY', 'Malaisie' ); -insert into llx_c_pays (rowid,code,libelle) values (146, 'MV', 'Maldives' ); -insert into llx_c_pays (rowid,code,libelle) values (147, 'ML', 'Mali' ); -insert into llx_c_pays (rowid,code,libelle) values (148, 'MT', 'Malte' ); -insert into llx_c_pays (rowid,code,libelle) values (149, 'MH', 'Iles Marshall' ); ---insert into llx_c_pays (rowid,code,libelle) values (150, 'MQ', 'Martinique' ); -insert into llx_c_pays (rowid,code,libelle) values (151, 'MR', 'Mauritanie' ); -insert into llx_c_pays (rowid,code,libelle) values (152, 'MU', 'Maurice' ); -insert into llx_c_pays (rowid,code,libelle) values (153, 'YT', 'Mayotte' ); -insert into llx_c_pays (rowid,code,libelle) values (154, 'MX', 'Mexique' ); -insert into llx_c_pays (rowid,code,libelle) values (155, 'FM', 'Micronésie' ); -insert into llx_c_pays (rowid,code,libelle) values (156, 'MD', 'Moldavie' ); -insert into llx_c_pays (rowid,code,libelle) values (157, 'MN', 'Mongolie' ); -insert into llx_c_pays (rowid,code,libelle) values (158, 'MS', 'Monserrat' ); -insert into llx_c_pays (rowid,code,libelle) values (159, 'MZ', 'Mozambique' ); -insert into llx_c_pays (rowid,code,libelle) values (160, 'MM', 'Birmanie (Myanmar)' ); -insert into llx_c_pays (rowid,code,libelle) values (161, 'NA', 'Namibie' ); -insert into llx_c_pays (rowid,code,libelle) values (162, 'NR', 'Nauru' ); -insert into llx_c_pays (rowid,code,libelle) values (163, 'NP', 'Népal' ); -insert into llx_c_pays (rowid,code,libelle) values (164, 'AN', 'Antilles néerlandaises'); -insert into llx_c_pays (rowid,code,libelle) values (165, 'NC', 'Nouvelle-Calédonie'); -insert into llx_c_pays (rowid,code,libelle) values (166, 'NZ', 'Nouvelle-Zélande'); -insert into llx_c_pays (rowid,code,libelle) values (167, 'NI', 'Nicaragua' ); -insert into llx_c_pays (rowid,code,libelle) values (168, 'NE', 'Niger' ); -insert into llx_c_pays (rowid,code,libelle) values (169, 'NG', 'Nigeria' ); -insert into llx_c_pays (rowid,code,libelle) values (170, 'NU', 'Nioué' ); -insert into llx_c_pays (rowid,code,libelle) values (171, 'NF', 'Ile Norfolk' ); -insert into llx_c_pays (rowid,code,libelle) values (172, 'MP', 'Mariannes du Nord'); -insert into llx_c_pays (rowid,code,libelle) values (173, 'NO', 'Norvège' ); -insert into llx_c_pays (rowid,code,libelle) values (174, 'OM', 'Oman' ); -insert into llx_c_pays (rowid,code,libelle) values (175, 'PK', 'Pakistan' ); -insert into llx_c_pays (rowid,code,libelle) values (176, 'PW', 'Palaos' ); -insert into llx_c_pays (rowid,code,libelle) values (177, 'PS', 'Territoire Palestinien Occupé'); -insert into llx_c_pays (rowid,code,libelle) values (178, 'PA', 'Panama' ); -insert into llx_c_pays (rowid,code,libelle) values (179, 'PG', 'Papouasie-Nouvelle-Guinée'); -insert into llx_c_pays (rowid,code,libelle) values (180, 'PY', 'Paraguay' ); -insert into llx_c_pays (rowid,code,libelle) values (181, 'PE', 'Peru' ); -insert into llx_c_pays (rowid,code,libelle) values (182, 'PH', 'Philippines' ); -insert into llx_c_pays (rowid,code,libelle) values (183, 'PN', 'Iles Pitcairn' ); -insert into llx_c_pays (rowid,code,libelle) values (184, 'PL', 'Pologne' ); -insert into llx_c_pays (rowid,code,libelle) values (185, 'PR', 'Porto Rico' ); -insert into llx_c_pays (rowid,code,libelle) values (186, 'QA', 'Qatar' ); ---insert into llx_c_pays (rowid,code,libelle) values (187, 'RE', 'Réunion' ); -insert into llx_c_pays (rowid,code,libelle) values (188, 'RO', 'Roumanie' ); -insert into llx_c_pays (rowid,code,libelle) values (189, 'RW', 'Rwanda' ); -insert into llx_c_pays (rowid,code,libelle) values (190, 'SH', 'Sainte-Hélène' ); -insert into llx_c_pays (rowid,code,libelle) values (191, 'KN', 'Saint-Christophe-et-Niévès'); -insert into llx_c_pays (rowid,code,libelle) values (192, 'LC', 'Sainte-Lucie' ); -insert into llx_c_pays (rowid,code,libelle) values (193, 'PM', 'Saint-Pierre-et-Miquelon'); -insert into llx_c_pays (rowid,code,libelle) values (194, 'VC', 'Saint-Vincent-et-les-Grenadines'); -insert into llx_c_pays (rowid,code,libelle) values (195, 'WS', 'Samoa' ); -insert into llx_c_pays (rowid,code,libelle) values (196, 'SM', 'Saint-Marin' ); -insert into llx_c_pays (rowid,code,libelle) values (197, 'ST', 'Sao Tomé-et-Principe'); -insert into llx_c_pays (rowid,code,libelle) values (198, 'RS', 'Serbie' ); -insert into llx_c_pays (rowid,code,libelle) values (199, 'SC', 'Seychelles' ); -insert into llx_c_pays (rowid,code,libelle) values (200, 'SL', 'Sierra Leone' ); -insert into llx_c_pays (rowid,code,libelle) values (201, 'SK', 'Slovaquie' ); -insert into llx_c_pays (rowid,code,libelle) values (202, 'SI', 'Slovénie' ); -insert into llx_c_pays (rowid,code,libelle) values (203, 'SB', 'Iles Salomon' ); -insert into llx_c_pays (rowid,code,libelle) values (204, 'SO', 'Somalie' ); -insert into llx_c_pays (rowid,code,libelle) values (205, 'ZA', 'Afrique du Sud'); -insert into llx_c_pays (rowid,code,libelle) values (206, 'GS', 'Iles Géorgie du Sud et Sandwich du Sud'); -insert into llx_c_pays (rowid,code,libelle) values (207, 'LK', 'Sri Lanka' ); -insert into llx_c_pays (rowid,code,libelle) values (208, 'SD', 'Soudan' ); -insert into llx_c_pays (rowid,code,libelle) values (209, 'SR', 'Suriname' ); -insert into llx_c_pays (rowid,code,libelle) values (210, 'SJ', 'Iles Svalbard et Jan Mayen'); -insert into llx_c_pays (rowid,code,libelle) values (211, 'SZ', 'Swaziland' ); -insert into llx_c_pays (rowid,code,libelle) values (212, 'SY', 'Syrie' ); -insert into llx_c_pays (rowid,code,libelle) values (213, 'TW', 'Taïwan' ); -insert into llx_c_pays (rowid,code,libelle) values (214, 'TJ', 'Tadjikistan' ); -insert into llx_c_pays (rowid,code,libelle) values (215, 'TZ', 'Tanzanie' ); -insert into llx_c_pays (rowid,code,libelle) values (216, 'TH', 'Thaïlande' ); -insert into llx_c_pays (rowid,code,libelle) values (217, 'TL', 'Timor Oriental'); -insert into llx_c_pays (rowid,code,libelle) values (218, 'TK', 'Tokélaou' ); -insert into llx_c_pays (rowid,code,libelle) values (219, 'TO', 'Tonga' ); -insert into llx_c_pays (rowid,code,libelle) values (220, 'TT', 'Trinité-et-Tobago'); -insert into llx_c_pays (rowid,code,libelle) values (221, 'TR', 'Turquie' ); -insert into llx_c_pays (rowid,code,libelle) values (222, 'TM', 'Turkménistan' ); -insert into llx_c_pays (rowid,code,libelle) values (223, 'TC', 'Iles Turks-et-Caicos'); -insert into llx_c_pays (rowid,code,libelle) values (224, 'TV', 'Tuvalu' ); -insert into llx_c_pays (rowid,code,libelle) values (225, 'UG', 'Ouganda' ); -insert into llx_c_pays (rowid,code,libelle) values (226, 'UA', 'Ukraine' ); -insert into llx_c_pays (rowid,code,libelle) values (227, 'AE', 'Émirats arabes unis'); -insert into llx_c_pays (rowid,code,libelle) values (228, 'UM', 'Iles mineures éloignées des États-Unis'); -insert into llx_c_pays (rowid,code,libelle) values (229, 'UY', 'Uruguay' ); -insert into llx_c_pays (rowid,code,libelle) values (230, 'UZ', 'Ouzbékistan' ); -insert into llx_c_pays (rowid,code,libelle) values (231, 'VU', 'Vanuatu' ); -insert into llx_c_pays (rowid,code,libelle) values (232, 'VE', 'Vénézuela' ); -insert into llx_c_pays (rowid,code,libelle) values (233, 'VN', 'Viêt Nam' ); -insert into llx_c_pays (rowid,code,libelle) values (234, 'VG', 'Iles Vierges britanniques'); -insert into llx_c_pays (rowid,code,libelle) values (235, 'VI', 'Iles Vierges américaines'); -insert into llx_c_pays (rowid,code,libelle) values (236, 'WF', 'Wallis-et-Futuna'); -insert into llx_c_pays (rowid,code,libelle) values (237, 'EH', 'Sahara occidental'); -insert into llx_c_pays (rowid,code,libelle) values (238, 'YE', 'Yémen' ); -insert into llx_c_pays (rowid,code,libelle) values (239, 'ZM', 'Zambie' ); -insert into llx_c_pays (rowid,code,libelle) values (240, 'ZW', 'Zimbabwe' ); -insert into llx_c_pays (rowid,code,libelle) values (241, 'GG', 'Guernesey' ); -insert into llx_c_pays (rowid,code,libelle) values (242, 'IM', 'Ile de Man' ); -insert into llx_c_pays (rowid,code,libelle) values (243, 'JE', 'Jersey' ); -insert into llx_c_pays (rowid,code,libelle) values (244, 'ME', 'Monténégro' ); -insert into llx_c_pays (rowid,code,libelle) values (245, 'BL', 'Saint-Barthélemy'); -insert into llx_c_pays (rowid,code,libelle) values (246, 'MF', 'Saint-Martin' ); -insert into llx_c_pays (rowid,code,libelle) values (247, 'BU', 'Burundi' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (0, '' , null, '-' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (1, 'FR', null, 'France' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (2, 'BE', null, 'Belgium' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (3, 'IT', null, 'Italy' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (4, 'ES', null, 'Spain' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (5, 'DE', null, 'Germany' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (6, 'CH', null, 'Switzerland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (7, 'GB', null, 'United Kingdom' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (8, 'IE', null, 'Irland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (9, 'CN', null, 'China' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (10, 'TN', null, 'Tunisia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (11, 'US', null, 'United States' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (12, 'MA', null, 'Maroc' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (13, 'DZ', null, 'Algeria' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (14, 'CA', null, 'Canada' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (15, 'TG', null, 'Togo' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (16, 'GA', null, 'Gabon' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (17, 'NL', null, 'Nerderland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (18, 'HU', null, 'Hongrie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (19, 'RU', null, 'Russia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (20, 'SE', null, 'Sweden' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (21, 'CI', null, 'Côte d''Ivoire' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (22, 'SN', null, 'Senegal' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (23, 'AR', null, 'Argentine' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (24, 'CM', null, 'Cameroun' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (25, 'PT', null, 'Portugal' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (26, 'SA', null, 'Saudi Arabia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (27, 'MC', null, 'Monaco' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (28, 'AU', null, 'Australia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (29, 'SG', null, 'Singapour' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (30, 'AF', null, 'Afghanistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (31, 'AX', null, 'Iles Aland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (32, 'AL', null, 'Albanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (33, 'AS', null, 'Samoa américaines'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (34, 'AD', null, 'Andorre' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (35, 'AO', null, 'Angola' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (36, 'AI', null, 'Anguilla' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (37, 'AQ', null, 'Antarctique' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (38, 'AG', null, 'Antigua-et-Barbuda'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (39, 'AM', null, 'Arménie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (40, 'AW', null, 'Aruba' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (41, 'AT', null, 'Autriche' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (42, 'AZ', null, 'Azerbaïdjan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (43, 'BS', null, 'Bahamas' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (44, 'BH', null, 'Bahreïn' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (45, 'BD', null, 'Bangladesh' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (46, 'BB', null, 'Barbade' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (47, 'BY', null, 'Biélorussie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (48, 'BZ', null, 'Belize' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (49, 'BJ', null, 'Bénin' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (50, 'BM', null, 'Bermudes' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (51, 'BT', null, 'Bhoutan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (52, 'BO', null, 'Bolivie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (53, 'BA', null, 'Bosnie-Herzégovine'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (54, 'BW', null, 'Botswana' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (55, 'BV', null, 'Ile Bouvet' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (56, 'BR', null, 'Brazil' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (57, 'IO', null, 'Territoire britannique de l''Océan Indien'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (58, 'BN', null, 'Brunei' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (59, 'BG', null, 'Bulgarie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (60, 'BF', null, 'Burkina Faso' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (61, 'BI', null, 'Burundi' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (62, 'KH', null, 'Cambodge' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (63, 'CV', null, 'Cap-Vert' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (64, 'KY', null, 'Iles Cayman' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (65, 'CF', null, 'République centrafricaine'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (66, 'TD', null, 'Tchad' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (67, 'CL', null, 'Chili' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (68, 'CX', null, 'Ile Christmas' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (69, 'CC', null, 'Iles des Cocos (Keeling)'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (70, 'CO', null, 'Colombie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (71, 'KM', null, 'Comores' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (72, 'CG', null, 'Congo' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (73, 'CD', null, 'République démocratique du Congo'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (74, 'CK', null, 'Iles Cook' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (75, 'CR', null, 'Costa Rica' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (76, 'HR', null, 'Croatie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (77, 'CU', null, 'Cuba' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (78, 'CY', null, 'Chypre' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (79, 'CZ', null, 'République Tchèque'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (80, 'DK', null, 'Danemark' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (81, 'DJ', null, 'Djibouti' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (82, 'DM', null, 'Dominique' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (83, 'DO', null, 'République Dominicaine'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (84, 'EC', null, 'Equateur' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (85, 'EG', null, 'Egypte' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (86, 'SV', null, 'Salvador' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (87, 'GQ', null, 'Guinée Equatoriale'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (88, 'ER', null, 'Erythrée' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (89, 'EE', null, 'Estonia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (90, 'ET', null, 'Ethiopie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (91, 'FK', null, 'Iles Falkland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (92, 'FO', null, 'Iles Féroé' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (93, 'FJ', null, 'Iles Fidji' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (94, 'FI', null, 'Finlande' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (95, 'GF', null, 'Guyane française'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (96, 'PF', null, 'Polynésie française'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (97, 'TF', null, 'Terres australes françaises'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (98, 'GM', null, 'Gambie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (99, 'GE', null, 'Georgia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (100,'GH', null, 'Ghana' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (101,'GI', null, 'Gibraltar' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (102,'GR', null, 'Greece' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (103,'GL', null, 'Groenland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (104,'GD', null, 'Grenade' ); +--insert into llx_c_pays (rowid,code,code_iso,libelle) values (105,'GP', null, 'Guadeloupe' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (106,'GU', null, 'Guam' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (107,'GT', null, 'Guatemala' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (108,'GN', null, 'Guinea' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (109,'GW', null, 'Guinea-Bissao' ); +--insert into llx_c_pays (rowid,code,code_iso,libelle) values (110,'GY', null, 'Guyana' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (111,'HT', null, 'Haiti' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (112,'HM', null, 'Iles Heard et McDonald'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (113,'VA', null, 'Saint-Siège (Vatican)'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (114,'HN', null, 'Honduras' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (115,'HK', null, 'Hong Kong' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (116,'IS', null, 'Islande' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (117,'IN', null, 'India' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (118,'ID', null, 'Indonésie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (119,'IR', null, 'Iran' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (120,'IQ', null, 'Iraq' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (121,'IL', null, 'Israel' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (122,'JM', null, 'Jamaïque' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (123,'JP', null, 'Japon' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (124,'JO', null, 'Jordanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (125,'KZ', null, 'Kazakhstan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (126,'KE', null, 'Kenya' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (127,'KI', null, 'Kiribati' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (128,'KP', null, 'North Corea' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (129,'KR', null, 'South Corea' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (130,'KW', null, 'Koweït' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (131,'KG', null, 'Kirghizistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (132,'LA', null, 'Laos' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (133,'LV', null, 'Lettonie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (134,'LB', null, 'Liban' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (135,'LS', null, 'Lesotho' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (136,'LR', null, 'Liberia' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (137,'LY', null, 'Libye' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (138,'LI', null, 'Liechtenstein' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (139,'LT', null, 'Lituanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (140,'LU', null, 'Luxembourg' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (141,'MO', null, 'Macao' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (142,'MK', null, 'ex-République yougoslave de Macédoine'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (143,'MG', null, 'Madagascar' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (144,'MW', null, 'Malawi' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (145,'MY', null, 'Malaisie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (146,'MV', null, 'Maldives' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (147,'ML', null, 'Mali' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (148,'MT', null, 'Malte' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (149,'MH', null, 'Iles Marshall' ); +--insert into llx_c_pays (rowid,code,code_iso,libelle) values (150,'MQ', null, 'Martinique' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (151,'MR', null, 'Mauritanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (152,'MU', null, 'Maurice' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (153,'YT', null, 'Mayotte' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (154,'MX', null, 'Mexique' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (155,'FM', null, 'Micronésie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (156,'MD', null, 'Moldavie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (157,'MN', null, 'Mongolie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (158,'MS', null, 'Monserrat' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (159,'MZ', null, 'Mozambique' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (160,'MM', null, 'Birmanie (Myanmar)' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (161,'NA', null, 'Namibie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (162,'NR', null, 'Nauru' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (163,'NP', null, 'Népal' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (164,'AN', null, 'Antilles néerlandaises'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (165,'NC', null, 'Nouvelle-Calédonie'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (166,'NZ', null, 'Nouvelle-Zélande'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (167,'NI', null, 'Nicaragua' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (168,'NE', null, 'Niger' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (169,'NG', null, 'Nigeria' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (170,'NU', null, 'Nioué' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (171,'NF', null, 'Ile Norfolk' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (172,'MP', null, 'Mariannes du Nord'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (173,'NO', null, 'Norvège' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (174,'OM', null, 'Oman' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (175,'PK', null, 'Pakistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (176,'PW', null, 'Palaos' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (177,'PS', null, 'Territoire Palestinien Occupé'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (178,'PA', null, 'Panama' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (179,'PG', null, 'Papouasie-Nouvelle-Guinée'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (180,'PY', null, 'Paraguay' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (181,'PE', null, 'Peru' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (182,'PH', null, 'Philippines' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (183,'PN', null, 'Iles Pitcairn' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (184,'PL', null, 'Pologne' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (185,'PR', null, 'Porto Rico' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (186,'QA', null, 'Qatar' ); +--insert into llx_c_pays (rowid,code,code_iso,libelle) values (187,'RE', null, 'Réunion' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (188,'RO', null, 'Roumanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (189,'RW', null, 'Rwanda' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (190,'SH', null, 'Sainte-Hélène' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (191,'KN', null, 'Saint-Christophe-et-Niévès'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (192,'LC', null, 'Sainte-Lucie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (193,'PM', null, 'Saint-Pierre-et-Miquelon'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (194,'VC', null, 'Saint-Vincent-et-les-Grenadines'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (195,'WS', null, 'Samoa' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (196,'SM', null, 'Saint-Marin' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (197,'ST', null, 'Sao Tomé-et-Principe'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (198,'RS', null, 'Serbie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (199,'SC', null, 'Seychelles' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (200,'SL', null, 'Sierra Leone' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (201,'SK', null, 'Slovaquie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (202,'SI', null, 'Slovénie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (203,'SB', null, 'Iles Salomon' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (204,'SO', null, 'Somalie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (205,'ZA', null, 'Afrique du Sud'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (206,'GS', null, 'Iles Géorgie du Sud et Sandwich du Sud'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (207,'LK', null, 'Sri Lanka' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (208,'SD', null, 'Soudan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (209,'SR', null, 'Suriname' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (210,'SJ', null, 'Iles Svalbard et Jan Mayen'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (211,'SZ', null, 'Swaziland' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (212,'SY', null, 'Syrie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (213,'TW', null, 'Taïwan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (214,'TJ', null, 'Tadjikistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (215,'TZ', null, 'Tanzanie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (216,'TH', null, 'Thaïlande' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (217,'TL', null, 'Timor Oriental'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (218,'TK', null, 'Tokélaou' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (219,'TO', null, 'Tonga' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (220,'TT', null, 'Trinité-et-Tobago'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (221,'TR', null, 'Turquie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (222,'TM', null, 'Turkménistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (223,'TC', null, 'Iles Turks-et-Caicos'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (224,'TV', null, 'Tuvalu' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (225,'UG', null, 'Ouganda' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (226,'UA', null, 'Ukraine' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (227,'AE', null, 'Émirats arabes unis'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (228,'UM', null, 'Iles mineures éloignées des États-Unis'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (229,'UY', null, 'Uruguay' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (230,'UZ', null, 'Ouzbékistan' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (231,'VU', null, 'Vanuatu' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (232,'VE', null, 'Vénézuela' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (233,'VN', null, 'Viêt Nam' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (234,'VG', null, 'Iles Vierges britanniques'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (235,'VI', null, 'Iles Vierges américaines'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (236,'WF', null, 'Wallis-et-Futuna'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (237,'EH', null, 'Sahara occidental'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (238,'YE', null, 'Yémen' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (239,'ZM', null, 'Zambie' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (240,'ZW', null, 'Zimbabwe' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (241,'GG', null, 'Guernesey' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (242,'IM', null, 'Ile de Man' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (243,'JE', null, 'Jersey' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (244,'ME', null, 'Monténégro' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (245,'BL', null, 'Saint-Barthélemy'); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (246,'MF', null, 'Saint-Martin' ); +insert into llx_c_pays (rowid,code,code_iso,libelle) values (247,'BU', null, 'Burundi' ); + + +UPDATE llx_c_pays SET code_iso = 'AFG' WHERE code = 'AF'; +UPDATE llx_c_pays SET code_iso = 'ALA' WHERE code = 'AX'; +UPDATE llx_c_pays SET code_iso = 'ALB' WHERE code = 'AL'; +UPDATE llx_c_pays SET code_iso = 'DZA' WHERE code = 'DZ'; +UPDATE llx_c_pays SET code_iso = 'ASM' WHERE code = 'AS'; +UPDATE llx_c_pays SET code_iso = 'AND' WHERE code = 'AD'; +UPDATE llx_c_pays SET code_iso = 'AGO' WHERE code = 'AO'; +UPDATE llx_c_pays SET code_iso = 'AIA' WHERE code = 'AI'; +UPDATE llx_c_pays SET code_iso = 'ATA' WHERE code = 'AQ'; +UPDATE llx_c_pays SET code_iso = 'ATG' WHERE code = 'AG'; +UPDATE llx_c_pays SET code_iso = 'ARG' WHERE code = 'AR'; +UPDATE llx_c_pays SET code_iso = 'ARM' WHERE code = 'AM'; +UPDATE llx_c_pays SET code_iso = 'ABW' WHERE code = 'AW'; +UPDATE llx_c_pays SET code_iso = 'AUS' WHERE code = 'AU'; +UPDATE llx_c_pays SET code_iso = 'AUT' WHERE code = 'AT'; +UPDATE llx_c_pays SET code_iso = 'AZE' WHERE code = 'AZ'; +UPDATE llx_c_pays SET code_iso = 'BHS' WHERE code = 'BS'; +UPDATE llx_c_pays SET code_iso = 'BHR' WHERE code = 'BH'; +UPDATE llx_c_pays SET code_iso = 'BGD' WHERE code = 'BD'; +UPDATE llx_c_pays SET code_iso = 'BRB' WHERE code = 'BB'; +UPDATE llx_c_pays SET code_iso = 'BLR' WHERE code = 'BY'; +UPDATE llx_c_pays SET code_iso = 'BEL' WHERE code = 'BE'; +UPDATE llx_c_pays SET code_iso = 'BLZ' WHERE code = 'BZ'; +UPDATE llx_c_pays SET code_iso = 'BEN' WHERE code = 'BJ'; +UPDATE llx_c_pays SET code_iso = 'BMU' WHERE code = 'BM'; +UPDATE llx_c_pays SET code_iso = 'BTN' WHERE code = 'BT'; +UPDATE llx_c_pays SET code_iso = 'BOL' WHERE code = 'BO'; +UPDATE llx_c_pays SET code_iso = 'BES' WHERE code = 'BQ'; +UPDATE llx_c_pays SET code_iso = 'BIH' WHERE code = 'BA'; +UPDATE llx_c_pays SET code_iso = 'BWA' WHERE code = 'BW'; +UPDATE llx_c_pays SET code_iso = 'BVT' WHERE code = 'BV'; +UPDATE llx_c_pays SET code_iso = 'BRA' WHERE code = 'BR'; +UPDATE llx_c_pays SET code_iso = 'IOT' WHERE code = 'IO'; +UPDATE llx_c_pays SET code_iso = 'BRN' WHERE code = 'BN'; +UPDATE llx_c_pays SET code_iso = 'BGR' WHERE code = 'BG'; +UPDATE llx_c_pays SET code_iso = 'BFA' WHERE code = 'BF'; +UPDATE llx_c_pays SET code_iso = 'BDI' WHERE code = 'BI'; +UPDATE llx_c_pays SET code_iso = 'KHM' WHERE code = 'KH'; +UPDATE llx_c_pays SET code_iso = 'CMR' WHERE code = 'CM'; +UPDATE llx_c_pays SET code_iso = 'CAN' WHERE code = 'CA'; +UPDATE llx_c_pays SET code_iso = 'CPV' WHERE code = 'CV'; +UPDATE llx_c_pays SET code_iso = 'CYM' WHERE code = 'KY'; +UPDATE llx_c_pays SET code_iso = 'CAF' WHERE code = 'CF'; +UPDATE llx_c_pays SET code_iso = 'TCD' WHERE code = 'TD'; +UPDATE llx_c_pays SET code_iso = 'CHL' WHERE code = 'CL'; +UPDATE llx_c_pays SET code_iso = 'CHN' WHERE code = 'CN'; +UPDATE llx_c_pays SET code_iso = 'CXR' WHERE code = 'CX'; +UPDATE llx_c_pays SET code_iso = 'CCK' WHERE code = 'CC'; +UPDATE llx_c_pays SET code_iso = 'COL' WHERE code = 'CO'; +UPDATE llx_c_pays SET code_iso = 'COM' WHERE code = 'KM'; +UPDATE llx_c_pays SET code_iso = 'COG' WHERE code = 'CG'; +UPDATE llx_c_pays SET code_iso = 'COD' WHERE code = 'CD'; +UPDATE llx_c_pays SET code_iso = 'COK' WHERE code = 'CK'; +UPDATE llx_c_pays SET code_iso = 'CRI' WHERE code = 'CR'; +UPDATE llx_c_pays SET code_iso = 'CIV' WHERE code = 'CI'; +UPDATE llx_c_pays SET code_iso = 'HRV' WHERE code = 'HR'; +UPDATE llx_c_pays SET code_iso = 'CUB' WHERE code = 'CU'; +UPDATE llx_c_pays SET code_iso = 'CUW' WHERE code = 'CW'; +UPDATE llx_c_pays SET code_iso = 'CYP' WHERE code = 'CY'; +UPDATE llx_c_pays SET code_iso = 'CZE' WHERE code = 'CZ'; +UPDATE llx_c_pays SET code_iso = 'DNK' WHERE code = 'DK'; +UPDATE llx_c_pays SET code_iso = 'DJI' WHERE code = 'DJ'; +UPDATE llx_c_pays SET code_iso = 'DMA' WHERE code = 'DM'; +UPDATE llx_c_pays SET code_iso = 'DOM' WHERE code = 'DO'; +UPDATE llx_c_pays SET code_iso = 'ECU' WHERE code = 'EC'; +UPDATE llx_c_pays SET code_iso = 'EGY' WHERE code = 'EG'; +UPDATE llx_c_pays SET code_iso = 'SLV' WHERE code = 'SV'; +UPDATE llx_c_pays SET code_iso = 'GNQ' WHERE code = 'GQ'; +UPDATE llx_c_pays SET code_iso = 'ERI' WHERE code = 'ER'; +UPDATE llx_c_pays SET code_iso = 'EST' WHERE code = 'EE'; +UPDATE llx_c_pays SET code_iso = 'ETH' WHERE code = 'ET'; +UPDATE llx_c_pays SET code_iso = 'FLK' WHERE code = 'FK'; +UPDATE llx_c_pays SET code_iso = 'FRO' WHERE code = 'FO'; +UPDATE llx_c_pays SET code_iso = 'FJI' WHERE code = 'FJ'; +UPDATE llx_c_pays SET code_iso = 'FIN' WHERE code = 'FI'; +UPDATE llx_c_pays SET code_iso = 'FRA' WHERE code = 'FR'; +UPDATE llx_c_pays SET code_iso = 'GUF' WHERE code = 'GF'; +UPDATE llx_c_pays SET code_iso = 'PYF' WHERE code = 'PF'; +UPDATE llx_c_pays SET code_iso = 'ATF' WHERE code = 'TF'; +UPDATE llx_c_pays SET code_iso = 'GAB' WHERE code = 'GA'; +UPDATE llx_c_pays SET code_iso = 'GMB' WHERE code = 'GM'; +UPDATE llx_c_pays SET code_iso = 'GEO' WHERE code = 'GE'; +UPDATE llx_c_pays SET code_iso = 'DEU' WHERE code = 'DE'; +UPDATE llx_c_pays SET code_iso = 'GHA' WHERE code = 'GH'; +UPDATE llx_c_pays SET code_iso = 'GIB' WHERE code = 'GI'; +UPDATE llx_c_pays SET code_iso = 'GRC' WHERE code = 'GR'; +UPDATE llx_c_pays SET code_iso = 'GRL' WHERE code = 'GL'; +UPDATE llx_c_pays SET code_iso = 'GRD' WHERE code = 'GD'; +UPDATE llx_c_pays SET code_iso = 'GLP' WHERE code = 'GP'; +UPDATE llx_c_pays SET code_iso = 'GUM' WHERE code = 'GU'; +UPDATE llx_c_pays SET code_iso = 'GTM' WHERE code = 'GT'; +UPDATE llx_c_pays SET code_iso = 'GGY' WHERE code = 'GG'; +UPDATE llx_c_pays SET code_iso = 'GIN' WHERE code = 'GN'; +UPDATE llx_c_pays SET code_iso = 'GNB' WHERE code = 'GW'; +UPDATE llx_c_pays SET code_iso = 'GUY' WHERE code = 'GY'; +UPDATE llx_c_pays SET code_iso = 'HTI' WHERE code = 'HT'; +UPDATE llx_c_pays SET code_iso = 'HMD' WHERE code = 'HM'; +UPDATE llx_c_pays SET code_iso = 'VAT' WHERE code = 'VA'; +UPDATE llx_c_pays SET code_iso = 'HND' WHERE code = 'HN'; +UPDATE llx_c_pays SET code_iso = 'HKG' WHERE code = 'HK'; +UPDATE llx_c_pays SET code_iso = 'HUN' WHERE code = 'HU'; +UPDATE llx_c_pays SET code_iso = 'ISL' WHERE code = 'IS'; +UPDATE llx_c_pays SET code_iso = 'IND' WHERE code = 'IN'; +UPDATE llx_c_pays SET code_iso = 'IDN' WHERE code = 'ID'; +UPDATE llx_c_pays SET code_iso = 'IRN' WHERE code = 'IR'; +UPDATE llx_c_pays SET code_iso = 'IRQ' WHERE code = 'IQ'; +UPDATE llx_c_pays SET code_iso = 'IRL' WHERE code = 'IE'; +UPDATE llx_c_pays SET code_iso = 'IMN' WHERE code = 'IM'; +UPDATE llx_c_pays SET code_iso = 'ISR' WHERE code = 'IL'; +UPDATE llx_c_pays SET code_iso = 'ITA' WHERE code = 'IT'; +UPDATE llx_c_pays SET code_iso = 'JAM' WHERE code = 'JM'; +UPDATE llx_c_pays SET code_iso = 'JPN' WHERE code = 'JP'; +UPDATE llx_c_pays SET code_iso = 'JEY' WHERE code = 'JE'; +UPDATE llx_c_pays SET code_iso = 'JOR' WHERE code = 'JO'; +UPDATE llx_c_pays SET code_iso = 'KAZ' WHERE code = 'KZ'; +UPDATE llx_c_pays SET code_iso = 'KEN' WHERE code = 'KE'; +UPDATE llx_c_pays SET code_iso = 'KIR' WHERE code = 'KI'; +UPDATE llx_c_pays SET code_iso = 'PRK' WHERE code = 'KP'; +UPDATE llx_c_pays SET code_iso = 'KOR' WHERE code = 'KR'; +UPDATE llx_c_pays SET code_iso = 'KWT' WHERE code = 'KW'; +UPDATE llx_c_pays SET code_iso = 'KGZ' WHERE code = 'KG'; +UPDATE llx_c_pays SET code_iso = 'LAO' WHERE code = 'LA'; +UPDATE llx_c_pays SET code_iso = 'LVA' WHERE code = 'LV'; +UPDATE llx_c_pays SET code_iso = 'LBN' WHERE code = 'LB'; +UPDATE llx_c_pays SET code_iso = 'LSO' WHERE code = 'LS'; +UPDATE llx_c_pays SET code_iso = 'LBR' WHERE code = 'LR'; +UPDATE llx_c_pays SET code_iso = 'LBY' WHERE code = 'LY'; +UPDATE llx_c_pays SET code_iso = 'LIE' WHERE code = 'LI'; +UPDATE llx_c_pays SET code_iso = 'LTU' WHERE code = 'LT'; +UPDATE llx_c_pays SET code_iso = 'LUX' WHERE code = 'LU'; +UPDATE llx_c_pays SET code_iso = 'MAC' WHERE code = 'MO'; +UPDATE llx_c_pays SET code_iso = 'MKD' WHERE code = 'MK'; +UPDATE llx_c_pays SET code_iso = 'MDG' WHERE code = 'MG'; +UPDATE llx_c_pays SET code_iso = 'MWI' WHERE code = 'MW'; +UPDATE llx_c_pays SET code_iso = 'MYS' WHERE code = 'MY'; +UPDATE llx_c_pays SET code_iso = 'MDV' WHERE code = 'MV'; +UPDATE llx_c_pays SET code_iso = 'MLI' WHERE code = 'ML'; +UPDATE llx_c_pays SET code_iso = 'MLT' WHERE code = 'MT'; +UPDATE llx_c_pays SET code_iso = 'MHL' WHERE code = 'MH'; +UPDATE llx_c_pays SET code_iso = 'MTQ' WHERE code = 'MQ'; +UPDATE llx_c_pays SET code_iso = 'MRT' WHERE code = 'MR'; +UPDATE llx_c_pays SET code_iso = 'MUS' WHERE code = 'MU'; +UPDATE llx_c_pays SET code_iso = 'MYT' WHERE code = 'YT'; +UPDATE llx_c_pays SET code_iso = 'MEX' WHERE code = 'MX'; +UPDATE llx_c_pays SET code_iso = 'FSM' WHERE code = 'FM'; +UPDATE llx_c_pays SET code_iso = 'MDA' WHERE code = 'MD'; +UPDATE llx_c_pays SET code_iso = 'MCO' WHERE code = 'MC'; +UPDATE llx_c_pays SET code_iso = 'MNG' WHERE code = 'MN'; +UPDATE llx_c_pays SET code_iso = 'MNE' WHERE code = 'ME'; +UPDATE llx_c_pays SET code_iso = 'MSR' WHERE code = 'MS'; +UPDATE llx_c_pays SET code_iso = 'MAR' WHERE code = 'MA'; +UPDATE llx_c_pays SET code_iso = 'MOZ' WHERE code = 'MZ'; +UPDATE llx_c_pays SET code_iso = 'MMR' WHERE code = 'MM'; +UPDATE llx_c_pays SET code_iso = 'NAM' WHERE code = 'NA'; +UPDATE llx_c_pays SET code_iso = 'NRU' WHERE code = 'NR'; +UPDATE llx_c_pays SET code_iso = 'NPL' WHERE code = 'NP'; +UPDATE llx_c_pays SET code_iso = 'NLD' WHERE code = 'NL'; +UPDATE llx_c_pays SET code_iso = 'NCL' WHERE code = 'NC'; +UPDATE llx_c_pays SET code_iso = 'NZL' WHERE code = 'NZ'; +UPDATE llx_c_pays SET code_iso = 'NIC' WHERE code = 'NI'; +UPDATE llx_c_pays SET code_iso = 'NER' WHERE code = 'NE'; +UPDATE llx_c_pays SET code_iso = 'NGA' WHERE code = 'NG'; +UPDATE llx_c_pays SET code_iso = 'NIU' WHERE code = 'NU'; +UPDATE llx_c_pays SET code_iso = 'NFK' WHERE code = 'NF'; +UPDATE llx_c_pays SET code_iso = 'MNP' WHERE code = 'MP'; +UPDATE llx_c_pays SET code_iso = 'NOR' WHERE code = 'NO'; +UPDATE llx_c_pays SET code_iso = 'OMN' WHERE code = 'OM'; +UPDATE llx_c_pays SET code_iso = 'PAK' WHERE code = 'PK'; +UPDATE llx_c_pays SET code_iso = 'PLW' WHERE code = 'PW'; +UPDATE llx_c_pays SET code_iso = 'PSE' WHERE code = 'PS'; +UPDATE llx_c_pays SET code_iso = 'PAN' WHERE code = 'PA'; +UPDATE llx_c_pays SET code_iso = 'PNG' WHERE code = 'PG'; +UPDATE llx_c_pays SET code_iso = 'PRY' WHERE code = 'PY'; +UPDATE llx_c_pays SET code_iso = 'PER' WHERE code = 'PE'; +UPDATE llx_c_pays SET code_iso = 'PHL' WHERE code = 'PH'; +UPDATE llx_c_pays SET code_iso = 'PCN' WHERE code = 'PN'; +UPDATE llx_c_pays SET code_iso = 'POL' WHERE code = 'PL'; +UPDATE llx_c_pays SET code_iso = 'PRT' WHERE code = 'PT'; +UPDATE llx_c_pays SET code_iso = 'PRI' WHERE code = 'PR'; +UPDATE llx_c_pays SET code_iso = 'QAT' WHERE code = 'QA'; +UPDATE llx_c_pays SET code_iso = 'REU' WHERE code = 'RE'; +UPDATE llx_c_pays SET code_iso = 'ROU' WHERE code = 'RO'; +UPDATE llx_c_pays SET code_iso = 'RUS' WHERE code = 'RU'; +UPDATE llx_c_pays SET code_iso = 'RWA' WHERE code = 'RW'; +UPDATE llx_c_pays SET code_iso = 'BLM' WHERE code = 'BL'; +UPDATE llx_c_pays SET code_iso = 'SHN' WHERE code = 'SH'; +UPDATE llx_c_pays SET code_iso = 'KNA' WHERE code = 'KN'; +UPDATE llx_c_pays SET code_iso = 'LCA' WHERE code = 'LC'; +UPDATE llx_c_pays SET code_iso = 'MAF' WHERE code = 'MF'; +UPDATE llx_c_pays SET code_iso = 'SPM' WHERE code = 'PM'; +UPDATE llx_c_pays SET code_iso = 'VCT' WHERE code = 'VC'; +UPDATE llx_c_pays SET code_iso = 'WSM' WHERE code = 'WS'; +UPDATE llx_c_pays SET code_iso = 'SMR' WHERE code = 'SM'; +UPDATE llx_c_pays SET code_iso = 'STP' WHERE code = 'ST'; +UPDATE llx_c_pays SET code_iso = 'SAU' WHERE code = 'SA'; +UPDATE llx_c_pays SET code_iso = 'SEN' WHERE code = 'SN'; +UPDATE llx_c_pays SET code_iso = 'SRB' WHERE code = 'RS'; +UPDATE llx_c_pays SET code_iso = 'SYC' WHERE code = 'SC'; +UPDATE llx_c_pays SET code_iso = 'SLE' WHERE code = 'SL'; +UPDATE llx_c_pays SET code_iso = 'SGP' WHERE code = 'SG'; +UPDATE llx_c_pays SET code_iso = 'SXM' WHERE code = 'SX'; +UPDATE llx_c_pays SET code_iso = 'SVK' WHERE code = 'SK'; +UPDATE llx_c_pays SET code_iso = 'SVN' WHERE code = 'SI'; +UPDATE llx_c_pays SET code_iso = 'SLB' WHERE code = 'SB'; +UPDATE llx_c_pays SET code_iso = 'SOM' WHERE code = 'SO'; +UPDATE llx_c_pays SET code_iso = 'ZAF' WHERE code = 'ZA'; +UPDATE llx_c_pays SET code_iso = 'SGS' WHERE code = 'GS'; +UPDATE llx_c_pays SET code_iso = 'SSD' WHERE code = 'SS'; +UPDATE llx_c_pays SET code_iso = 'ESP' WHERE code = 'ES'; +UPDATE llx_c_pays SET code_iso = 'LKA' WHERE code = 'LK'; +UPDATE llx_c_pays SET code_iso = 'SDN' WHERE code = 'SD'; +UPDATE llx_c_pays SET code_iso = 'SUR' WHERE code = 'SR'; +UPDATE llx_c_pays SET code_iso = 'SJM' WHERE code = 'SJ'; +UPDATE llx_c_pays SET code_iso = 'SWZ' WHERE code = 'SZ'; +UPDATE llx_c_pays SET code_iso = 'SWE' WHERE code = 'SE'; +UPDATE llx_c_pays SET code_iso = 'CHE' WHERE code = 'CH'; +UPDATE llx_c_pays SET code_iso = 'SYR' WHERE code = 'SY'; +UPDATE llx_c_pays SET code_iso = 'TWN' WHERE code = 'TW'; +UPDATE llx_c_pays SET code_iso = 'TJK' WHERE code = 'TJ'; +UPDATE llx_c_pays SET code_iso = 'TZA' WHERE code = 'TZ'; +UPDATE llx_c_pays SET code_iso = 'THA' WHERE code = 'TH'; +UPDATE llx_c_pays SET code_iso = 'TLS' WHERE code = 'TL'; +UPDATE llx_c_pays SET code_iso = 'TGO' WHERE code = 'TG'; +UPDATE llx_c_pays SET code_iso = 'TKL' WHERE code = 'TK'; +UPDATE llx_c_pays SET code_iso = 'TON' WHERE code = 'TO'; +UPDATE llx_c_pays SET code_iso = 'TTO' WHERE code = 'TT'; +UPDATE llx_c_pays SET code_iso = 'TUN' WHERE code = 'TN'; +UPDATE llx_c_pays SET code_iso = 'TUR' WHERE code = 'TR'; +UPDATE llx_c_pays SET code_iso = 'TKM' WHERE code = 'TM'; +UPDATE llx_c_pays SET code_iso = 'TCA' WHERE code = 'TC'; +UPDATE llx_c_pays SET code_iso = 'TUV' WHERE code = 'TV'; +UPDATE llx_c_pays SET code_iso = 'UGA' WHERE code = 'UG'; +UPDATE llx_c_pays SET code_iso = 'UKR' WHERE code = 'UA'; +UPDATE llx_c_pays SET code_iso = 'ARE' WHERE code = 'AE'; +UPDATE llx_c_pays SET code_iso = 'GBR' WHERE code = 'GB'; +UPDATE llx_c_pays SET code_iso = 'USA' WHERE code = 'US'; +UPDATE llx_c_pays SET code_iso = 'UMI' WHERE code = 'UM'; +UPDATE llx_c_pays SET code_iso = 'URY' WHERE code = 'UY'; +UPDATE llx_c_pays SET code_iso = 'UZB' WHERE code = 'UZ'; +UPDATE llx_c_pays SET code_iso = 'VUT' WHERE code = 'VU'; +UPDATE llx_c_pays SET code_iso = 'VEN' WHERE code = 'VE'; +UPDATE llx_c_pays SET code_iso = 'VNM' WHERE code = 'VN'; +UPDATE llx_c_pays SET code_iso = 'VGB' WHERE code = 'VG'; +UPDATE llx_c_pays SET code_iso = 'VIR' WHERE code = 'VI'; +UPDATE llx_c_pays SET code_iso = 'WLF' WHERE code = 'WF'; +UPDATE llx_c_pays SET code_iso = 'ESH' WHERE code = 'EH'; +UPDATE llx_c_pays SET code_iso = 'YEM' WHERE code = 'YE'; +UPDATE llx_c_pays SET code_iso = 'ZMB' WHERE code = 'ZM'; +UPDATE llx_c_pays SET code_iso = 'ZWE' WHERE code = 'ZW'; + From 7d16f62a9d628634e7d42bf68cff8a57cad724f7 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 28 Jun 2014 22:48:20 +0200 Subject: [PATCH 079/502] New : add remaining to ship on delivery PDF --- .../livraison/pdf/pdf_typhon.modules.php | 27 ++++++++++++++----- htdocs/livraison/class/livraison.class.php | 3 ++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index b13177f9127..095e325cb81 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -97,10 +97,11 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Define position of columns $this->posxdesc=$this->marge_gauche+1; - $this->posxcomm=112; + $this->posxcomm=900; //$this->posxtva=112; //$this->posxup=126; - $this->posxqty=174; + $this->posxqty=140; + $this->posxremainingqty=165; //$this->posxdiscount=162; //$this->postotalht=174; if ($this->page_largeur < 210) // To work with US executive format @@ -207,6 +208,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $commande->fetch($expedition->origin_id); } $object->commande=$commande; // We set order of shipment onto delivery. + $object->commande->loadExpeditions(); $pdf->Open(); @@ -355,7 +357,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Quantity //$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 3, $object->lines[$i]->qty_shipped, 0, 'R'); + $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 3, $object->lines[$i]->qty_shipped, 0, 'R'); + + // Remaining to ship + $pdf->SetXY($this->posxremainingqty, $curY); + $qtyRemaining = $object->lines[$i]->qty_asked - $object->commande->expeditions[$object->lines[$i]->fk_origin_line]; + $pdf->MultiCell($this->page_largeur-$this->marge_droite - $this->posxremainingqty, 3, $qtyRemaining, 0, 'R'); /* // Remise sur ligne $pdf->SetXY($this->posxdiscount, $curY); @@ -606,7 +613,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell($this->posxcomm - $this->posxdesc,2, $outputlangs->transnoentities("Designation"),'','L'); } - + // Modif SEB pour avoir une col en plus pour les commentaires clients $pdf->line($this->posxcomm, $tab_top, $this->posxcomm, $tab_top + $tab_height); if (empty($hidetop)) { @@ -615,12 +622,18 @@ class pdf_typhon extends ModelePDFDeliveryOrder } // Qty - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); + $pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height); if (empty($hidetop)) { - $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','R'); + $pdf->SetXY($this->posxqty, $tab_top+1); + $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','C'); } + // Remain to ship + $pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height); + if (empty($hidetop)) { + $pdf->SetXY($this->posxremainingqty, $tab_top+1); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShip"),'','C'); + } } /** diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 58ad4f1bc0d..647983491a0 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -677,7 +677,7 @@ class Livraison extends CommonObject { $this->lines = array(); - $sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped,"; + $sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, "; $sql.= " cd.qty as qty_asked, cd.label as custom_label,"; $sql.= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc"; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld"; @@ -709,6 +709,7 @@ class Livraison extends CommonObject $line->product_ref = $obj->product_ref; // Product ref $line->product_desc = $obj->product_desc; // Product description $line->product_type = $obj->fk_product_type; + $line->fk_origin_line = $obj->fk_origin_line; $line->price = $obj->price; $line->total_ht = $obj->total_ht; From 65febb6e7b622307de106dddf08f1170d014548e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 01:04:45 +0200 Subject: [PATCH 080/502] Translation of juridical status for de_CH --- htdocs/langs/de_CH/companies.lang | 11 +++++++++++ htdocs/langs/de_CH/main.lang | 20 ++++++++++++++++++++ htdocs/langs/en_US/languages.lang | 1 + 3 files changed, 32 insertions(+) create mode 100644 htdocs/langs/de_CH/companies.lang create mode 100644 htdocs/langs/de_CH/main.lang diff --git a/htdocs/langs/de_CH/companies.lang b/htdocs/langs/de_CH/companies.lang new file mode 100644 index 00000000000..26cd766b83e --- /dev/null +++ b/htdocs/langs/de_CH/companies.lang @@ -0,0 +1,11 @@ +# Dolibarr language file - Source file is en_US - companies +JuridicalStatus600=Einzelfirma +JuridicalStatus601=Einfache Gesellschaft +JuridicalStatus602=Kollektivgesellschaft +JuridicalStatus603=Kommanditgesellschaft +JuridicalStatus604=Aktiengesellschaft (AG) +JuridicalStatus605=Kommanditaktiengesellschaft +JuridicalStatus606=Gesellschaft mit beschränkter Haftung (GmbH) +JuridicalStatus607=Genossenschaft +JuridicalStatus608=Verein +JuridicalStatus609=Stiftung \ No newline at end of file diff --git a/htdocs/langs/de_CH/main.lang b/htdocs/langs/de_CH/main.lang new file mode 100644 index 00000000000..adbf494c99e --- /dev/null +++ b/htdocs/langs/de_CH/main.lang @@ -0,0 +1,20 @@ +# Dolibarr language file - Source file is en_US - main +DIRECTION=ltr +FONTFORPDF=helvetica +FONTSIZEFORPDF=10 +SeparatorDecimal=, +SeparatorThousand=None +FormatDateShort=%d/%m/%Y +FormatDateShortInput=%d/%m/%Y +FormatDateShortJava=dd/MM/yyyy +FormatDateShortJavaInput=dd/MM/yyyy +FormatDateShortJQuery=dd/MM/yy +FormatDateShortJQueryInput=dd/MM/yy +FormatHourShort=%H:%M +FormatHourShortDuration=%H:%M +FormatDateTextShort=%d %b %Y +FormatDateText=%d %B %Y +FormatDateHourShort=%d/%m/%Y %H:%M +FormatDateHourSecShort=%d/%m/%Y %H:%M:%S +FormatDateHourTextShort=%d %b %Y %H:%M +FormatDateHourText=%d %B %Y %H:%M \ No newline at end of file diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index e94e8e13ac3..1116e29c21c 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -10,6 +10,7 @@ Language_da_DA=Danish Language_da_DK=Danish Language_de_DE=German Language_de_AT=German (Austria) +Language_de_CH=German (Switzerland) Language_el_GR=Greek Language_en_AU=English (Australia) Language_en_GB=English (United Kingdom) From a96655c3634015acbabd768d8eeff610f83c671d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 01:13:44 +0200 Subject: [PATCH 081/502] Translation of juridical status for de_CH --- htdocs/langs/fr_FR/agenda.lang | 2 ++ htdocs/langs/fr_FR/languages.lang | 1 + htdocs/langs/fr_FR/main.lang | 4 ++-- htdocs/langs/fr_FR/other.lang | 4 ++-- htdocs/langs/fr_FR/shop.lang | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index a96b6a0cf2e..b9be97ecad5 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -25,6 +25,8 @@ ListOfEvents= Liste des événements Dolibarr ActionsAskedBy=Événements enregistrés par ActionsToDoBy=Événements affectés à ActionsDoneBy=Événements réalisés par +ActionsForUser=Evénements de l'utilisateur +ActionsForUsersGroup=Evénements de tous les utilisateurs du groupe AllMyActions= Tous mes événements AllActions= Tous les événements ViewList=Vue liste diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index e1ee1ca52d2..8b616b6d1b6 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -10,6 +10,7 @@ Language_da_DA=Danois Language_da_DK=Danois Language_de_DE=Allemand Language_de_AT=Allemand (Autriche) +Language_de_CH=Allemand (Suisse) Language_el_GR=Grèque Language_en_AU=Anglais (Australie) Language_en_GB=Anglais (Royaume-Uni) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 4f13b1a1bad..df61fe2bed2 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -355,8 +355,8 @@ ActionsDoneShort=Effectuées ActionNotApplicable=Non applicable ActionRunningNotStarted=A réaliser ActionRunningShort=En cours -ActionUncomplete=Incomplet ActionDoneShort=Terminé +ActionUncomplete=Incomplets CompanyFoundation=Société ou institution ContactsForCompany=Contacts de ce tiers ContactsAddressesForCompany=Contacts/adresses de ce tiers @@ -508,7 +508,7 @@ NbOfCustomers=Nombre de clients NbOfLines=Nombre de lignes NbOfObjects=Nombre d'objets NbOfReferers=Nombre de références -Referers=Consommation +Referers=Objets référant TotalQuantity=Quantité totale DateFromTo=Du %s au %s DateFrom=A partir du %s diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 1d465b04198..f5a83e574a6 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -38,10 +38,10 @@ Notify_BILL_SUPPLIER_CANCELED=Facture founisseur annulée Notify_CONTRACT_VALIDATE=Validation contrat Notify_FICHEINTER_VALIDATE=Validation fiche d'intervention Notify_SHIPPING_VALIDATE=Validation expédition -Notify_SHIPPING_SENTBYMAIL=Envoi expedition par email +Notify_SHIPPING_SENTBYMAIL=Envoi expédition par email Notify_MEMBER_VALIDATE=Validation adhérent Notify_MEMBER_MODIFY=Adhérent modifié -Notify_MEMBER_SUBSCRIPTION=Adhérension +Notify_MEMBER_SUBSCRIPTION=Adhésion Notify_MEMBER_RESILIATE=Résiliation adhérent Notify_MEMBER_DELETE=Suppression adhérent Notify_PROJECT_CREATE=Création de projet diff --git a/htdocs/langs/fr_FR/shop.lang b/htdocs/langs/fr_FR/shop.lang index b6872323fb8..a04bb133c21 100644 --- a/htdocs/langs/fr_FR/shop.lang +++ b/htdocs/langs/fr_FR/shop.lang @@ -1,5 +1,5 @@ # Dolibarr language file - Source file is en_US - shop -FailedConnectDBCheckModuleSetup=Failed to connect to oscommerce database. Check your module setup +FailedConnectDBCheckModuleSetup=Impossible de se connecter à la base de données oscommerce. Vérifiez la configuration du module Shop=Boutique ShopWeb=Boutique Web LastOrders=Dernières commandes From 330c965cb9369b5d0ffafb832657680297a119df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 02:45:55 +0200 Subject: [PATCH 082/502] New: Add hook "searchAgendaFrom". --- ChangeLog | 9 ++--- htdocs/comm/action/index.php | 7 ++-- htdocs/comm/action/listactions.php | 13 ++++--- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 52 ++++++++++++++------------- htdocs/langs/en_US/agenda.lang | 1 + htdocs/theme/eldy/style.css.php | 2 +- 7 files changed, 49 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e94283923e..ddd3c6f33b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,15 +5,16 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: -New: [ task #867 ] Remove ESAEB external module code from core. -New: Can create proposal from an intervention. -New: Can filter events on a group of users. +- New: [ task #867 ] Remove ESAEB external module code from core. +- New: Can create proposal from an intervention. +- New: Can filter events on a group of users. +- New: Add thirdparty to filter on events. For translators: - Update language files. For developers: -- +- New: Add hook "searchAgendaFrom". ***** ChangeLog for 3.6 compared to 3.5.* ***** diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index da5b7f95137..ef5bf1c68bf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -56,9 +56,10 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="a.datec"; // Security check -$socid = GETPOST("socid","int",1); +$socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +if ($socid < 0) $socid=''; $canedit=1; if (! $user->rights->agenda->myactions->read) accessforbidden(); @@ -102,6 +103,8 @@ $langs->load("agenda"); $langs->load("other"); $langs->load("commercial"); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('agenda')); /* @@ -993,7 +996,7 @@ else // View by day $timestamp=dol_mktime(12,0,0,$month,$day,$year); $arraytimestamp=dol_getdate($timestamp); - echo ''; + echo '
'; echo ' '; echo ' \n"; echo " \n"; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index d98c84e7bae..51fa2dfeec2 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -78,6 +78,7 @@ if (! $sortfield) $socid = GETPOST("socid",'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +if ($socid < 0) $socid=''; $canedit=1; if (! $user->rights->agenda->myactions->read) accessforbidden(); @@ -89,6 +90,8 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi $filterd=$user->id; } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('agendalist')); /* @@ -192,7 +195,7 @@ if ($resql) if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions"); - if ($socid) + /*if ($socid) { $societe = new Societe($db); $societe->fetch($socid); @@ -201,8 +204,8 @@ if ($resql) else { $newtitle=$langs->trans($title); - } - + }*/ + $newtitle=$langs->trans($title); $tabactive=''; if ($action == 'show_month') $tabactive='cardmonth'; @@ -210,10 +213,10 @@ if ($resql) if ($action == 'show_day') $tabactive='cardday'; if ($action == 'show_list') $tabactive='cardlist'; - $head = calendars_prepare_head(''); + $head = calendars_prepare_head($param); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,''); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0); dol_fiche_end(); // Add link to show birthdays diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0adb10c1d22..bff13cf2781 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -671,7 +671,7 @@ class Form * Return HTML code to select a company. * * @param int $selected Preselected products - * @param string $htmlname Name of HTML seletc field (must be unique in page) + * @param string $htmlname Name of HTML select field (must be unique in page) * @param int $filter Filter on thirdparty * @param int $limit Limit on number of returned lines * @param array $ajaxoptions Options for ajax_autocompleter diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 9e41b0e5c1d..5ae51bf0eaa 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -46,7 +46,7 @@ */ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $usergroupid='') { - global $conf, $user, $langs, $db; + global $conf, $user, $langs, $db, $hookmanager; // Filters print ''; @@ -59,10 +59,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; - print '
'; - - //print '
'.$langs->trans("Day".$arraytimestamp['wday'])."
'; - //print ''; print ''; From faeeca533bc570ce2c523629f79094b5788181fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 04:34:12 +0200 Subject: [PATCH 084/502] Fix: sql error --- htdocs/comm/action/index.php | 10 +++++----- htdocs/comm/action/listactions.php | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ef5bf1c68bf..e7f277a116b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -378,14 +378,14 @@ $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; -if ($usergroup) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; +if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; -if ($socid) $sql.= ' AND a.fk_soc = '.$socid; -if ($usergroup) $sql.= " AND ugu.fk_user = a.fk_user_action"; +if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; +if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($action == 'show_day') { $sql.= " AND ("; @@ -419,13 +419,13 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } -if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup) +if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) { $sql.= " AND ("; if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; - if ($usergroup) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; + if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } // Sort on date diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 51fa2dfeec2..0c220a89194 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -42,6 +42,7 @@ $actioncode=GETPOST("actioncode","alpha",3); $pid=GETPOST("projectid",'int',3); $status=GETPOST("status",'alpha'); $type=GETPOST('type'); +$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); if (empty($action)) { @@ -53,6 +54,7 @@ $filter=GETPOST("filter",'',3); $filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3); $filtert = GETPOST("usertodo","int",3)?GETPOST("usertodo","int",3):GETPOST("filtert","int",3); $filterd = GETPOST("userdone","int",3)?GETPOST("userdone","int",3):GETPOST("filterd","int",3); +$usergroup = GETPOST("usergroup","int",3); $showbirthday = empty($conf->use_javascript_ajax)?GETPOST("showbirthday","int"):1; $sortfield = GETPOST("sortfield",'alpha'); @@ -149,33 +151,33 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c,"; $sql.= " ".MAIN_DB_PREFIX.'user as u,'; $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; -if ($usergroup) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON a.fk_user_author = ua.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ut ON a.fk_user_action = ut.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as ud ON a.fk_user_done = ud.rowid"; +if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; $sql.= " WHERE c.id = a.fk_action"; $sql.= ' AND a.fk_user_author = u.rowid'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; // To limit to entity if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; -if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($usergroup) $sql.= " AND ugu.fk_user = a.fk_user_action"; +if ($socid > 0) $sql.= " AND s.rowid = ".$socid; +if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($type) $sql.= " AND c.id = ".$type; if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable if ($status == '50') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; } // Running if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } -if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup) +if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) { $sql.= " AND ("; if ($filtera > 0) $sql.= " a.fk_user_author = ".$filtera; if ($filtert > 0) $sql.= ($filtera>0?" OR ":"")." a.fk_user_action = ".$filtert; if ($filterd > 0) $sql.= ($filtera>0||$filtert>0?" OR ":"")." a.fk_user_done = ".$filterd; - if ($usergroup) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; + if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } $sql.= $db->order($sortfield,$sortorder); @@ -216,7 +218,7 @@ if ($resql) $head = calendars_prepare_head($param); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,$actioncode,$usergroup); dol_fiche_end(); // Add link to show birthdays From 8cfdfbe47d0a8c9532233e451adf48a7a27275fe Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 29 Jun 2014 05:41:24 +0200 Subject: [PATCH 085/502] Update --- htdocs/admin/fiscalyear.php | 183 +------------------------ htdocs/admin/fiscalyear_card.php | 58 ++++---- htdocs/core/class/fiscalyear.class.php | 53 +++++-- htdocs/core/lib/fiscalyear.lib.php | 51 +++++++ htdocs/langs/fr_FR/admin.lang | 8 +- 5 files changed, 130 insertions(+), 223 deletions(-) create mode 100644 htdocs/core/lib/fiscalyear.lib.php diff --git a/htdocs/admin/fiscalyear.php b/htdocs/admin/fiscalyear.php index 7929fd5046f..607630461fb 100644 --- a/htdocs/admin/fiscalyear.php +++ b/htdocs/admin/fiscalyear.php @@ -52,185 +52,6 @@ $object = new Fiscalyear($db); * Actions */ -// Add -if ($action == 'add') -{ - if (! GETPOST('cancel','alpha')) - { - $error=0; - - $object->label = GETPOST('label','alpha'); - $object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); - $object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); - $object->statut = 0; - - if (! $object->label) - { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'
'; - $error++; - } - if (! $object->datestart) - { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateStart")).'
'; - $error++; - } - if (! $object->dateend) - { - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'
'; - $error++; - } - - if (! $error) - { - $id = $object->create(); - - if ($id > 0) - { - header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); - exit; - } - else - { - $mesg=$object->error; - $action='create'; - } - } - else - { - $action='create'; - } - } - else - { - header("Location: index.php"); - exit; - } - - if (! GETPOST('cancel','alpha')) - { - $error=0; - - // Check values - $datestart = dol_mktime(12, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']); - $dateend = dol_mktime(12, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']); - $label = $_POST['label']; - - if (empty($label)) - { - $mesgs[]='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Label")).'
'; - $error++; - //$action='create'; - } - if (empty($datestart) || empty($dateend)) - { - $mesgs[]='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Date")).'
'; - $error++; - //$action='create'; - } - - if (! $error) - { - $this->db->begin(); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_fiscalyear"; - $sql.= " (label, datestart, dateend, statut, entity)"; - $sql.= " VALUES('".$label."',"; - $sql.= " '".$datestart."',"; - $sql.= " '".$dateend."',"; - $sql.= " ' 0,"; - $sql.= " ".$conf->entity."'"; - $sql.=')'; - - dol_syslog(get_class($this)."::create_label sql=".$sql); - if ($this->db->query($sql)) - { - return 1; - } - else - { - $this->error=$this->db->lasterror(); - $this->errno=$this->db->lasterrno(); - return -1; - } - } - } -} - -// Rename field -if ($action == 'update') -{ - if ($_POST["button"] != $langs->trans("Cancel")) - { - // Check values - if (! GETPOST('type')) - { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); - $action = 'create'; - } - if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring) - { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorSizeTooLongForVarcharType",$maxsizestring); - $action = 'edit'; - } - if (GETPOST('type')=='int' && $extrasize > $maxsizeint) - { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorSizeTooLongForIntType",$maxsizeint); - $action = 'edit'; - } - - if (! $error) - { - if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname'])) - { - $result=$extrafields->update($_POST['attrname'],$_POST['label'],$_POST['type'],$extrasize,$elementtype,(GETPOST('unique')?1:0)); - if ($result > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - $error++; - $mesg=$extrafields->error; - } - } - else - { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); - } - } - } -} - -// Delete attribute -if ($action == 'delete') -{ - if(isset($_GET["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_GET["attrname"])) - { - $result=$extrafields->delete($_GET["attrname"],$elementtype); - if ($result >= 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else $mesg=$extrafields->error; - } - else - { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); - } -} - /* * View */ @@ -239,9 +60,9 @@ $form = new Form($db); llxHeader('',$title); -$title = $langs->trans('Accountancysetup'); +$title = $langs->trans('FiscalYears'); -print_fiche_titre($langs->trans('Fiscalyear')); +print_fiche_titre($langs->trans('FiscalYears')); dol_htmloutput_errors($mesg); diff --git a/htdocs/admin/fiscalyear_card.php b/htdocs/admin/fiscalyear_card.php index d18fdbc3ec4..3845e689e79 100644 --- a/htdocs/admin/fiscalyear_card.php +++ b/htdocs/admin/fiscalyear_card.php @@ -17,13 +17,13 @@ /** * \file htdocs/admin/fiscalyear_card.php - * \brief Page to show a fiscal yeartrip + * \brief Page to show a fiscal year */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->load("admin"); @@ -50,12 +50,13 @@ $mesg = ''; $object = new Fiscalyear($db); +$date_start=dol_mktime(0,0,0,GETPOST('fiscalyearmonth','int'),GETPOST('fiscalyearday','int'),GETPOST('fiscalyearyear','int')); +$date_end=dol_mktime(0,0,0,GETPOST('fiscalyearendmonth','int'),GETPOST('fiscalyearendday','int'),GETPOST('fiscalyearendyear','int')); + /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once - if ($action == 'confirm_delete' && $confirm == "yes") { $result=$object->delete($id); @@ -76,18 +77,18 @@ else if ($action == 'add') { $error=0; - $object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); - $object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); - $object->label = GETPOST('label','alpha'); + $db->begin(); + + $object->datestart = $date_start; + $object->dateend = $date_end; + $object->label = GETPOST('label','alpha'); $object->statut = GETPOST('statut','int');; - /* if (empty($object->datestart) && empty($object->dateend)) { - $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")); + $mesg.=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")); $error++; } - */ if (empty($object->label)) { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'
'; @@ -116,7 +117,7 @@ else if ($action == 'add') } else { - header("Location: fiscalyear.php"); + header("Location: ./fiscalyear.php"); exit; } } @@ -169,10 +170,7 @@ if ($action == 'create') dol_htmloutput_errors($mesg); - $datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int')); - $dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int')); - - print '
' . "\n"; + print ''; print ''; print ''; @@ -182,15 +180,13 @@ if ($action == 'create') print '
'; // Date start - print ""; - print ''; - - // Date end - print ""; - print ''; // Statut @@ -212,6 +208,10 @@ else if ($id) { dol_htmloutput_mesg($mesg); + $head = fiscalyear_prepare_head($object); + + dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron'); + if ($action == 'edit') { print '' . "\n"; @@ -224,7 +224,7 @@ else if ($id) // Ref print ""; print ''; // Label @@ -262,14 +262,14 @@ else if ($id) print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteFiscalYear"),$langs->trans("ConfirmDeleteFiscalYear"),"confirm_delete"); } - - print '
'; + if (! empty($conf->browser->phone)) print '
'; + else print ''; - print ''; + if (! empty($conf->browser->phone)) print ''; + else print ''; - - // Buttons - /*print '';*/ - - //print '
'; print ''; @@ -110,6 +108,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; } + if (! empty($conf->societe->enabled) && $user->rights->societe->lire) + { + print ''; + print ''; + } + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -123,37 +131,29 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; } + // Hooks + $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); + $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been + print '
'; + print $langs->trans("Thirdpary").'   '; + print ''; + print $form->select_thirdparty($socid, 'socid'); + print '
'; - //print '
'; - print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' '; - print '
'; - print '
'; + if (! empty($conf->browser->phone)) print '
'; + else print '
'; print ''; - print '
'; print '
'; print ''; print '
'; print '
'; - print ''; + if (! empty($conf->browser->phone)) print ''; + else print '
'; - print '
'; + print ''; // Close fichecenter print '
'; print ''; @@ -471,6 +471,10 @@ function calendars_prepare_head($param) $head[$h][2] = 'cardlist'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:''); + $head[$h][1] = $langs->trans("ViewPerUser"); + $head[$h][2] = 'cardperuser'; + $h++; $object=new stdClass(); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 6f17fd17e2e..fcee3d669cf 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -33,6 +33,7 @@ ViewList=List view ViewCal=Month view ViewDay=Day view ViewWeek=Week view +ViewPerUser=Per user ViewWithPredefinedFilters= View with predefined filters AutoActions= Automatic filling AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked (by default), only manual actions will be included in agenda. diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b5324b65a0b..78457f899d2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2271,7 +2271,7 @@ li.cal_event { border: none; list-style-type: none; } /* Ajax - Liste deroulante de l'autocompletion */ /* ============================================================================== */ -.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff; } +.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; } .ui-autocomplete-loading { background: white url() right center no-repeat; } .ui-autocomplete { From 6f0250cb944b448b1253a2e666244eaa69846c22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 04:25:42 +0200 Subject: [PATCH 083/502] Fix: typo --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4ab21343114..b027d0b0528 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -593,7 +593,7 @@ abstract class CommonObject } /** - * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdpary + * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty * * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 5ae51bf0eaa..3367d227dd8 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -112,7 +112,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print '
'; - print $langs->trans("Thirdpary").'   '; + print $langs->trans("ThirdParty").'   '; print ''; print $form->select_thirdparty($socid, 'socid'); print '
'.$langs->trans("Label").'
'.$langs->trans("DateStart").''; - print $form->select_date($datestart?$datestart:-1,'','','','','add',1,1); + print '
'.$langs->trans("DateStart").''; + print $form->select_date(($date_start?$date_start:''),'fiscalyear'); print '
'.$langs->trans("DateEnd").''; - print $form->select_date($dateend?$dateend:-1,'','','','','add',1,1); + + // Date end + print '
'.$langs->trans("DateEnd").''; + print $form->select_date(($date_end?$date_end:-1),'fiscalyearend'); print '
'.$langs->trans("Ref").''; - print $object->rowid; + print $object->ref; print '
'; + + print '
'; $linkback = ''.$langs->trans("BackToList").''; - + // Ref print ''; diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 3d48d47a082..6956884e733 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/class/fiscalyear.php * \ingroup fiscal year - * \brief Page d'administration/configuration + * \brief File of class to manage fiscal years */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; */ class Fiscalyear { - public $element='Fiscalyear'; + public $element='fiscalyear'; public $table_element='accounting_fiscalyear'; public $table_element_line = ''; public $fk_element = ''; @@ -69,11 +69,13 @@ class Fiscalyear function create() { global $conf; + + $error = 0; $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_fiscalyear ("; - $sql.= " label"; + $sql.= "label"; $sql.= ", datestart"; $sql.= ", dateend"; $sql.= ", statut"; @@ -216,7 +218,34 @@ class Fiscalyear return -1; } } - + + /** + * Delete record + * + * @param int $id Id of record to delete + * @return int <0 if KO, >0 if OK + */ + function delete($id) + { + $this->db->begin(); + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE rowid = ".$id; + + dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + /** * Give a label from a status * @@ -249,23 +278,23 @@ class Fiscalyear } if ($mode == 2) { - if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); } if ($mode == 3) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); } if ($mode == 4) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); } if ($mode == 5) { - if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); } } diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php new file mode 100644 index 00000000000..6865c875efa --- /dev/null +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -0,0 +1,51 @@ + + * + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/lib/fiscalyear.lib.php + * \brief Set basic functions for fiscal years + */ + +/** + * Prepare array with list of tabs + * + * @param Object $object Object related to tabs + * @return array Array of tabs to shoc + */ +function fiscalyear_prepare_head($object) +{ + global $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT . '/admin/fiscalyear_card.php?id=' . $object->id; + $head[$h][1] = $langs->trans("Card"); + $head[$h][2] = 'card'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear'); + + complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove'); + + return $head; +} \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0c9d9c92481..e04bbe72483 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1504,9 +1504,15 @@ TaskModelModule=Modèles de document de rapport tâches ECMSetup = Configuration du module GED ECMAutoTree = L'arborescence automatique est disponible ##### Fiscal Year ##### -Fiscalyear=Exercices fiscaux +FiscalYears=Exercices fiscaux +FiscalYear=Exercice fiscal +FiscalYearCard=Fiche exercice fiscal +NewFiscalYear=Nouvel exercice fiscal +EditFiscalYear=Editer exercice fiscal OpenFiscalYear=Exercice fiscal ouvert CloseFiscalYear=Exercice fiscal fermé +DeleteFiscalYear=Supprimer exercice fiscal +ConfirmDeleteFiscalYear=Êtes-vous sûr de vouloir supprimer cet exercice fiscal ? Opened=Ouvert Closed=Fermé From 53bd5022e0ff08738a6713b07a00139f30694fcc Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 29 Jun 2014 07:57:42 +0200 Subject: [PATCH 086/502] Align size for accounting account & Drop old table & Typo --- htdocs/boutique/index.php | 4 +-- .../install/mysql/migration/3.6.0-3.7.0.sql | 19 +++++++++++ .../mysql/tables/llx_accountingaccount.sql | 4 +-- .../mysql/tables/llx_accountingdebcred.sql | 2 +- .../tables/llx_actioncomm_resources.key.sql | 2 +- .../install/mysql/tables/llx_bank_account.sql | 2 +- .../mysql/tables/llx_c_chargesociales.sql | 2 +- .../mysql/tables/llx_c_revenuestamp.sql | 4 +-- htdocs/install/mysql/tables/llx_c_tva.sql | 4 +-- htdocs/install/mysql/tables/llx_compta.sql | 32 ------------------- .../mysql/tables/llx_compta_account.sql | 28 ---------------- .../tables/llx_compta_compte_generaux.sql | 29 ----------------- htdocs/install/mysql/tables/llx_product.sql | 4 +-- htdocs/install/mysql/tables/llx_user.sql | 2 +- 14 files changed, 34 insertions(+), 104 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_compta.sql delete mode 100644 htdocs/install/mysql/tables/llx_compta_account.sql delete mode 100644 htdocs/install/mysql/tables/llx_compta_compte_generaux.sql diff --git a/htdocs/boutique/index.php b/htdocs/boutique/index.php index 040e81b726a..01b3928a96b 100644 --- a/htdocs/boutique/index.php +++ b/htdocs/boutique/index.php @@ -128,7 +128,7 @@ else } /* - * Last 5 commands in wait + * Last 5 orders on hold */ $sql = "SELECT o.orders_id, o.customers_name, o.date_purchased, t.value, o.payment_method"; $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id "; @@ -200,7 +200,7 @@ else print ''; /* - * Last customers who commanded + * Last customers who ordered */ $sql = "SELECT o.orders_id, o.customers_name, o.delivery_country, o.date_purchased, t.value, s.orders_status_name as statut"; $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total as t JOIN ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders as o on o.orders_id = t.orders_id "; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index ae439127c06..96393a22c1b 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -19,3 +19,22 @@ ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; + +-- Drop old table +DROP TABLE llx_compta; +DROP TABLE llx_compta_account; +DROP TABLE llx_compta_compte_generaux; + +-- Align size for accounting account +ALTER TABLE llx_accountingaccount MODIFY COLUMN account_number varchar(32); +ALTER TABLE llx_accountingaccount MODIFY COLUMN account_parent varchar(32); +ALTER TABLE llx_accountingdebcred MODIFY COLUMN account_number varchar(32); +ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(32); +ALTER TABLE llx_c_chargesociales MODIFY COLUMN accountancy_code varchar(32); +ALTER TABLE llx_c_revenuestamp MODIFY COLUMN accountancy_code_sell varchar(32); +ALTER TABLE llx_c_revenuestamp MODIFY COLUMN accountancy_code_buy varchar(32); +ALTER TABLE llx_c_tva MODIFY COLUMN accountancy_code_sell varchar(32); +ALTER TABLE llx_c_tva MODIFY COLUMN accountancy_code_buy varchar(32); +ALTER TABLE llx_c_product MODIFY COLUMN accountancy_code_sell varchar(32); +ALTER TABLE llx_c_product MODIFY COLUMN accountancy_code_buy varchar(32); +ALTER TABLE llx_user MODIFY COLUMN accountancy_code varchar(32); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_accountingaccount.sql b/htdocs/install/mysql/tables/llx_accountingaccount.sql index a3143a263f9..085f2f3eeb5 100644 --- a/htdocs/install/mysql/tables/llx_accountingaccount.sql +++ b/htdocs/install/mysql/tables/llx_accountingaccount.sql @@ -23,8 +23,8 @@ create table llx_accountingaccount fk_pcg_version varchar(12) NOT NULL, pcg_type varchar(20) NOT NULL, pcg_subtype varchar(20) NOT NULL, - account_number varchar(20) NOT NULL, - account_parent varchar(20), + account_number varchar(32) NOT NULL, + account_parent varchar(32), label varchar(255) NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_accountingdebcred.sql b/htdocs/install/mysql/tables/llx_accountingdebcred.sql index f1191803d0e..f7ea28b127a 100644 --- a/htdocs/install/mysql/tables/llx_accountingdebcred.sql +++ b/htdocs/install/mysql/tables/llx_accountingdebcred.sql @@ -20,7 +20,7 @@ create table llx_accountingdebcred ( fk_transaction integer NOT NULL, - account_number varchar(20) NOT NULL, + account_number varchar(32) NOT NULL, amount real NOT NULL, direction varchar(1) NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_actioncomm_resources.key.sql b/htdocs/install/mysql/tables/llx_actioncomm_resources.key.sql index 6d6999e7232..caaa0969944 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm_resources.key.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm_resources.key.sql @@ -21,5 +21,5 @@ ALTER TABLE llx_actioncomm_resources ADD UNIQUE INDEX idx_actioncomm_resources_idx1 (fk_actioncomm, element_type, fk_element); ALTER TABLE llx_actioncomm_resources ADD INDEX idx_actioncomm_resources_fk_element (fk_element); --- Pas de contraite sur fk_source et fk_target car pointe sur differentes tables +-- Pas de contrainte sur fk_source et fk_target car pointe sur differentes tables diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql index 198b0ca87ab..765d836594b 100644 --- a/htdocs/install/mysql/tables/llx_bank_account.sql +++ b/htdocs/install/mysql/tables/llx_bank_account.sql @@ -47,7 +47,7 @@ create table llx_bank_account clos smallint DEFAULT 0 NOT NULL, rappro smallint DEFAULT 1, url varchar(128), - account_number varchar(24), -- bank accountancy number + account_number varchar(32), -- bank accountancy number currency_code varchar(3) NOT NULL, min_allowed integer DEFAULT 0, min_desired integer DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_c_chargesociales.sql b/htdocs/install/mysql/tables/llx_c_chargesociales.sql index b9c448e1d95..5b5cf1edf24 100644 --- a/htdocs/install/mysql/tables/llx_c_chargesociales.sql +++ b/htdocs/install/mysql/tables/llx_c_chargesociales.sql @@ -24,7 +24,7 @@ create table llx_c_chargesociales deductible smallint DEFAULT 0 NOT NULL, active tinyint DEFAULT 1 NOT NULL, code varchar(12) NOT NULL, - accountancy_code varchar(24) DEFAULT NULL, + accountancy_code varchar(32) DEFAULT NULL, fk_pays integer DEFAULT 1 NOT NULL, module varchar(32) NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_revenuestamp.sql b/htdocs/install/mysql/tables/llx_c_revenuestamp.sql index 7a47c05dca3..0eb5a46216d 100644 --- a/htdocs/install/mysql/tables/llx_c_revenuestamp.sql +++ b/htdocs/install/mysql/tables/llx_c_revenuestamp.sql @@ -23,7 +23,7 @@ create table llx_c_revenuestamp taux double NOT NULL, note varchar(128), active tinyint DEFAULT 1 NOT NULL, - accountancy_code_sell varchar(15) DEFAULT NULL, - accountancy_code_buy varchar(15) DEFAULT NULL + accountancy_code_sell varchar(32) DEFAULT NULL, + accountancy_code_buy varchar(32) DEFAULT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_tva.sql b/htdocs/install/mysql/tables/llx_c_tva.sql index 46aa3632faa..e2de4c3b5ef 100644 --- a/htdocs/install/mysql/tables/llx_c_tva.sql +++ b/htdocs/install/mysql/tables/llx_c_tva.sql @@ -30,7 +30,7 @@ create table llx_c_tva recuperableonly integer NOT NULL DEFAULT 0, note varchar(128), active tinyint DEFAULT 1 NOT NULL, - accountancy_code_sell varchar(15) DEFAULT NULL, - accountancy_code_buy varchar(15) DEFAULT NULL + accountancy_code_sell varchar(32) DEFAULT NULL, + accountancy_code_buy varchar(32) DEFAULT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_compta.sql b/htdocs/install/mysql/tables/llx_compta.sql deleted file mode 100644 index b7b06636e51..00000000000 --- a/htdocs/install/mysql/tables/llx_compta.sql +++ /dev/null @@ -1,32 +0,0 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- --- 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 . --- --- =================================================================== - -create table llx_compta -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - datev date, -- date de valeur - amount real DEFAULT 0 NOT NULL , - label varchar(255), - fk_compta_account integer, - fk_user_author integer, - fk_user_valid integer, - valid tinyint DEFAULT 0, - note text - -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_compta_account.sql b/htdocs/install/mysql/tables/llx_compta_account.sql deleted file mode 100644 index b70ad9ba160..00000000000 --- a/htdocs/install/mysql/tables/llx_compta_account.sql +++ /dev/null @@ -1,28 +0,0 @@ --- =================================================================== --- Copyright (C) 2000-2002 Rodolphe Quiedeville --- --- 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 . --- --- =================================================================== - -create table llx_compta_account -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - number varchar(12), - label varchar(255), - fk_user_author integer, - note text - -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_compta_compte_generaux.sql b/htdocs/install/mysql/tables/llx_compta_compte_generaux.sql deleted file mode 100644 index d830e8dbd66..00000000000 --- a/htdocs/install/mysql/tables/llx_compta_compte_generaux.sql +++ /dev/null @@ -1,29 +0,0 @@ --- =================================================================== --- Copyright (C) 2004 Rodolphe Quiedeville --- --- 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 . --- --- =================================================================== - -create table llx_compta_compte_generaux -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - date_creation datetime, - numero varchar(50), - intitule varchar(255), - fk_user_author integer, - note text, - - UNIQUE(numero) -)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 582f8161365..0ff94c19530 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -57,8 +57,8 @@ create table llx_product url varchar(255), barcode varchar(255) DEFAULT NULL, fk_barcode_type integer DEFAULT 0, - accountancy_code_sell varchar(15), -- Selling accountancy code - accountancy_code_buy varchar(15), -- Buying accountancy code + accountancy_code_sell varchar(32), -- Selling accountancy code + accountancy_code_buy varchar(32), -- Buying accountancy code partnumber varchar(32), -- Not used. Used by external modules. weight float DEFAULT NULL, weight_units tinyint DEFAULT NULL, diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 4b537e21f0c..6fccf1804c4 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -67,7 +67,7 @@ create table llx_user color varchar(6), barcode varchar(255) DEFAULT NULL, fk_barcode_type integer DEFAULT 0, - accountancy_code varchar(24) NULL, + accountancy_code varchar(32) NULL, nb_holiday integer DEFAULT 0, salary double(24,8) )ENGINE=innodb; From bb2e843fc90a439bb398d21ef8b8e8eaf7e3012e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 14:03:14 +0200 Subject: [PATCH 087/502] More visible information on predefined invoices. --- htdocs/compta/facture/fiche-rec.php | 33 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 2b3fc89d33b..7ae2e6aeb96 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -217,12 +217,15 @@ if ($action == 'create') if ($num) { print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (empty($conf->global->PRODUIT_MULTIPRICES)) print ''; print "\n"; } $var=True; @@ -288,9 +291,13 @@ if ($action == 'create') print "\n"; } - + // Vat rate print ''; + + // Qty print ''; + + // Percent if ($objp->remise_percent > 0) { print '\n"; @@ -300,9 +307,19 @@ if ($action == 'create') print ''; } + // Total HT + print '\n"; + + // Total VAT + print '\n"; + + // Total TTC + print '\n"; + + // Total Unit price print '\n"; - // Price of product + // Current price of product if (empty($conf->global->PRODUIT_MULTIPRICES)) { if ($objp->fk_product > 0) From 5c9edcd6a3525f2e75877e93aa348f2df49234c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 14:04:51 +0200 Subject: [PATCH 088/502] Fix: No double title on margin tabs --- htdocs/margin/agentMargins.php | 2 +- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/productMargins.php | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 74b82cbcb3b..781bc748f8a 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -74,7 +74,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Margins").' - '.$langs->trans("Agents")); $text=$langs->trans("Margins"); -print_fiche_titre($text); +//print_fiche_titre($text); // Show tabs $head=marges_prepare_head($user); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 6675753d4d6..8a7cae92d39 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -66,7 +66,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Margins").' - '.$langs->trans("Clients")); $text=$langs->trans("Margins"); -print_fiche_titre($text); +//print_fiche_titre($text); // Show tabs $head=marges_prepare_head($user); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index ca7b2c4845b..714b13e1036 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -89,8 +89,7 @@ $form = new Form($db); llxHeader('',$langs->trans("Margins").' - '.$langs->trans("Products")); $text=$langs->trans("Margins"); - -print_fiche_titre($text); +//print_fiche_titre($text); // Show tabs $head=marges_prepare_head($user); From 5cc8ec4f5fe407c455fa6b3d7a5a49b229ee8584 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 29 Jun 2014 20:10:43 +0200 Subject: [PATCH 089/502] Add accountancy code journal into bank card & modify presentation --- htdocs/compta/bank/class/account.class.php | 7 +- htdocs/compta/bank/fiche.php | 93 ++++++++++++------- .../install/mysql/migration/3.6.0-3.7.0.sql | 2 + .../install/mysql/tables/llx_bank_account.sql | 66 ++++++------- htdocs/langs/en_US/compta.lang | 1 + 5 files changed, 102 insertions(+), 67 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8bcabf7f17b..8a940c6db22 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -74,6 +74,7 @@ class Account extends CommonObject var $type_lib=array(); var $account_number; + var $accountancy_journal; var $currency_code; var $min_allowed; @@ -382,6 +383,7 @@ class Account extends CommonObject $sql.= ", label"; $sql.= ", entity"; $sql.= ", account_number"; + $sql.= ", accountancy_journal"; $sql.= ", currency_code"; $sql.= ", rappro"; $sql.= ", min_allowed"; @@ -395,6 +397,7 @@ class Account extends CommonObject $sql.= ", '".$this->db->escape($this->label)."'"; $sql.= ", ".$conf->entity; $sql.= ", '".$this->db->escape($this->account_number)."'"; + $sql.= ", '".$this->db->escape($this->accountancy_journal)."'"; $sql.= ", '".$this->currency_code."'"; $sql.= ", ".$this->rappro; $sql.= ", ".price2num($this->min_allowed); @@ -500,6 +503,7 @@ class Account extends CommonObject $sql.= ",rappro = ".$this->rappro; $sql.= ",url = ".($this->url?"'".$this->url."'":"null"); $sql.= ",account_number = '".$this->account_number."'"; + $sql.= ",accountancy_journal = '".$this->accountancy_journal."'"; $sql.= ",currency_code = '".$this->currency_code."'"; @@ -606,7 +610,7 @@ class Account extends CommonObject $sql = "SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url,"; $sql.= " ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban,"; $sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id,"; - $sql.= " ba.account_number, ba.currency_code,"; + $sql.= " ba.account_number, ba.accountancy_journal, ba.currency_code,"; $sql.= " ba.min_allowed, ba.min_desired, ba.comment,"; $sql.= ' p.code as country_code, p.libelle as country,'; $sql.= ' d.code_departement as state_code, d.nom as state'; @@ -656,6 +660,7 @@ class Account extends CommonObject $this->country = $obj->country; $this->account_number = $obj->account_number; + $this->accountancy_journal = $obj->accountancy_journal; $this->currency_code = $obj->currency_code; $this->account_currency_code = $obj->currency_code; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index bdb30e46528..57c5e2b075a 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -1,8 +1,9 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copytight (C) 2005-2009 Regis Houssin +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2014 Alexandre Spangaro * * 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 @@ -34,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); $langs->load("companies"); +$langs->load("compta"); $action=GETPOST("action"); @@ -65,6 +67,7 @@ if ($_POST["action"] == 'add') $account->url = $_POST["url"]; $account->account_number = trim($_POST["account_number"]); + $account->accountancy_journal = trim($_POST["accountancy_journal"]); $account->solde = $_POST["solde"]; $account->date_solde = dol_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); @@ -139,6 +142,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) $account->owner_address = trim($_POST["owner_address"]); $account->account_number = trim($_POST["account_number"]); + $account->accountancy_journal = trim($_POST["accountancy_journal"]); $account->currency_code = trim($_POST["account_currency_code"]); @@ -292,18 +296,6 @@ if ($action == 'create') } print ''; - // Accountancy code - if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } - // Web print ''; print ''; @@ -334,6 +326,27 @@ if ($action == 'create') print ''; print ''; + print '
'.$langs->trans("Ref").''; - print $object->rowid; + print $object->ref; print ''; print $linkback; print '
'.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("Qty").''.$langs->trans("ReductionShort").''.$langs->trans("PriceU").''.$langs->trans("CurrentProductPrice").''.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("Qty").''.$langs->trans("ReductionShort").''.$langs->trans("TotalHT").''.$langs->trans("TotalVAT").''.$langs->trans("TotalTTC").''.$langs->trans("PriceUHT").''.$langs->trans("CurrentProductPrice").'
'.vatrate($objp->tva_tx).'%'.$objp->qty.''.$objp->remise_percent." % '.price($objp->total_ht)."'.price($objp->total_vat)."'.price($objp->total_ttc)."'.price($objp->subprice)."
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'
'.$langs->trans("Web").'
'.$langs->trans("BalanceMinimalDesired").'account_min_desired).'">
'; + + print '
'; + + print ''; + // Accountancy code + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) + { + print ''; + print ''; + } + else + { + print ''; + print ''; + } + + // Accountancy journal + print ''; + print ''; + print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyJournal").'
'; print '

'; @@ -431,10 +444,6 @@ else else print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')')); print ''; - // Accountancy code - print ''.$langs->trans("AccountancyCode").''; - print ''.$account->account_number.''; - print ''.$langs->trans("BalanceMinimalAllowed").''; print ''.$account->min_allowed.''; @@ -451,7 +460,19 @@ else print ''.$account->comment.''; print ''; - + + print '
'; + print ''; + // Accountancy code + print ''; + print ''; + + // Accountancy journal + print ''; + print ''; + + print '
'.$langs->trans("AccountancyCode").''.$account->account_number.'
'.$langs->trans("AccountancyJournal").''.$account->accountancy_journal.'
'; + print ''; @@ -574,19 +595,7 @@ else else print 'rappro?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation"); print ''; - // Accountancy code - if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) - { - print ''.$langs->trans("AccountancyCode").''; - print 'account_number).'">'; - } - else - { - print ''.$langs->trans("AccountancyCode").''; - print 'account_number).'">'; - } - - // Balance + // Balance print ''.$langs->trans("BalanceMinimalAllowed").''; print 'min_allowed).'">'; @@ -606,6 +615,22 @@ else $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor->Create(); print ''; + + // Accountancy code + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) + { + print ''.$langs->trans("AccountancyCode").''; + print 'account_number).'">'; + } + else + { + print ''.$langs->trans("AccountancyCode").''; + print 'account_number).'">'; + } + + // Accountancy journal + print ''.$langs->trans("AccountancyJournalCode").''; + print 'accountancy_journal).'">'; print ''; print '   '; diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index ae439127c06..8eac08f2d73 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -19,3 +19,5 @@ ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; + +ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT NULL AFTER account_number; diff --git a/htdocs/install/mysql/tables/llx_bank_account.sql b/htdocs/install/mysql/tables/llx_bank_account.sql index 198b0ca87ab..63a7a674f73 100644 --- a/htdocs/install/mysql/tables/llx_bank_account.sql +++ b/htdocs/install/mysql/tables/llx_bank_account.sql @@ -1,7 +1,8 @@ -- ============================================================================= --- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2004-2007 Laurent Destailleur --- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2000-2004 Rodolphe Quiedeville +-- Copyright (C) 2004-2007 Laurent Destailleur +-- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2014 Alexandre Spangaro -- -- 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 @@ -23,34 +24,35 @@ create table llx_bank_account ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - tms timestamp, - ref varchar(12) NOT NULL, - label varchar(30) NOT NULL, - entity integer DEFAULT 1 NOT NULL, -- multi company id - bank varchar(60), - code_banque varchar(8), - code_guichet varchar(6), - number varchar(255), - cle_rib varchar(5), - bic varchar(11), - iban_prefix varchar(34), -- 34 according to ISO 13616 - country_iban varchar(2), -- deprecated - cle_iban varchar(2), - domiciliation varchar(255), - state_id integer DEFAULT NULL, - fk_pays integer NOT NULL, - proprio varchar(60), - owner_address varchar(255), - courant smallint DEFAULT 0 NOT NULL, - clos smallint DEFAULT 0 NOT NULL, - rappro smallint DEFAULT 1, - url varchar(128), - account_number varchar(24), -- bank accountancy number - currency_code varchar(3) NOT NULL, - min_allowed integer DEFAULT 0, - min_desired integer DEFAULT 0, - comment text + rowid integer AUTO_INCREMENT PRIMARY KEY, + datec datetime, + tms timestamp, + ref varchar(12) NOT NULL, + label varchar(30) NOT NULL, + entity integer DEFAULT 1 NOT NULL, -- multi company id + bank varchar(60), + code_banque varchar(8), + code_guichet varchar(6), + number varchar(255), + cle_rib varchar(5), + bic varchar(11), + iban_prefix varchar(34), -- 34 according to ISO 13616 + country_iban varchar(2), -- deprecated + cle_iban varchar(2), + domiciliation varchar(255), + state_id integer DEFAULT NULL, + fk_pays integer NOT NULL, + proprio varchar(60), + owner_address varchar(255), + courant smallint DEFAULT 0 NOT NULL, + clos smallint DEFAULT 0 NOT NULL, + rappro smallint DEFAULT 1, + url varchar(128), + account_number varchar(24), -- bank accountancy number + accountancy_journal varchar(3) DEFAULT NULL, -- bank accountancy journal + currency_code varchar(3) NOT NULL, + min_allowed integer DEFAULT 0, + min_desired integer DEFAULT 0, + comment text )ENGINE=innodb; diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 281ee374343..2b98ccc5608 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -175,6 +175,7 @@ CalculationRuleDesc=To calculate total VAT, there is two methods:
Method 1 is CalculationRuleDescSupplier=according to supplier, choose appropriate method to apply same calculation rule and get same result expected by your supplier. TurnoverPerProductInCommitmentAccountingNotRelevant=Turnover report per product, when using a cash accountancy mode is not relevant. This report is only available when using engagement accountancy mode (see setup of accountancy module). CalculationMode=Calculation mode +AccountancyJournal=Accountancy code journal COMPTA_PRODUCT_BUY_ACCOUNT=Default accountancy code to buy products COMPTA_PRODUCT_SOLD_ACCOUNT=Default accountancy code to sell products COMPTA_SERVICE_BUY_ACCOUNT=Default accountancy code to buy services From 31c27b8f7c7187a6238f48db192234bc5ac1926e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 23:35:00 +0200 Subject: [PATCH 090/502] New: More option to define default filter setting of agenda views. --- htdocs/admin/agenda_other.php | 70 ++++++++++++++---- htdocs/comm/action/index.php | 27 +++++-- htdocs/comm/action/listactions.php | 9 +-- htdocs/core/class/html.formactions.class.php | 7 +- htdocs/core/lib/agenda.lib.php | 10 +-- htdocs/core/lib/ajax.lib.php | 78 +++++++++++--------- htdocs/langs/en_US/admin.lang | 3 + 7 files changed, 133 insertions(+), 71 deletions(-) diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 4a9c359f5c1..a069a0718c9 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -26,6 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; if (!$user->admin) accessforbidden(); @@ -70,11 +71,20 @@ if (preg_match('/del_(.*)/',$action,$reg)) } } +if ($action == 'set') +{ + dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity); +} + /** * View */ +$formactions=new FormActions($db); + llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; @@ -86,43 +96,71 @@ $head=agenda_prepare_head(); dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action'); -print_titre($langs->trans("OtherOptions")); +//print_titre($langs->trans("OtherOptions")); $var=true; +print ''; +print ''; + print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; -print ''."\n"; +print ''."\n"; +print ''."\n"; print ''."\n"; // Manual or automatic $var=!$var; print ''."\n"; print ''."\n"; -print ''."\n"; - -print ''."\n"; +print ''."\n"; +// AGENDA_DEFAULT_FILTER_TYPE +$var=!$var; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +// AGENDA_DEFAULT_FILTER_STATUS +$var=!$var; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +// AGENDA_DEFAULT_VIEW +$var=!$var; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").' '.$langs->trans("Value").'
'.$langs->trans("AGENDA_USE_EVENT_TYPE").' '."\n"; -if ($conf->use_javascript_ajax) +print ' '."\n"; +//print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list +if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - if($conf->global->AGENDA_USE_EVENT_TYPE == 0) - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1) - { - print ''.img_picto($langs->trans("Enabled"),'on').''; - } + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; +print $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), 1); +print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").' '."\n"; +$formactions->form_select_status_action('agenda',$conf->global->AGENDA_DEFAULT_FILTER_STATUS,1,'AGENDA_DEFAULT_FILTER_STATUS',1,2); +print '
'.$langs->trans("AGENDA_DEFAULT_VIEW").' '."\n"; +$tmplist=array('show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_list'=>$langs->trans("ViewList"), 'show_peruser'=>$langs->trans("ViewPerUser")); +print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); +print '
'; +print '
'; + +print ''; + dol_fiche_end(); print "
"; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e7f277a116b..a50ee50dd14 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -81,7 +81,11 @@ $pid=GETPOST("projectid","int",3); $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':''); + +if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); +if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); +if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week') { $action='show_month'; $day=''; @@ -93,11 +97,6 @@ if (GETPOST('viewday') || $action == 'show_day') { $action='show_day'; $day=($day?$day:date("d")); } // View by day -if (empty($action)) -{ - if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_month'; - else $action=$conf->global->AGENDA_DEFAULT_VIEW; -} $langs->load("agenda"); $langs->load("other"); @@ -110,7 +109,8 @@ $hookmanager->initHooks(array('agenda')); /* * Actions */ -if (GETPOST("viewlist")) + +if (GETPOST("viewlist") || $action == 'show_list') { $param=''; foreach($_POST as $key => $val) @@ -123,6 +123,19 @@ if (GETPOST("viewlist")) exit; } +if (GETPOST("viewperuser") || $action == 'show_peruser') +{ + $param=''; + foreach($_POST as $key => $val) + { + if ($key=='token') continue; + $param.='&'.$key.'='.urlencode($val); + } + //print $param; + header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param); + exit; +} + if ($action=='delete_action') { $event = new ActionComm($db); diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 0c220a89194..15e75e85661 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -44,11 +44,9 @@ $status=GETPOST("status",'alpha'); $type=GETPOST('type'); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); -if (empty($action)) -{ - if (empty($conf->global->AGENDA_DEFAULT_VIEW)) $action='show_list'; - else $action=$conf->global->AGENDA_DEFAULT_VIEW; -} +if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); +if ($status == '') $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); +if (empty($action)) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_list':$conf->global->AGENDA_DEFAULT_VIEW); $filter=GETPOST("filter",'',3); $filtera = GETPOST("userasked","int",3)?GETPOST("userasked","int",3):GETPOST("filtera","int",3); @@ -214,6 +212,7 @@ if ($resql) if ($action == 'show_week') $tabactive='cardweek'; if ($action == 'show_day') $tabactive='cardday'; if ($action == 'show_list') $tabactive='cardlist'; + if ($action == 'show_peruser') $tabactive='cardperuser'; $head = calendars_prepare_head($param); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 81a7ea1f048..ed32fcc9f0d 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -120,7 +120,7 @@ class FormActions { //var_dump($selected); if ($selected == 'done') $selected='100'; - print ''; if ($showempty) print ''; foreach($listofstatus as $key => $val) { @@ -230,9 +230,10 @@ class FormActions * @param string $htmlname Nom champ formulaire * @param string $excludetype Type to exclude * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) + * @param int $hideinfohelp 1=Do not show info help * @return void */ - function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0) + function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0) { global $langs,$user,$form; @@ -251,7 +252,7 @@ class FormActions if ($selected == 'auto') $selected='AC_OTH_AUTO'; print $form->selectarray($htmlname, $arraylist, $selected); - if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3367d227dd8..8e09c9323b5 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -359,6 +359,11 @@ function agenda_prepare_head() $h = 0; $head = array(); + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php"; + $head[$h][1] = $langs->trans("Miscellaneous"); + $head[$h][2] = 'other'; + $h++; + $head[$h][0] = DOL_URL_ROOT."/admin/agenda.php"; $head[$h][1] = $langs->trans("AutoActions"); $head[$h][2] = 'autoactions'; @@ -374,11 +379,6 @@ function agenda_prepare_head() $head[$h][2] = 'extsites'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php"; - $head[$h][1] = $langs->trans("Other"); - $head[$h][2] = 'other'; - $h++; - complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin'); $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f36dc59c43a..47363ac8d06 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -399,44 +399,52 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) $entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity); - $out= "\n".' - '."\n"; - // Del constant - $("#del_" + code).click(function() { - if (input.alert && input.alert.del) { - if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton; - if (input.alert.del.noButton) noButton = input.alert.del.noButton; - confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton); - } else { - delConstant(url, code, input, entity); - } - }); - }); - '."\n"; - - $out.= ''; - $out.= ''.($revertonoff?img_picto($langs->trans("Enabled"),'switch_on'):img_picto($langs->trans("Disabled"),'switch_off')).''; - $out.= ''.($revertonoff?img_picto($langs->trans("Disabled"),'switch_off'):img_picto($langs->trans("Enabled"),'switch_on')).''; - $out.="\n"; + $out.= ''; + $out.= ''.($revertonoff?img_picto($langs->trans("Enabled"),'switch_on'):img_picto($langs->trans("Disabled"),'switch_off')).''; + $out.= ''.($revertonoff?img_picto($langs->trans("Disabled"),'switch_off'):img_picto($langs->trans("Enabled"),'switch_on')).''; + $out.="\n"; + } return $out; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6782606b7c0..4bec9fed799 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1453,6 +1453,9 @@ AgendaSetup=Events and agenda module setup PasswordTogetVCalExport=Key to authorize export link PastDelayVCalExport=Do not export event older than AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionary -> Type of agenda events) +AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filter of agenda view +AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view +AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda ##### ClickToDial ##### ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example. ##### Point Of Sales (CashDesk) ##### From 7dca46df57df45da83c181aa86f35af9a92e9b18 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 2 Jul 2014 04:24:26 +0200 Subject: [PATCH 091/502] navigate (next/prev) error on task of a project --- htdocs/projet/tasks/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index f0bdce25fca..722e3c9aaae 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label From 96876992d470be793cf6ec6f5831379f2903bde0 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 2 Jul 2014 04:27:18 +0200 Subject: [PATCH 092/502] navigate (next/prev) error on task of project use the same showrefnav function setting present in task.php file (who work fine) --- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/time.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 50763f839f7..03ca7bae452 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -209,7 +209,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index a6f8846ce0e..04e92c7c7f2 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -181,7 +181,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 2ef635dbe53..f6c5a1840ea 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -276,7 +276,7 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label From d38bebf99064916053885424c8b1416b6b52a608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 2 Jul 2014 21:04:34 +0200 Subject: [PATCH 093/502] Created foreign key relations for llx_product and llx_product_price table --- .../install/mysql/migration/3.6.0-3.7.0.sql | 33 +++++++++++++++++++ .../install/mysql/tables/llx_product.key.sql | 17 +++++++++- htdocs/install/mysql/tables/llx_product.sql | 7 ++-- .../mysql/tables/llx_product_price.key.sql | 28 ++++++++++++++++ 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 htdocs/install/mysql/tables/llx_product_price.key.sql diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index a8019d3af4c..2b98536fa95 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -49,3 +49,36 @@ ALTER TABLE llx_user MODIFY COLUMN accountancy_code varchar(32); ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT NULL AFTER account_number; + +-- Added missing relations of llx_product +-- fk_country +ALTER TABLE llx_product CHANGE fk_country fk_country INT( 11 ) NULL DEFAULT NULL; +ALTER TABLE llx_product ADD INDEX ( fk_country ); +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; +-- fk_user_author +ALTER TABLE llx_product CHANGE fk_user_author fk_user_author INT( 11 ) NULL DEFAULT NULL; +ALTER TABLE llx_product ADD INDEX ( fk_user_author ); +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; +-- fk_barcode_type +ALTER TABLE llx_product CHANGE fk_barcode_type fk_barcode_type INT( 11 ) NULL DEFAULT NULL; +UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0; +ALTER TABLE llx_product ADD INDEX ( fk_barcode_type ); +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; + +-- Added missing relations of llx_product_price +-- fk_user_author +ALTER TABLE llx_product_price ADD INDEX ( fk_user_author ); +ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( + rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; +-- fk_user_author +ALTER TABLE llx_product_price ADD INDEX ( fk_product ); +ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( + rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index a2cb0e539f9..4faa2bcb13c 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -2,6 +2,7 @@ -- Copyright (C) 2002-2004 Rodolphe Quiedeville -- Copyright (C) 2004-2013 Laurent Destailleur -- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2014 Marcos García -- -- 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 @@ -25,6 +26,20 @@ ALTER TABLE llx_product ADD INDEX idx_product_label (label); ALTER TABLE llx_product ADD INDEX idx_product_barcode (barcode); ALTER TABLE llx_product ADD INDEX idx_product_import_key (import_key); ALTER TABLE llx_product ADD INDEX idx_product_seuil_stock_alerte (seuil_stock_alerte); - +ALTER TABLE llx_product ADD INDEX ( fk_country ); +ALTER TABLE llx_product ADD INDEX ( fk_user_author ); +ALTER TABLE llx_product ADD INDEX ( fk_barcode_type ); ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity); + +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; + +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; + +ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( +rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 0ff94c19530..0ab9a24785c 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -4,6 +4,7 @@ -- Copyright (C) 2005-2010 Regis Houssin -- Copyright (C) 2010 juanjo Menent -- Copyright (C) 2013 Cédric Salvador +-- Copyright (C) 2014 Marcos García -- -- 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 @@ -37,7 +38,7 @@ create table llx_product description text, note text, customcode varchar(32), -- Optionnal custom code - fk_country integer, -- Optionnal id of original country + fk_country integer DEFAULT NULL, -- Optionnal id of original country price double(24,8) DEFAULT 0, price_ttc double(24,8) DEFAULT 0, price_min double(24,8) DEFAULT 0, @@ -47,7 +48,7 @@ create table llx_product recuperableonly integer NOT NULL DEFAULT '0', -- French NPR VAT localtax1_tx double(6,3) DEFAULT 0, -- Spanish local VAT 1 localtax2_tx double(6,3) DEFAULT 0, -- Spanish local VAT 2 - fk_user_author integer, + fk_user_author integer DEFAULT NULL, tosell tinyint DEFAULT 1, -- Product you sell tobuy tinyint DEFAULT 1, -- Product you buy tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch or eat-by management @@ -56,7 +57,7 @@ create table llx_product seuil_stock_alerte integer DEFAULT 0, url varchar(255), barcode varchar(255) DEFAULT NULL, - fk_barcode_type integer DEFAULT 0, + fk_barcode_type integer DEFAULT NULL, accountancy_code_sell varchar(32), -- Selling accountancy code accountancy_code_buy varchar(32), -- Buying accountancy code partnumber varchar(32), -- Not used. Used by external modules. diff --git a/htdocs/install/mysql/tables/llx_product_price.key.sql b/htdocs/install/mysql/tables/llx_product_price.key.sql new file mode 100644 index 00000000000..a7e43d95d86 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_product_price.key.sql @@ -0,0 +1,28 @@ +-- ============================================================================ +-- Copyright (C) 2014 Marcos García +-- +-- 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 . +-- +-- ============================================================================ + +ALTER TABLE llx_product_price ADD INDEX ( fk_user_author ); +ALTER TABLE llx_product_price ADD INDEX ( fk_product ); + +ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( + rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; + +ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( + rowid +) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file From 460fb7a453f38f0a28ea1a72e4ea872cfbe8ed19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 2 Jul 2014 21:29:07 +0200 Subject: [PATCH 094/502] Removed new SQL double-debug --- htdocs/adherents/card_subscriptions.php | 4 ++-- htdocs/comm/propal/class/propal.class.php | 4 +--- htdocs/commande/class/commande.class.php | 6 +++--- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/compta/paiement/cheque/class/remisecheque.class.php | 4 ++-- htdocs/contrat/class/contrat.class.php | 1 - htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/opensurvey/public/studs.php | 1 - htdocs/opensurvey/results.php | 1 - htdocs/product/class/product.class.php | 2 +- htdocs/product/price.php | 1 - htdocs/societe/class/address.class.php | 5 +---- htdocs/user/class/user.class.php | 4 ++-- 17 files changed, 20 insertions(+), 29 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index ff1abc8199c..e436fd5f694 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -454,8 +454,8 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ // Update fk_bank into subscription table $sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id; $sql.= ' WHERE rowid='.$crowid; - dol_syslog('sql='.$sql); - $result = $db->query($sql); + + $result = $db->query($sql); if (! $result) { $error++; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index aafe6d11d8a..27dd65e6217 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1594,7 +1594,6 @@ class Propal extends CommonObject else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::set_remise_percent Error sql=$sql"); return -1; } } @@ -1629,7 +1628,6 @@ class Propal extends CommonObject else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::set_remise_absolue Error sql=$sql"); return -1; } } @@ -3131,7 +3129,7 @@ class PropaleLigne extends CommonObject $sql.= ",total_ttc=".price2num($this->total_ttc,'MT').""; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog("PropaleLigne::update_total sql=$sql"); + dol_syslog("PropaleLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2d06fc135f3..a48dd0b9b43 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1888,7 +1888,7 @@ class Commande extends CommonOrder $sql.= ' SET remise_absolue = '.$remise; $sql.= ' WHERE rowid = '.$this->id.' AND fk_statut = 0 ;'; - dol_syslog(get_class($this)."::set_remise_absolue sql=$sql"); + dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); if ($this->db->query($sql)) { @@ -1920,7 +1920,7 @@ class Commande extends CommonOrder $sql.= " SET date_commande = ".($date ? $this->db->idate($date) : 'null'); $sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0"; - dol_syslog(get_class($this)."::set_date sql=$sql",LOG_DEBUG); + dol_syslog(get_class($this)."::set_date",LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -3485,7 +3485,7 @@ class OrderLine extends CommonOrderLine $sql.= ",total_ttc='".price2num($this->total_ttc)."'"; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog("OrderLine::update_total sql=$sql"); + dol_syslog("OrderLine::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8729c44e494..e50c7bb34f6 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -569,7 +569,7 @@ class Account extends CommonObject $sql.= " WHERE rowid = ".$this->id; $sql.= " AND entity = ".$conf->entity; - dol_syslog(get_class($this)."::update_bban sql=$sql"); + dol_syslog(get_class($this)."::update_bban", LOG_DEBUG); $result = $this->db->query($sql); if ($result) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f08a2af3feb..477735ca9ec 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2346,7 +2346,7 @@ class Facture extends CommonInvoice $sql.= ' WHERE rowid = '.$this->id; $sql.= ' AND fk_statut = 0'; - dol_syslog(get_class($this)."::set_remise_absolue sql=$sql"); + dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); if ($this->db->query($sql)) { @@ -2737,7 +2737,7 @@ class Facture extends CommonInvoice if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; $sql.= " ORDER BY f.facnumber"; - dol_syslog(get_class($this)."::list_replacable_invoices sql=$sql"); + dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 990238cf543..39b8f209247 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -704,7 +704,7 @@ class RemiseCheque extends CommonObject $sql.= " SET date_bordereau = ".($date ? $this->db->idate($date) : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog("RemiseCheque::set_date sql=$sql",LOG_DEBUG); + dol_syslog("RemiseCheque::set_date", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -738,7 +738,7 @@ class RemiseCheque extends CommonObject $sql.= " SET number = '".$number."'" ; $sql.= " WHERE rowid = ".$this->id; - dol_syslog("RemiseCheque::set_number sql=$sql",LOG_DEBUG); + dol_syslog("RemiseCheque::set_number", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 049825578e7..8217749f260 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1075,7 +1075,6 @@ class Contrat extends CommonObject } else { - dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR); $this->db->rollback(); return -1; } diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index fa08ef5566a..fdc4a35a585 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -308,7 +308,7 @@ abstract class CommonInvoice extends CommonObject if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement; else $sqltemp.= " WHERE c.code='".$this->db->escape($cond_reglement)."'"; - dol_syslog(get_class($this).'::calculate_date_lim_reglement sql='.$sqltemp); + dol_syslog(get_class($this).'::calculate_date_lim_reglement', LOG_DEBUG); $resqltemp=$this->db->query($sqltemp); if ($resqltemp) { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e6a9e139109..4e9598d5e20 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -837,7 +837,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; - dol_syslog("functions2::get_next_value maskrefclient_sql=".$maskrefclient_sql, LOG_DEBUG); + dol_syslog("functions2::get_next_value maskrefclient", LOG_DEBUG); $maskrefclient_resql=$db->query($maskrefclient_sql); if ($maskrefclient_resql) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 83681a3a4b9..8637364f578 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -145,7 +145,7 @@ class CommandeFournisseur extends CommonOrder $obj = $this->db->fetch_object($resql); if (! $obj) { - $this->error='Bill with id '.$id.' not found sql='.$sql; + $this->error='Bill with id '.$id.' not found'; dol_syslog(get_class($this).'::fetch '.$this->error); return 0; } @@ -2140,7 +2140,7 @@ class CommandeFournisseurLigne $sql.= ",total_ttc='".price2num($this->total_ttc)."'"; $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog("CommandeFournisseurLigne.class.php::update_total sql=$sql"); + dol_syslog("CommandeFournisseurLigne.class.php::update_total", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 95aaeb16eea..a224f1fafb0 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -420,7 +420,7 @@ class FactureFournisseur extends CommonInvoice } else { - $this->error='Bill with id '.$id.' not found sql='.$sql; + $this->error='Bill with id '.$id.' not found'; dol_syslog(get_class($this).'::fetch '.$this->error); return 0; } diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php index f970df5bc4d..c85a62ae61a 100644 --- a/htdocs/opensurvey/public/studs.php +++ b/htdocs/opensurvey/public/studs.php @@ -392,7 +392,6 @@ $compteur = 0; $sql ="SELECT id_users, nom, id_sondage, reponses"; $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; -dol_syslog('sql='.$sql); $resql=$db->query($sql); if (! $resql) { diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 2d93dfd5de4..7dbdac8c2bc 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -286,7 +286,6 @@ for ($i = 0; $i < $nblignes; $i++) $sql ="SELECT id_users, nom, id_sondage, reponses"; $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'"; - dol_syslog('sql='.$sql); $resql=$db->query($sql); if (! $resql) dol_print_error($db); $num=$db->num_rows($resql); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c00701fbdbb..0d4c884abf8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -945,7 +945,7 @@ class Product extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_lang"; $sql.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($langtodelete)."'"; - dol_syslog(get_class($this).'::delMultiLangs sql='.$sql); + dol_syslog(get_class($this).'::delMultiLangs', LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9268a3a59a4..f5db524ed27 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -686,7 +686,6 @@ if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " ORDER BY p.date_price DESC, p.price_level ASC"; // $sql .= $db->plimit(); -dol_syslog("sql=" . $sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 14b1605fdd9..d8ef1565bbd 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -114,10 +114,7 @@ class Address $this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom); } - else - { - dol_syslog(get_class($this)."::create echec insert sql=$sql"); - } + $this->db->rollback(); return -2; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 35ae30d0641..0a2ccf00638 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1370,7 +1370,7 @@ class User extends CommonObject } $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::setPassword sql=hidden", LOG_DEBUG); + dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -1439,7 +1439,7 @@ class User extends CommonObject $sql.= " SET pass_temp = '".$this->db->escape($password)."'"; $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::setPassword sql=hidden", LOG_DEBUG); // No log + dol_syslog(get_class($this)."::setPassword", LOG_DEBUG); // No log $result = $this->db->query($sql); if ($result) { From e351657cc08d111e13680d971ab2425d3e4c4ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 3 Jul 2014 10:16:37 +0200 Subject: [PATCH 095/502] Removed key restrictions --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 10 +++++----- htdocs/install/mysql/tables/llx_product.key.sql | 6 +++--- htdocs/install/mysql/tables/llx_product_price.key.sql | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 2b98536fa95..1a9c59b6275 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -56,29 +56,29 @@ ALTER TABLE llx_product CHANGE fk_country fk_country INT( 11 ) NULL DEFAULT N ALTER TABLE llx_product ADD INDEX ( fk_country ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_user_author ALTER TABLE llx_product CHANGE fk_user_author fk_user_author INT( 11 ) NULL DEFAULT NULL; ALTER TABLE llx_product ADD INDEX ( fk_user_author ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_barcode_type ALTER TABLE llx_product CHANGE fk_barcode_type fk_barcode_type INT( 11 ) NULL DEFAULT NULL; UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0; ALTER TABLE llx_product ADD INDEX ( fk_barcode_type ); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- Added missing relations of llx_product_price -- fk_user_author ALTER TABLE llx_product_price ADD INDEX ( fk_user_author ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); -- fk_user_author ALTER TABLE llx_product_price ADD INDEX ( fk_product ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index 4faa2bcb13c..b692a2740b0 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -34,12 +34,12 @@ ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode ALTER TABLE llx_product ADD FOREIGN KEY ( fk_country ) REFERENCES llx_c_pays ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product ADD FOREIGN KEY ( fk_barcode_type ) REFERENCES llx_c_barcode_type ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product_price.key.sql b/htdocs/install/mysql/tables/llx_product_price.key.sql index a7e43d95d86..fbc5ee3f05f 100644 --- a/htdocs/install/mysql/tables/llx_product_price.key.sql +++ b/htdocs/install/mysql/tables/llx_product_price.key.sql @@ -21,8 +21,8 @@ ALTER TABLE llx_product_price ADD INDEX ( fk_product ); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_product ) REFERENCES llx_product ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; +); ALTER TABLE llx_product_price ADD FOREIGN KEY ( fk_user_author ) REFERENCES llx_user ( rowid -) ON DELETE RESTRICT ON UPDATE RESTRICT ; \ No newline at end of file +); \ No newline at end of file From a1b6aedc905ac6f9e7c44d1251c50af0da6a5bba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Jul 2014 12:53:26 +0200 Subject: [PATCH 096/502] Add field task_datehour --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ htdocs/install/mysql/tables/llx_projet_task_time.sql | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index a8019d3af4c..df1c0cb64c4 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -49,3 +49,5 @@ ALTER TABLE llx_user MODIFY COLUMN accountancy_code varchar(32); ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT NULL AFTER account_number; + +ALTER TABLE llx_projet_task_time ADD COLUMN task_datehour datetime after task_date; diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 8bef980a12e..d5d89812b4a 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -20,7 +20,8 @@ create table llx_projet_task_time ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_task integer NOT NULL, - task_date date, + task_date date, -- only the day + task_datehour datetime, -- day + hour task_duration double, fk_user integer, thm double(24,8), From 1e5c35093ba6baa77e1842f118badb8d09184038 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 14:01:01 +0200 Subject: [PATCH 097/502] Review trigger for user module --- dev/skeletons/skeleton_class.class.php | 24 +++--- htdocs/user/class/user.class.php | 100 ++++++++++++------------- htdocs/user/class/usergroup.class.php | 49 +++++++----- 3 files changed, 84 insertions(+), 89 deletions(-) diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index c36dad4b4b5..49937c40314 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -105,10 +105,8 @@ class Skeleton_Class extends CommonObject // want this action calls a trigger. //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //$result=$this->call_trigger('MYOBJECT_CREATE',$user); + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } @@ -216,12 +214,10 @@ class Skeleton_Class extends CommonObject // want this action calls a trigger. //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers - } + } } // Commit or rollback @@ -264,12 +260,10 @@ class Skeleton_Class extends CommonObject // Uncomment this and change MYOBJECT to your own tag if you // want this action calls a trigger. - //// Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers + //// Call triggers + //$result=$this->call_trigger('MYOBJECT_DELETE',$user); + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //// End call triggers } } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index ac4c830fed2..b7e492de58e 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -667,12 +667,10 @@ class User extends CommonObject dol_syslog(get_class($this)."::setstatus sql=".$sql); if ($result) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_ENABLEDISABLE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_ENABLEDISABLE',$user); + if ($result < 0) { $error++; } + // End call triggers } if ($error) @@ -759,13 +757,16 @@ class User extends CommonObject if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - + // Call trigger + $result=$this->call_trigger('USER_DELETE',$user); + if ($result < 0) + { + $error++; + $this->db->rollback(); + return -1; + } + // End call triggers + $this->db->commit(); return 1; } @@ -866,12 +867,10 @@ class User extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('USER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -881,7 +880,7 @@ class User extends CommonObject } else { - $this->error=$interface->error; + //$this->error=$interface->error; dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); $this->db->rollback(); return -3; @@ -953,13 +952,11 @@ class User extends CommonObject dol_syslog(get_class($this)."::create_from_contact sql=".$sql, LOG_DEBUG); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('USER_CREATE_FROM_CONTACT',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - + // Call trigger + $result=$this->call_trigger('USER_CREATE_FROM_CONTACT',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers + $this->db->commit(); return $this->id; } @@ -1271,12 +1268,10 @@ class User extends CommonObject if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -1286,7 +1281,6 @@ class User extends CommonObject } else { - $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::update error=".$this->error,LOG_ERR); $this->db->rollback(); return -1; @@ -1367,6 +1361,8 @@ class User extends CommonObject { if (! is_object($this->oldcopy)) $this->oldcopy=dol_clone($this); + $this->db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql.= " SET pass_crypted = '".$this->db->escape($password_crypted)."',"; $sql.= " pass_temp = null"; @@ -1420,23 +1416,24 @@ class User extends CommonObject if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_NEW_PASSWORD',$this,$user,$langs,$conf); - if ($result < 0) $this->errors=$interface->errors; - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_NEW_PASSWORD',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } - + + $this->db->commit(); return $this->pass; } else { + $this->db->rollback(); return 0; } } else { + $this->db->rollback(); dol_print_error($this->db); return -1; } @@ -1677,12 +1674,10 @@ class User extends CommonObject { $this->newgroupid=$group; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_SETINGROUP',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_SETINGROUP',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -1692,7 +1687,6 @@ class User extends CommonObject } else { - $this->error=$interface->error; dol_syslog(get_class($this)."::SetInGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -1735,12 +1729,10 @@ class User extends CommonObject { $this->oldgroupid=$group; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('USER_REMOVEFROMGROUP',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('USER_REMOVEFROMGROUP',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index b43794a4b64..7a94ccc0a0d 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -547,12 +547,10 @@ class UserGroup extends CommonObject $result=$this->db->query($sql); if ($result) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('GROUP_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('GROUP_DELETE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers $this->db->commit(); return 1; @@ -583,6 +581,8 @@ class UserGroup extends CommonObject $entity=$this->entity; if (! empty($conf->multicompany->enabled) && $conf->entity == 1) $entity=$this->entity; + $this->db->begin(); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."usergroup ("; $sql.= "datec"; $sql.= ", nom"; @@ -603,18 +603,18 @@ class UserGroup extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('GROUP_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('GROUP_CREATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } + $this->db->commit(); return $this->id; } else { + $this->db->rollback(); $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::create ".$this->error,LOG_ERR); return -1; @@ -639,6 +639,8 @@ class UserGroup extends CommonObject $entity=$this->entity; } + $this->db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."usergroup SET "; $sql.= " nom = '" . $this->db->escape($this->nom) . "'"; $sql.= ", entity = " . $this->db->escape($entity); @@ -651,19 +653,26 @@ class UserGroup extends CommonObject { if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('GROUP_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('GROUP_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } - if (! $error) return 1; - else return -$error; + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -$error; + } } else { + $this->db->rollback(); dol_print_error($this->db); return -1; } From 7d30df42a25c4d89fd35c4bd308e60df14e9872f Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 14:15:15 +0200 Subject: [PATCH 098/502] ChangeLog modification --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index ec144c6534b..2ab4929bc68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ For users: - New: Can filter events on a group of users. - New: Add thirdparty to filter on events. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action +- Fix: [ bug #1470, #1472, #1473] User trigger problem For translators: - Update language files. From 174edb6140f26ecc86ffa8d33d5ff987e9c5c93f Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 14:57:16 +0200 Subject: [PATCH 099/502] FIX: Intervention trigger --- ChangeLog | 1 + htdocs/fichinter/class/fichinter.class.php | 91 ++++++++-------------- 2 files changed, 32 insertions(+), 60 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ab4929bc68..3cf736d8edf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ For users: - New: Add thirdparty to filter on events. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem +- Fix: [ bug #1489, #1491 ] Intervention trigger problem For translators: - Update language files. diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index d7bb50682fe..1aff2964eea 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -176,13 +176,10 @@ class Fichinter extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } + // Call trigger + $result=$this->call_trigger('FICHINTER_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -240,14 +237,10 @@ class Fichinter extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('FICHINTER_MODIFY',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } $this->db->commit(); @@ -454,14 +447,10 @@ class Fichinter extends CommonObject if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('FICHINTER_VALIDATE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -762,14 +751,10 @@ class Fichinter extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('FICHINTER_DELETE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } $this->db->commit(); @@ -1137,14 +1122,10 @@ class FichinterLigne if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('LINEFICHINTER_CREATE',$this,$user,$langs,$conf); - if ($resulttrigger < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEFICHINTER_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } } @@ -1199,14 +1180,10 @@ class FichinterLigne if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('LINEFICHINTER_UPDATE',$this,$user,$langs,$conf); - if ($resulttrigger < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEFICHINTER_UPDATE',$user); + if ($result < 0) { $error++; } + // End call triggers } } @@ -1217,7 +1194,6 @@ class FichinterLigne } else { - $this->error=$this->db->lasterror(); dol_syslog("FichinterLigne::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -1309,21 +1285,16 @@ class FichinterLigne $result = $this->update_total(); if ($result > 0) { - $this->db->commit(); - if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('LINEFICHINTER_DELETE',$this,$user,$langs,$conf); - if ($resulttrigger < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEFICHINTER_DELETE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } - - return $result; + + $this->db->commit(); + return $result; } else { From 685b7b23adfc6d4225be147042ccd3a50e84d7bc Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 15:09:46 +0200 Subject: [PATCH 100/502] FIX: Member's trigger problem --- ChangeLog | 1 + htdocs/adherents/class/adherent.class.php | 75 ++++++++++------------- 2 files changed, 34 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3cf736d8edf..20ac8a3dff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ For users: - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem +- Fix: [ bug #1492, #1493 ] Member trigger problem For translators: - Update language files. diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b03bff940dd..99b4e7df1f4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -347,12 +347,10 @@ class Adherent extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (count($this->errors)) @@ -599,12 +597,10 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } } @@ -782,12 +778,10 @@ class Adherent extends CommonObject if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) {$error++; $this->errors=$interface->errors;} - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers } @@ -841,6 +835,8 @@ class Adherent extends CommonObject $password_indatabase = $password; } + $this->db->begin(); + // Mise a jour $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET pass = '".$this->db->escape($password_indatabase)."'"; $sql.= " WHERE rowid = ".$this->id; @@ -885,23 +881,24 @@ class Adherent extends CommonObject if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_NEW_PASSWORD',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_NEW_PASSWORD',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } + $this->db->commit(); return $this->pass; } else { + $this->db->rollback(); return 0; } } else { + $this->db->rollback(); dol_print_error($this->db); return -1; } @@ -1301,12 +1298,10 @@ class Adherent extends CommonObject $this->last_subscription_date_start=$date; $this->last_subscription_date_end=$datefin; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_SUBSCRIPTION',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_SUBSCRIPTION',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -1362,12 +1357,10 @@ class Adherent extends CommonObject { $this->statut=1; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_VALIDATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers $this->db->commit(); return 1; @@ -1412,12 +1405,10 @@ class Adherent extends CommonObject { $this->statut=0; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('MEMBER_RESILIATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('MEMBER_RESILIATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers $this->db->commit(); return 1; From f0323e5b802a862b04aef0ed4ab922c55db7bf63 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 15:21:43 +0200 Subject: [PATCH 101/502] FIX: Contract's trigger problem --- ChangeLog | 1 + htdocs/contrat/class/contrat.class.php | 89 ++++++++++++-------------- 2 files changed, 41 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20ac8a3dff5..81ec4b5c1e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ For users: - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem - Fix: [ bug #1492, #1493 ] Member trigger problem +- Fix: [ bug #1474, #1475 ] Contract trigger problem For translators: - Update language files. diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index daf22e0af7c..960d84c65d6 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -158,12 +158,10 @@ class Contrat extends CommonObject $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_SERVICE_ACTIVATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CONTRACT_SERVICE_ACTIVATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers $this->db->commit(); return 1; @@ -206,12 +204,10 @@ class Contrat extends CommonObject $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_SERVICE_CLOSE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CONTRACT_SERVICE_CLOSE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers $this->db->commit(); return 1; @@ -322,6 +318,7 @@ class Contrat extends CommonObject dol_syslog(get_class($this)."::validate Echec update - 10 - sql=".$sql, LOG_ERR); dol_print_error($this->db); $error++; + $this->error=$this->db->lasterror(); } if (! $error) @@ -365,12 +362,10 @@ class Contrat extends CommonObject // Trigger calls if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CONTRACT_VALIDATE',$user); + if ($result < 0) { $error++; } + // End call triggers } } else @@ -386,7 +381,6 @@ class Contrat extends CommonObject else { $this->db->rollback(); - $this->error=$this->db->lasterror(); return -1; } @@ -756,12 +750,10 @@ class Contrat extends CommonObject if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CONTRACT_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers if (! $error) { @@ -776,7 +768,6 @@ class Contrat extends CommonObject } else { - $this->error=$interface->error; dol_syslog(get_class($this)."::create - 30 - ".$this->error, LOG_ERR); $this->db->rollback(); @@ -903,14 +894,10 @@ class Contrat extends CommonObject if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CONTRACT_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -938,8 +925,7 @@ class Contrat extends CommonObject return 1; } else - { - $this->error=$this->db->error(); + { dol_syslog(get_class($this)."::delete ERROR ".$this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -1255,6 +1241,9 @@ class Contrat extends CommonObject if ($this->statut >= 0) { + + $this->db->begin(); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet"; $sql.= " WHERE rowid=".$idline; @@ -1264,16 +1253,16 @@ class Contrat extends CommonObject { $this->error="Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); + $this->db->rollback(); return -1; } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINECONTRACT_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINECONTRACT_DELETE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers + $this->db->commit(); return 1; } else @@ -2064,6 +2053,8 @@ class ContratLigne $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); } + $this->db->begin(); + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; $sql.= " fk_contrat='".$this->fk_contrat."',"; @@ -2111,19 +2102,19 @@ class ContratLigne { $this->error="Error ".$this->db->lasterror(); dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR); + $this->db->rollback(); 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('LINECONTRACT_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINECONTRACT_UPDATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers } - + + $this->db->commit(); return 1; } From 538cf90f5e8f550e0a9bd43568a34ec60291434f Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 15:39:40 +0200 Subject: [PATCH 102/502] FIX : [ bug #1496 ] ACTION_DELETE trigger does not show trigger error -Add ACTION_* trigger in interface_90_all --- ChangeLog | 2 ++ htdocs/comm/action/class/actioncomm.class.php | 36 +++++++------------ htdocs/comm/action/fiche.php | 3 +- .../interface_90_all_Demo.class.php-NORUN | 16 +++++++++ 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81ec4b5c1e5..02f58dedd5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,8 @@ For users: - Fix: [ bug #1489, #1491 ] Intervention trigger problem - Fix: [ bug #1492, #1493 ] Member trigger problem - Fix: [ bug #1474, #1475 ] Contract trigger problem +- Fix: [ bug #1496 ] ACTION_DELETE trigger does not show trigger error + For translators: - Update language files. diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ee9e4c032ee..139ab2d048a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -227,14 +227,10 @@ class ActionComm extends CommonObject if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ACTION_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ACTION_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -390,14 +386,10 @@ class ActionComm extends CommonObject { if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ACTION_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ACTION_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) @@ -500,14 +492,10 @@ class ActionComm extends CommonObject if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ACTION_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ACTION_MODIFY',$user); + if ($result < 0) { $error++; } + // End call triggers } if (! $error) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 450d7475947..ca17c261680 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -283,8 +283,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') } else { - $mesg=$object->error; - setEventMessage($mesg,'errors'); + setEventMessage($object->error,'errors'); } } } diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index f0f96961b86..f3811afc45b 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -119,6 +119,8 @@ class InterfaceDemo } elseif ($action == 'USER_CREATE') { + $object->error=$action; + return -1; dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } elseif ($action == 'USER_CREATE_FROM_CONTACT') @@ -154,6 +156,20 @@ class InterfaceDemo dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + // Action + elseif ($action == 'ACTION_MODIFY') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'ACTION_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'ACTION_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + // Groups elseif ($action == 'GROUP_CREATE') { From cb4c3a4431a9bbca6877faf1fe71fb0708763358 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 3 Jul 2014 15:51:46 +0200 Subject: [PATCH 103/502] [ task #1063 ] Allow edit localtaxes rate for thirds. Works withd database --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 7 +++++++ htdocs/install/mysql/tables/llx_c_tva.sql | 8 ++++---- htdocs/install/mysql/tables/llx_localtax.sql | 5 +++-- htdocs/install/mysql/tables/llx_societe.sql | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index df1c0cb64c4..f5757a39754 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -51,3 +51,10 @@ ALTER TABLE llx_user MODIFY COLUMN accountancy_code varchar(32); ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT NULL AFTER account_number; ALTER TABLE llx_projet_task_time ADD COLUMN task_datehour datetime after task_date; + +-- Localtaxes by thirds +ALTER TABLE llx_c_tva MODIFY COLUMN localtax1 varchar(10); +ALTER TABLE llx_c_tva MODIFY COLUMN localtax2 varchar(10); +ALTER TABLE llx_localtax ADD COLUMN localtaxtype tinyint(4) after entity; +ALTER TABLE llx_societe ADD COLUMN localtax1_value double(6,3) after localtax1_assuj; +ALTER TABLE llx_societe ADD COLUMN localtax2_value double(6,3) after localtax2_assuj; diff --git a/htdocs/install/mysql/tables/llx_c_tva.sql b/htdocs/install/mysql/tables/llx_c_tva.sql index e2de4c3b5ef..2a0b275ce96 100644 --- a/htdocs/install/mysql/tables/llx_c_tva.sql +++ b/htdocs/install/mysql/tables/llx_c_tva.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2005 Laurent Destailleur --- Copyright (C) 2010 Juanjo Menent +-- Copyright (C) 2010-2014 Juanjo Menent -- Copyright (C) 2011-2012 Alexandre Spangaro -- -- This program is free software; you can redistribute it and/or modify @@ -23,10 +23,10 @@ create table llx_c_tva rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, fk_pays integer NOT NULL, taux double NOT NULL, - localtax1 double NOT NULL DEFAULT 0, + localtax1 varchar(10) NOT NULL DEFAULT '0', localtax1_type varchar(10) NOT NULL DEFAULT '0', - localtax2 double NOT NULL DEFAULT 0, - localtax2_type varchar(10) NOT NULL DEFAULT '0', + localtax2 varchar(10) NOT NULL DEFAULT '0', + localtax2_type varchar(10) NOT NULL DEFAULT '0', recuperableonly integer NOT NULL DEFAULT 0, note varchar(128), active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_localtax.sql b/htdocs/install/mysql/tables/llx_localtax.sql index c7ca3ca44f6..bc646ffc245 100644 --- a/htdocs/install/mysql/tables/llx_localtax.sql +++ b/htdocs/install/mysql/tables/llx_localtax.sql @@ -1,6 +1,6 @@ -- =================================================================== --- Copyright (C) 2011 Juanjo Menent --- Copyright (C) 2011 Regis Houssin +-- Copyright (C) 2011-2014 Juanjo Menent +-- Copyright (C) 2011 Regis Houssin -- -- 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 @@ -21,6 +21,7 @@ create table llx_localtax ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, + localtaxtype tinyint(4), tms timestamp, datep date, -- date of payment datev date, -- date of value diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index e2c08d246be..b7f91c2d1ef 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -81,7 +81,9 @@ create table llx_societe cond_reglement_supplier tinyint, -- condition de reglement fournisseur tva_assuj tinyint DEFAULT 1, -- assujeti ou non a la TVA localtax1_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 1 + localtax1_value double(6,3), localtax2_assuj tinyint DEFAULT 0, -- assujeti ou non a local tax 2 + localtax2_value double(6,3), barcode varchar(255), -- barcode fk_barcode_type integer NULL DEFAULT 0, -- barcode type price_level integer NULL, -- level of price for multiprices From 07f2d9474e6c158690a4f99de4661d6e948da1ed Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 15:52:37 +0200 Subject: [PATCH 104/502] FIX: [ bug #1494 ] CATEGORY_CREATE and CATEGORY_MODIFY triggers do not intercept trigger action --- ChangeLog | 1 + htdocs/categories/class/categorie.class.php | 96 +++++++++++++-------- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02f58dedd5f..14f7129bb70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ For users: - Fix: [ bug #1492, #1493 ] Member trigger problem - Fix: [ bug #1474, #1475 ] Contract trigger problem - Fix: [ bug #1496 ] ACTION_DELETE trigger does not show trigger error +- Fix: [ bug #1494 ] CATEGORY_CREATE and CATEGORY_MODIFY triggers do not intercept trigger action For translators: diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8d2c4ceed46..6eecb1370d6 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -212,16 +212,22 @@ class Categorie extends CommonObject } } else if ($reshook < 0) $error++; + + // Call trigger + $result=$this->call_trigger('CATEGORY_CREATE',$user); + if ($result < 0) { $error++; } + // End call triggers - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CATEGORY_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - - $this->db->commit(); - return $id; + if ( ! $error ) + { + $this->db->rollback(); + return -3; + } + else + { + $this->db->commit(); + return $id; + } } else { @@ -303,12 +309,10 @@ class Categorie extends CommonObject $this->db->commit(); - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CATEGORY_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CATEGORY_MODIFY',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers return 1; } @@ -432,12 +436,10 @@ class Categorie extends CommonObject } } } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CATEGORY_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; $this->error=join(',',$this->errors); } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CATEGORY_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers } } @@ -477,6 +479,8 @@ class Categorie extends CommonObject if ($type=='contact') $column_name='socpeople'; if ($type=='fournisseur') $column_name='societe'; + $this->db->begin(); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")"; $sql .= " VALUES (".$this->id.", ".$obj->id.")"; @@ -517,6 +521,7 @@ class Categorie extends CommonObject if ($error) { + $this->db->rollback(); return -1; } } @@ -524,18 +529,26 @@ class Categorie extends CommonObject // Save object we want to link category to into category instance to provide information to trigger $this->linkto=$obj; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CATEGORY_LINK',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; $this->error=$interface->error; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CATEGORY_LINK',$user); + if ($result < 0) { $error++; } + // End call triggers - if (! $error) return 1; - else return -2; + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -2; + } + } else { + $this->db->rollback(); if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error=$this->db->lasterrno(); @@ -570,6 +583,8 @@ class Categorie extends CommonObject $column_name=$type; if ($type=='contact') $column_name='socpeople'; if ($type=='fournisseur') $column_name='societe'; + + $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".$type; $sql .= " WHERE fk_categorie = ".$this->id; @@ -581,18 +596,25 @@ class Categorie extends CommonObject // Save object we want to unlink category off into category instance to provide information to trigger $this->unlinkoff=$obj; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CATEGORY_UNLINK',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('CATEGORY_UNLINK',$user); + if ($result < 0) { $error++; } + // End call triggers - if (! $error) return 1; - else return -2; + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -2; + } } else { + $this->db->rollback(); $this->error=$this->db->lasterror(); return -1; } From 023e7ce8ce33935baeef2864a50467e8804749ec Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 16:04:12 +0200 Subject: [PATCH 105/502] FIX : [ bug #1502 ] DON_CREATE trigger does not intercept trigger action - Add DON_CREATE in interface_90_all - Add new trigger DON_UPDATE, DON_DELETE --- ChangeLog | 2 ++ htdocs/compta/dons/class/don.class.php | 34 ++++++++++++++----- .../interface_90_all_Demo.class.php-NORUN | 16 +++++++++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14f7129bb70..26ded2e941d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ For users: - Fix: [ bug #1474, #1475 ] Contract trigger problem - Fix: [ bug #1496 ] ACTION_DELETE trigger does not show trigger error - Fix: [ bug #1494 ] CATEGORY_CREATE and CATEGORY_MODIFY triggers do not intercept trigger action +- Fix: [ bug #1502 ] DON_CREATE trigger does not intercept trigger action For translators: @@ -23,6 +24,7 @@ For translators: For developers: - New: Add hook "searchAgendaFrom". +- New: Add trigger DON_UPDATE, DON_DELETE ***** ChangeLog for 3.6 compared to 3.5.* ***** diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index f7bd819d969..c9580fcf5c0 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -307,6 +307,8 @@ class Don extends CommonObject $this->country=($this->country?$this->country:$this->country); $now=dol_now(); + + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."don ("; $sql.= "datec"; @@ -360,19 +362,17 @@ class Don extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."don"); - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('DON_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('DON_CREATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers + $this->db->commit(); return $this->id; } else { + $this->db->rollback(); dol_print_error($this->db); return -1; } @@ -393,6 +393,8 @@ class Don extends CommonObject $this->country_id=($this->country_id>0?$this->country_id:$this->country_id); $this->country=($this->country?$this->country:$this->country); + $this->db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."don SET "; $sql .= "amount = " . price2num($this->amount); $sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null"); @@ -418,10 +420,17 @@ class Don extends CommonObject $result = $this->db->query($sql); if ($result) { + // Call trigger + $result=$this->call_trigger('DON_UPDATE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers + + $this->db->commit(); return 1; } else { + $this->db->rollback(); dol_print_error($this->db); return -1; } @@ -435,6 +444,8 @@ class Don extends CommonObject */ function delete($rowid) { + + $this->db-begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;"; @@ -443,10 +454,17 @@ class Don extends CommonObject { if ( $this->db->affected_rows($resql) ) { + // Call trigger + $result=$this->call_trigger('DON_DELETE',$user); + if ($result < 0) { $error++; $this->db->rollback(); return -1; } + // End call triggers + + $this->db->commit(); return 1; } else { + $this->db->rollback(); return -1; } } diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index f3811afc45b..62b758739c7 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -503,6 +503,22 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + + //Donation + elseif ($action == 'DON_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'DON_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'DON_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + + // Interventions elseif ($action == 'FICHINTER_CREATE') From e0201535e26cb067e0cf3c9d2efffd3cf423b9c3 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 3 Jul 2014 17:15:42 +0200 Subject: [PATCH 106/502] Fix: [ bug #1505, #1504] Project trigger problem --- ChangeLog | 1 + htdocs/projet/class/project.class.php | 84 ++++++++++++--------------- htdocs/projet/class/task.class.php | 68 +++++++++++----------- htdocs/projet/fiche.php | 3 +- htdocs/projet/tasks.php | 7 +++ htdocs/projet/tasks/task.php | 6 ++ htdocs/projet/tasks/time.php | 2 +- 7 files changed, 89 insertions(+), 82 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26ded2e941d..b6c474f6f92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ For users: - Fix: [ bug #1496 ] ACTION_DELETE trigger does not show trigger error - Fix: [ bug #1494 ] CATEGORY_CREATE and CATEGORY_MODIFY triggers do not intercept trigger action - Fix: [ bug #1502 ] DON_CREATE trigger does not intercept trigger action +- Fix: [ bug #1505, #1504] Project trigger problem For translators: diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c2b8b95f608..82e9dd72874 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -130,15 +130,9 @@ class Project extends CommonObject if (!$notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('PROJECT_CREATE', $this, $user, $langs, $conf); - if ($result < 0) - { - $error++; - $this->errors = $interface->errors; - } + // Call trigger + $result=$this->call_trigger('PROJECT_CREATE',$user); + if ($result < 0) { $error++; } // End call triggers } } @@ -199,6 +193,8 @@ class Project extends CommonObject if (dol_strlen(trim($this->ref)) > 0) { + $this->db->begin(); + $sql = "UPDATE " . MAIN_DB_PREFIX . "projet SET"; $sql.= " ref='" . $this->db->escape($this->ref) . "'"; $sql.= ", title = '" . $this->db->escape($this->title) . "'"; @@ -216,15 +212,9 @@ class Project extends CommonObject { if (!$notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('PROJECT_MODIFY', $this, $user, $langs, $conf); - if ($result < 0) - { - $error++; - $this->errors = $interface->errors; - } + // Call trigger + $result=$this->call_trigger('PROJECT_MODIFY',$user); + if ($result < 0) { $error++; } // End call triggers } @@ -259,13 +249,24 @@ class Project extends CommonObject } } } + if (! $error ) + { + $this->db->commit(); + $result = 1; + } + else + { + $this->db->rollback(); + $result = -1; + } - $result = 1; + } else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::Update error -2 " . $this->error, LOG_ERR); + $this->db->rollback(); $result = -2; } } @@ -528,17 +529,18 @@ class Project extends CommonObject if (!$notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('PROJECT_DELETE', $this, $user, $langs, $conf); + // Call trigger + $result=$this->call_trigger('PROJECT_DELETE',$user); if ($result < 0) { $error++; - foreach ($interface->errors as $errmsg ) { - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); - $this->errors[] =$errmsg; - } + if (! empty($interface->errors)) + { + foreach ($interface->errors as $errmsg ) { + dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); + $this->errors[] =$errmsg; + } + } } // End call triggers } @@ -587,16 +589,10 @@ class Project extends CommonObject $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('PROJECT_VALIDATE', $this, $user, $langs, $conf); - if ($result < 0) - { - $error++; - $this->errors = $interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('PROJECT_VALIDATE',$user); + if ($result < 0) { $error++; } + // End call triggers if (!$error) { @@ -648,16 +644,10 @@ class Project extends CommonObject $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('PROJECT_CLOSE', $this, $user, $langs, $conf); - if ($result < 0) - { - $error++; - $this->errors = $interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('PROJECT_CLOSE',$user); + if ($result < 0) { $error++; } + // End call triggers if (!$error) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 697d773f02c..5dc3a6fd52e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -133,11 +133,9 @@ class Task extends CommonObject if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_CREATE',$user); + if ($result < 0) { $error++; } // End call triggers } } @@ -303,11 +301,9 @@ class Task extends CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_MODIFY',$user); + if ($result < 0) { $error++; } // End call triggers } } @@ -394,11 +390,9 @@ class Task extends CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_DELETE',$user); + if ($result < 0) { $error++; } // End call triggers } } @@ -744,11 +738,12 @@ class Task extends CommonObject { global $conf,$langs; - $error=0; $ret = 0; // Clean parameters if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note); + + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time ("; $sql.= "fk_task"; @@ -772,11 +767,9 @@ class Task extends CommonObject if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_TIMESPENT_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_TIMESPENT_CREATE',$user); + if ($result < 0) { $this->db->rollback(); $ret=-1; } // End call triggers } } @@ -784,6 +777,7 @@ class Task extends CommonObject { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::addTimeSpent error -1 ".$this->error,LOG_ERR); + $this->db->rollback(); $ret = -1; } @@ -798,6 +792,7 @@ class Task extends CommonObject { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::addTimeSpent error -2 ".$this->error, LOG_ERR); + $this->db->rollback(); $ret = -2; } } @@ -813,10 +808,12 @@ class Task extends CommonObject { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::addTimeSpent error -2 ".$this->error, LOG_ERR); + $this->db->rollback(); $ret = -2; } } + if ($ret >=0) $this->db->commit(); return $ret; } @@ -879,11 +876,12 @@ class Task extends CommonObject { global $conf,$langs; - $error=0; $ret = 0; // Clean parameters if (isset($this->timespent_note)) $this->timespent_note = trim($this->timespent_note); + + $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET"; $sql.= " task_date = '".$this->db->idate($this->timespent_date)."',"; @@ -897,19 +895,23 @@ class Task extends CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_TIMESPENT_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_TIMESPENT_MODIFY',$user); + if ($result < 0) + { + $this->db->rollback(); + $ret = -1; + } + else $ret = 1; // End call triggers } - $ret = 1; + else $ret = 1; } else { $this->error=$this->db->lasterror(); dol_syslog(get_class($this)."::updateTimeSpent error -1 ".$this->error,LOG_ERR); + $this->db->rollback(); $ret = -1; } @@ -925,11 +927,13 @@ class Task extends CommonObject if (! $this->db->query($sql) ) { $this->error=$this->db->lasterror(); + $this->db->rollback(); dol_syslog(get_class($this)."::addTimeSpent error -2 ".$this->error, LOG_ERR); $ret = -2; } } + if ($ret >= 0) $this->db->commit(); return $ret; } @@ -959,11 +963,9 @@ class Task extends CommonObject { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TASK_TIMESPENT_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('TASK_TIMESPENT_DELETE',$user); + if ($result < 0) { $error++; } // End call triggers } } diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 123b4a611b4..00fdf65d15a 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -340,7 +340,8 @@ if (empty($reshook)) else { dol_syslog($object->error,LOG_DEBUG); - $mesg='
'.$langs->trans("CantRemoveProject").'
'; + setEventMessage($object->error,'errors'); + setEventMessage($object->errors,'errors'); } } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 356eed55e6d..7c94401f861 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -130,6 +130,11 @@ if ($action == 'createtask' && $user->rights->projet->creer) if ($taskid > 0) { $result = $task->add_contact($_POST["userid"], 'TASKEXECUTIVE', 'internal'); + } + else + { + setEventMessage($task->error,'errors'); + setEventMessage($task->errors,'errors'); } } @@ -193,6 +198,8 @@ if ($id > 0 || ! empty($ref)) $head=project_prepare_head($object); dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project')); + + dol_htmloutput_mesg(); $param=($mode=='mine'?'&mode=mine':''); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index dd83cf57d8f..14339291c4c 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -91,6 +91,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $ret = $extrafields->setOptionalsFromPost($extralabels,$object); $result=$object->update($user); + + if ($result < 0) + { + setEventMessage($object->error,'errors'); + setEventMessage($object->errors,'errors'); + } } else { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f6c5a1840ea..f6430ff4f55 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -140,7 +140,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->c $object->fetchTimeSpent($_GET['lineid']); $result = $object->delTimeSpent($user); - if (!$result) + if ($result < 0) { $langs->load("errors"); setEventMessage($langs->trans($object->error),'errors'); From e30649dcd27ccedeb574cd78d863cbaea8cc3a22 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 3 Jul 2014 17:39:31 +0200 Subject: [PATCH 107/502] [ task #1063 ] Allow edit localtaxes rate for thirds. Works with company --- htdocs/admin/company.php | 74 +++++++- htdocs/core/class/html.formcompany.class.php | 38 ++++ htdocs/core/lib/functions.lib.php | 180 +++++++++++++++++-- htdocs/install/mysql/data/llx_c_tva.sql | 8 +- htdocs/langs/en_US/admin.lang | 7 + 5 files changed, 292 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 2cf381b31cb..fd3629b1cba 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011 Philippe Grand * * This program is free software; you can redistribute it and/or modify @@ -158,6 +158,31 @@ if ( ($action == 'update' && empty($_POST["cancel"])) // Local taxes dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity); + + if($_POST["optionlocaltax1"]=="localtax1on") + { + if(!isset($_REQUEST['lt1'])) + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); + } + else + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1'),'chaine',0,'',$conf->entity); + } + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", $_POST["clt1"],'chaine',0,'',$conf->entity); + } + if($_POST["optionlocaltax2"]=="localtax2on") + { + if(!isset($_REQUEST['lt2'])) + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); + } + else + { + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2'),'chaine',0,'',$conf->entity); + } + dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", $_POST["clt2"],'chaine',0,'',$conf->entity); + } if ($action != 'updateedit' && ! $error) { @@ -570,6 +595,17 @@ if ($action == 'edit' || $action == 'updateedit') print "".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code).""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."\n":""); + if(! isOnlyOneLocalTax(1)) + { + print ''.$langs->transcountry("LocalTax1Management",$mysoc->country_code).': '; + $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); + } + print ''; + + print ''.$langs->trans("CalcLocaltax").': '; + $opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code)); + print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); + print ''; print ""; print "\n"; @@ -603,6 +639,16 @@ if ($action == 'edit' || $action == 'updateedit') print "".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code).""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."\n":""); + print ''.$langs->transcountry("LocalTax2Management",$mysoc->country_code).': '; + if(! isOnlyOneLocalTax(2)) + { + $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + print ''; + } + print ''.$langs->trans("CalcLocaltax").': '; + $opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code)); + print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); + print ''; print ""; print "\n"; @@ -954,6 +1000,19 @@ else print "".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code).""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."\n":""); + if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0){ + print ''.$langs->transcountry("LocalTax1Management",$mysoc->country_code).': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .''; + } + print ''.$langs->trans("CalcLocaltax").': '; + if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0){ + print $langs->transcountry("CalcLocaltax1",$mysoc->country_code); + }else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1){ + print $langs->transcountry("CalcLocaltax2",$mysoc->country_code); + }else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ + print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); + } + + print ''; print ""; print "\n"; @@ -987,6 +1046,19 @@ else print "".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code).""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."\n":""); + if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0){ + print ''.$langs->transcountry("LocalTax2Management",$mysoc->country_code).': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .''; + } + print ''.$langs->trans("CalcLocaltax").': '; + if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0){ + print $langs->transcountry("CalcLocaltax1",$mysoc->country_code); + }else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1){ + print $langs->transcountry("CalcLocaltax2",$mysoc->country_code); + }else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2){ + print $langs->transcountry("CalcLocaltax3",$mysoc->country_code); + } + + print ''; print ""; print "\n"; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index a22f0b38c10..7c32c31f696 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -775,6 +776,43 @@ class FormCompany return $out; } + + /** + * Return a select with localtax values for thirds + * + * @param int $local LocalTax + * @param int $selected Preselected value + * @param varchar $htmlname HTML select name + */ + function select_localtax($local, $selected, $htmlname) + { + $tax=get_localtax_by_third($local); + + $num = $this->db->num_rows($tax); + $i = 0; + if ($num) + { + $valors=explode(":", $tax); + + if(sizeof($valors)>1) + { + //montar select + print ''; + + } + } + } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e81c8b3b2d9..3a4fd073336 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * @@ -2886,7 +2886,11 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") if (empty($thirdparty_seller) || ! is_object($thirdparty_seller)) $thirdparty_seller=$mysoc; dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')."/country_code=".(is_object($thirdparty_buyer)?$thirdparty_buyer->country_code:'')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj); - + + if($thirdparty_buyer->country_code!=$thirdparty_seller->country_code) + { + return 0; + } // Some test to guess with no need to make database access if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe { @@ -2898,14 +2902,14 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") } else { - if (! $thirdparty_seller->localtax1_assuj) return 0; + if (! $thirdparty_seller->localtax1_assuj) return 0; } } if ($local == 2) { - - if ($thirdparty_seller->id==$mysoc->id) + + if ($thirdparty_seller->id==$mysoc->id ) { if (! $thirdparty_buyer->localtax2_assuj) return 0; } @@ -2931,6 +2935,43 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") }*/ // Search local taxes + if ($local==1) + { + if($thirdparty_seller!=$mysoc ) + { + if(!isOnlyOneLocalTax($local)) + { + return $thirdparty_seller->localtax1_value; + } + } + else + { + if(!isOnlyOneLocalTax($local)) + { + return $conf->global->MAIN_INFO_VALUE_LOCALTAX1; + } + } + } + if ($local==2) + { + if($thirdparty_seller!=$mysoc) + { + if(!isOnlyOneLocalTax($local)) + { + return $thirdparty_seller->localtax2_value; + } + } + else + { + if(!isOnlyOneLocalTax($local)) + { + return $conf->global->MAIN_INFO_VALUE_LOCALTAX2; + } + } + } + + + $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; @@ -2948,6 +2989,57 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") return 0; } + +/** + * Return true if LocalTax is unique + * + * @param int $local Local taxt to test + * @return boolean True if LocalTax have multiple values, False if not + */ +function isOnlyOneLocalTax($local) +{ + $tax=get_localtax_by_third($local); + + $valors=explode(":", $tax); + + if(sizeof($valors)>1) + { + return false; + } + else + { + return true; + } +} + +/** + * Get values of localtaxes + * + * @param int $local LocalTax to get + * @return number Values of localtax + */ +function get_localtax_by_third($local) +{ + global $db, $mysoc; + $sql="SELECT t.localtax1, t.localtax2 "; + $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=t.fk_pays"; + $sql.=" WHERE p.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)"; + $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=tt.fk_pays"; + $sql.= " WHERE p.code = '".$mysoc->country_code."')"; + + $resql=$db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($local==1) return $obj->localtax1; + elseif ($local==2) return $obj->localtax2; + } + + return 0; + +} + + /** * Get type and rate of localtaxes for a particular vat rate/country fo thirdparty * TODO @@ -2960,7 +3052,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") * @param int $thirdparty Company object * @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...) */ -function getLocalTaxesFromRate($vatrate, $local, $thirdparty) +function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller) { global $db; @@ -2969,16 +3061,84 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty) // Search local taxes $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$buyer->country_code."'"; $sql .= " AND t.taux = ".$vatrate." AND t.active = 1"; $resql=$db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); - if ($local == 1) return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy); - elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); - else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + if ($local == 1) + { + if (! isOnlyOneLocalTax(1)) + { + return array($obj->localtax1_type, get_localtax($vatrate, $local, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + elseif ($local == 2) + { + if (! isOnlyOneLocalTax(2)) + { + return array($obj->localtax2_type, get_localtax($vatrate, $local, $buyer, $seller),$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + else + { + if(! isOnlyOneLocalTax(1)) + { + if(! isOnlyOneLocalTax(2)) + { + return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller),$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + else + { + if(! isOnlyOneLocalTax(2)) + { + return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type,get_localtax($vatrate, 2, $buyer, $seller) ,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + + if(! isOnlyOneLocalTax(2)) + { + if(! isOnlyOneLocalTax(1)) + { + return array($obj->localtax2_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller),$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax2_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + else + { + if(! isOnlyOneLocalTax(1)) + { + return array($obj->localtax2_type, $obj->localtax2, $obj->localtax1_type,get_localtax($vatrate, 1, $buyer, $seller) ,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + else + { + return array($obj->localtax2_type, $obj->localtax2, $obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy); + } + } + + } } return 0; diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index c8091e3889e..1d4572591d1 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -216,10 +216,10 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (20 INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4,'21','0','5.2','3','-21','1','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-21','1','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-21','1','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0', '0','3','-21','1','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4,'21','0','5.2','3','-21:-9:-2','1','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-21:-9:-2','1','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-21:-9:-2','1','VAT super-reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4, '0','0', '0','3','-21:-9:-2','1','VAT Rate 0',1); -- SWEDEN (id country=20) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (201,20, '25','0','VAT standard rate',1); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4bec9fed799..dc03720ccd2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -807,6 +807,13 @@ LocalTax2IsUsedDescES= The RE rate by default when creating prospects, invoices, LocalTax2IsNotUsedDescES= By default the proposed IRPF is 0. End of rule. LocalTax2IsUsedExampleES= In Spain, freelancers and independent professionals who provide services and companies who have chosen the tax system of modules. LocalTax2IsNotUsedExampleES= In Spain they are bussines not subject to tax system of modules. +CalcLocaltax=Reports +CalcLocaltax1ES=Sales - Purchases +CalcLocaltax1Desc=Local Taxes reports are calculated with the difference between localtaxes sales and localtaxes purchases +CalcLocaltax2ES=Purchases +CalcLocaltax2Desc=Local Taxes reports are the total of localtaxes purchases +CalcLocaltax3ES=Sales +CalcLocaltax3Desc=Local Taxes reports are the total of localtaxes sales LabelUsedByDefault=Label used by default if no translation can be found for code LabelOnDocuments=Label on documents NbOfDays=Nb of days From 4c7eba0ee0bbb2c456b888db7e9636be7fff419f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 3 Jul 2014 18:47:06 +0200 Subject: [PATCH 108/502] [ task #1063 ] Allow edit localtaxes rate for thirds. Works with thirds --- htdocs/societe/class/societe.class.php | 52 ++++++- htdocs/societe/soc.php | 191 ++++++++++++++++++++++--- 2 files changed, 224 insertions(+), 19 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5893fbab021..307c2fe03de 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine @@ -196,7 +196,9 @@ class Societe extends CommonObject // Local taxes var $localtax1_assuj; + var $localtax1_value; var $localtax2_assuj; + var $localtax2_value; var $managers; var $capital; @@ -597,6 +599,24 @@ class Societe extends CommonObject return $result; } + /** + * Update localtax value of third party + * @param int $id id societe + * @param int $local Localtax to update + * @param double $value value of localtax + */ + function update_localtax($id, $local, $value) + { + global $db; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; + if($local==1) $sql .= "localtax1_value = '" .$value."'"; + else $sql.="localtax2_value='".$value."'"; + $sql.="WHERE rowid=".$id; + + $resql=$this->db->query($sql); + + } + /** * Update parameters of third party * @@ -654,6 +674,9 @@ class Societe extends CommonObject // Local taxes $this->localtax1_assuj=trim($this->localtax1_assuj); $this->localtax2_assuj=trim($this->localtax2_assuj); + + $this->localtax1_value=trim($this->localtax1_value); + $this->localtax2_value=trim($this->localtax2_value); $this->capital=price2num(trim($this->capital),'MT'); if (empty($this->capital)) $this->capital = 0; @@ -753,6 +776,27 @@ class Societe extends CommonObject // Local taxes $sql .= ",localtax1_assuj = ".($this->localtax1_assuj!=''?"'".$this->localtax1_assuj."'":"null"); $sql .= ",localtax2_assuj = ".($this->localtax2_assuj!=''?"'".$this->localtax2_assuj."'":"null"); + if($this->localtax1_assuj==1) + { + if($this->localtax1_value!='') + { + $sql .=",localtax1_value =".$this->localtax1_value; + } + else $sql .=",localtax1_value =0.000"; + + } + else $sql .=",localtax1_value =0.000"; + + if($this->localtax2_assuj==1) + { + if($this->localtax2_value!='') + { + $sql .=",localtax2_value =".$this->localtax2_value; + } + else $sql .=",localtax2_value =0.000"; + + } + else $sql .=",localtax2_value =0.000"; $sql .= ",capital = ".$this->capital; @@ -933,7 +977,7 @@ class Societe extends CommonObject $sql .= ', s.fk_forme_juridique as forme_juridique_code'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.mode_reglement, s.cond_reglement, s.tva_assuj'; - $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax2_assuj, s.fk_prospectlevel, s.default_lang, s.logo'; + $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas'; $sql .= ', fj.libelle as forme_juridique'; $sql .= ', e.libelle as effectif'; @@ -1034,7 +1078,9 @@ class Societe extends CommonObject // Local Taxes $this->localtax1_assuj = $obj->localtax1_assuj; $this->localtax2_assuj = $obj->localtax2_assuj; - + + $this->localtax1_value = $obj->localtax1_value; + $this->localtax2_value = $obj->localtax2_value; $this->typent_id = $obj->typent_id; $this->typent_code = $obj->typent_code; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index da6c7771eb3..d903b4d540b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2013 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -32,6 +32,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -100,6 +101,23 @@ if (empty($reshook)) // We defined value code_fournisseur $_POST["code_fournisseur"]="Acompleter"; } + + if($action=='set_localtax1') + { + //obtidre selected del combobox + $value=GETPOST('lt1'); + $object = new Societe($db); + $res=$object->update_localtax($socid, 1, $value); + + } + if($action=='set_localtax2') + { + //obtidre selected del combobox + $value=GETPOST('lt2'); + $object = new Societe($db); + $res=$object->update_localtax($socid, 2, $value); + + } // Add new third party if ((! GETPOST('getcustomercode') && ! GETPOST('getsuppliercode')) @@ -157,6 +175,9 @@ if (empty($reshook)) // Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + + $object->localtax1_value = GETPOST('lt1'); + $object->localtax2_value = GETPOST('lt2'); $object->forme_juridique_code = GETPOST('forme_juridique_code'); $object->effectif_id = GETPOST('effectif_id'); @@ -659,6 +680,9 @@ else //Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + + $object->localtax1_value =GETPOST('lt1'); + $object->localtax2_value =GETPOST('lt2'); $object->tva_intra = GETPOST('tva_intra'); @@ -1004,13 +1028,14 @@ else print $form->selectyesno('localtax2assuj_value',0,1); print ''; } - +/* if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='') ) { print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value',0,1); print ''; } +*/ if (! empty($conf->global->MAIN_MULTILANGS)) { print ''.$langs->trans("DefaultLang").''."\n"; @@ -1150,6 +1175,9 @@ else //Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + + $object->localtax1_value =GETPOST('lt1'); + $object->localtax2_value =GETPOST('lt2'); // We set country_id, and country_code label of the chosen country if ($object->country_id > 0) @@ -1162,6 +1190,53 @@ else dol_htmloutput_errors($error,$errors); + if($object->localtax1_assuj==0){ + $sub=0; + }else{$sub=1;} + if($object->localtax2_assuj==0){ + $sub2=0; + }else{$sub2=1;} + + + print "\n".''."\n"; + + if ($conf->use_javascript_ajax) { print "\n".''."\n"; - - + + if ($conf->use_javascript_ajax) { print "\n".' +'; +*/ + +llxFooter(); + +$db->close(); From 32b015e661fcb50e85847bf277f978053f6e64d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Jul 2014 13:56:35 +0200 Subject: [PATCH 189/502] New: Type of thirdparties can accept a country (to show list of types specific for a country). --- ChangeLog | 10 ++++-- htdocs/admin/dict.php | 33 ++++++++++++------- htdocs/core/class/ctypent.class.php | 6 ++-- htdocs/core/class/html.formcompany.class.php | 4 +-- htdocs/install/mysql/data/llx_c_typent.sql | 24 +++++++------- .../install/mysql/migration/3.6.0-3.7.0.sql | 9 +++-- htdocs/install/mysql/tables/llx_c_typent.sql | 11 ++++--- 7 files changed, 60 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32bb738eba6..0164ca14788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,15 +8,19 @@ For users: - New: [ task #867 ] Remove ESAEB external module code from core. - New: Can create proposal from an intervention. - New: Can filter events on a group of users. -- New: Add thirdparty to filter on events. +- New: Can filter events of a thirdparty. +- New: Split Agenda view (month, week, day) into different tabs. - New: Form to add a photo is immediatly available on photo page if permissions are ok (save one click per photo to add). - New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos shown on main product card. - New: Add event FICHINTER_CLASSIFY_BILLED into list of possible events to create an automatic event into agenda. -- New: Add new type of event (when type of events are used, not by - default) +- New: Add new type of event (when type of events are used, not by default) +- New: Add country into table of thirdparties type. This will allow to provide + a list of thirdparty types specific to a country (like argentina that + need type A or B). +- New: Can force a specific bank account onto an invoice/order... - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 656158a19cd..788483196e4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -130,16 +130,16 @@ $tablib[24]= "DictionaryAccountancysystem"; $tablib[25]= "DictionaryRevenueStamp"; $tablib[26]= "DictionaryResourceType"; -// Requete pour extraction des donnees des dictionnaires +// Requests to extract data $tabsql=array(); $tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; $tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1"; -$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; +$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; $tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; $tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; -$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; +$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, p.code as country_code, p.libelle as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON t.fk_country=p.rowid"; $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; $tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; @@ -159,7 +159,7 @@ $tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.c $tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[26]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; -// Critere de tri du dictionnaire +// Criteria to sort dictionaries $tabsqlsort=array(); $tabsqlsort[1] ="country ASC, code ASC"; $tabsqlsort[2] ="country ASC, code ASC"; @@ -168,7 +168,7 @@ $tabsqlsort[4] ="code ASC"; $tabsqlsort[5] ="libelle ASC"; $tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC"; $tabsqlsort[7] ="country ASC, code ASC, a.libelle ASC"; -$tabsqlsort[8] ="libelle ASC"; +$tabsqlsort[8] ="country DESC, libelle ASC"; $tabsqlsort[9] ="label ASC"; $tabsqlsort[10]="country ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC"; $tabsqlsort[11]="element ASC, source ASC, code ASC"; @@ -197,7 +197,7 @@ $tabfield[4] = "code,libelle"; $tabfield[5] = "code,libelle"; $tabfield[6] = "code,libelle,type,position"; $tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; -$tabfield[8] = "code,libelle"; +$tabfield[8] = "code,libelle,country_id,country"; $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle"; @@ -226,7 +226,7 @@ $tabfieldvalue[4] = "code,libelle"; $tabfieldvalue[5] = "code,libelle"; $tabfieldvalue[6] = "code,libelle,type,position"; $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; -$tabfieldvalue[8] = "code,libelle"; +$tabfieldvalue[8] = "code,libelle,country"; $tabfieldvalue[9] = "code,label,unicode"; $tabfieldvalue[10]= "country,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle"; @@ -255,7 +255,7 @@ $tabfieldinsert[4] = "code,libelle"; $tabfieldinsert[5] = "code,civilite"; $tabfieldinsert[6] = "code,libelle,type,position"; $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible"; -$tabfieldinsert[8] = "code,libelle"; +$tabfieldinsert[8] = "code,libelle,fk_country"; $tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle"; @@ -428,7 +428,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input + if ($value == 'country' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory + if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ((! isset($_POST[$value]) || $_POST[$value]=='') @@ -473,9 +474,17 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; }*/ } - if (isset($_POST["country"]) && $_POST["country"]=='0') { - $ok=0; - setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); + if (isset($_POST["country"]) && $_POST["country"]=='0') + { + if (in_array($tablib[$id],array('DictionaryCompanyType'))) + { + $_POST["country"]=''; + } + else + { + $ok=0; + setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors'); + } } // Clean some parameters diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index dd039b71015..eea64ed10ac 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -156,7 +156,8 @@ class Ctypent // extends CommonObject $sql = "SELECT"; $sql.= " t.id,"; $sql.= " t.code,"; - $sql.= " t.libelle,"; + $sql.= " t.libelle as label,"; + $sql.= " t.fk_country as country_id,"; $sql.= " t.active,"; $sql.= " t.module"; $sql.= " FROM ".MAIN_DB_PREFIX."c_typent as t"; @@ -173,7 +174,8 @@ class Ctypent // extends CommonObject $this->id = $obj->id; $this->code = $obj->code; - $this->libelle = $obj->libelle; + $this->libelle = $obj->label; + $this->country_id = $obj->country_id; $this->active = $obj->active; $this->module = $obj->module; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index d71c26af29c..7728080c01b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -57,13 +57,13 @@ class FormCompany */ function typent_array($mode=0, $filter='') { - global $langs; + global $langs,$mysoc; $effs = array(); $sql = "SELECT id, code, libelle"; $sql.= " FROM ".MAIN_DB_PREFIX."c_typent"; - $sql.= " WHERE active = 1"; + $sql.= " WHERE active = 1 AND (fk_country IS NULL OR fk_country = ".(empty($mysoc->country_id)?'0':$mysoc->country_id).")"; if ($filter) $sql.=" ".$filter; $sql.= " ORDER by id"; dol_syslog(get_class($this).'::typent_array', LOG_DEBUG); diff --git a/htdocs/install/mysql/data/llx_c_typent.sql b/htdocs/install/mysql/data/llx_c_typent.sql index 154798cdd4f..8349cd13a5a 100644 --- a/htdocs/install/mysql/data/llx_c_typent.sql +++ b/htdocs/install/mysql/data/llx_c_typent.sql @@ -27,17 +27,19 @@ -- -- --- Types entreprises +-- Types of thirdparties -- delete from llx_c_typent; -insert into llx_c_typent (id,code,libelle,active) values ( 0, 'TE_UNKNOWN', '-', 1); -insert into llx_c_typent (id,code,libelle,active) values ( 1, 'TE_STARTUP', 'Start-up', 0); -insert into llx_c_typent (id,code,libelle,active) values ( 2, 'TE_GROUP', 'Grand groupe', 1); -insert into llx_c_typent (id,code,libelle,active) values ( 3, 'TE_MEDIUM', 'PME/PMI', 1); -insert into llx_c_typent (id,code,libelle,active) values ( 4, 'TE_SMALL', 'TPE', 1); -insert into llx_c_typent (id,code,libelle,active) values ( 5, 'TE_ADMIN', 'Administration',1); -insert into llx_c_typent (id,code,libelle,active) values ( 6, 'TE_WHOLE', 'Grossiste', 0); -insert into llx_c_typent (id,code,libelle,active) values ( 7, 'TE_RETAIL', 'Revendeur', 0); -insert into llx_c_typent (id,code,libelle,active) values ( 8, 'TE_PRIVATE', 'Particulier', 1); -insert into llx_c_typent (id,code,libelle,active) values (100, 'TE_OTHER', 'Autres', 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 0, 'TE_UNKNOWN', '-', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 3, 'TE_MEDIUM', 'PME/PMI', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 4, 'TE_SMALL', 'TPE', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 5, 'TE_ADMIN', 'Administration',NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WHOLE', 'Grossiste', NULL, 0); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0); +insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A1', 'Type A', 23, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B2', 'Type B', 23, 1); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 19b820d964c..f6de3ef3b03 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -21,10 +21,15 @@ ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; -insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); +-- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) +ALTER TABLE llx_c_typent ADD COLUMN fk_country integer NULL AFTER libelle; + +INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19); -insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4); +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4); + + ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_accountingaccount add column datec datetime NOT NULL AFTER entity; ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec; diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index 62d39cea8ad..06a41727b69 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -19,9 +19,10 @@ create table llx_c_typent ( - id integer PRIMARY KEY, - code varchar(12) NOT NULL, - libelle varchar(30), - active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL + id integer PRIMARY KEY, + code varchar(12) NOT NULL, + libelle varchar(30), + fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) + active tinyint DEFAULT 1 NOT NULL, + module varchar(32) NULL )ENGINE=innodb; From 8e64ea274d0d258157d50cd50e282b4678ad44f8 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 14:02:21 +0200 Subject: [PATCH 190/502] Refactor: ORDER_* and LINEORDER_* trigger --- htdocs/commande/class/commande.class.php | 140 ++++++++++------------- 1 file changed, 59 insertions(+), 81 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b6d06abf368..6c1b5eeed90 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -238,6 +238,7 @@ class Commande extends CommonOrder if (! $resql) { dol_print_error($this->db); + $this->error=$this->db->lasterror(); $error++; } @@ -259,8 +260,13 @@ class Commande extends CommonOrder $mouvP->origin = &$this; // We decrement stock of product (and sub-products) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr",$num)); - if ($result < 0) { $error++; } + if ($result < 0) + { + $error++; + $this->error=$mouvP->error; + } } + if ($error) break; } } } @@ -296,12 +302,10 @@ class Commande extends CommonOrder if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_VALIDATE',$user); + if ($result < 0) $error++; + // End call triggers } // Set new ref and current status @@ -319,7 +323,6 @@ class Commande extends CommonOrder else { $this->db->rollback(); - $this->error=$this->db->lasterror(); return -1; } } @@ -430,12 +433,10 @@ class Commande extends CommonOrder $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_REOPEN',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_REOPEN',$user); + if ($result < 0) $error++; + // End call triggers } else { @@ -491,13 +492,11 @@ class Commande extends CommonOrder if ($this->db->query($sql)) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_CLOSE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - + // Call trigger + $result=$this->call_trigger('ORDER_CLOSE',$user); + if ($result < 0) $error++; + // End call triggers + if (! $error) { $this->statut=3; @@ -558,8 +557,11 @@ class Commande extends CommonOrder $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref)); - if ($result < 0) { + if ($result < 0) + { $error++; + $this->error=$mouvP->error; + break; } } } @@ -567,14 +569,10 @@ class Commande extends CommonOrder if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_CANCEL',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_CANCEL',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -585,8 +583,6 @@ class Commande extends CommonOrder } else { - $this->error=$mouvP->error; - foreach($this->errors as $errmsg) { dol_syslog(get_class($this)."::cancel ".$errmsg, LOG_ERR); @@ -812,12 +808,10 @@ class Commande extends CommonOrder if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_CREATE',$user); + if ($result < 0) $error++; + // End call triggers } if (!$error) { @@ -909,12 +903,10 @@ class Commande extends CommonOrder if ($reshook < 0) $error++; } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_CLONE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_CLONE',$user); + if ($result < 0) $error++; + // End call triggers } // End @@ -2228,14 +2220,10 @@ class Commande extends CommonOrder dol_syslog(get_class($this)."::classifyBilled", LOG_DEBUG); if ($this->db->query($sql)) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_CLASSIFY_BILLED',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_CLASSIFY_BILLED',$user); + if ($result < 0) $error++; + // End call triggers if (! $error) { @@ -2247,8 +2235,6 @@ class Commande extends CommonOrder } else { - $this->error=$this->db->error(); - foreach($this->errors as $errmsg) { dol_syslog(get_class($this)."::classifyBilled ".$errmsg, LOG_ERR); @@ -2453,16 +2439,13 @@ class Commande extends CommonOrder if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } + //TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail if (! $error) { // Delete order details @@ -2471,6 +2454,7 @@ class Commande extends CommonOrder if (! $this->db->query($sql) ) { $error++; + $this->errors[]=$this->db->lasterror(); } // Delete order @@ -2479,6 +2463,7 @@ class Commande extends CommonOrder if (! $this->db->query($sql) ) { $error++; + $this->errors[]=$this->db->lasterror(); } // Delete linked object @@ -2538,7 +2523,6 @@ class Commande extends CommonOrder } else { - $this->error=$this->db->lasterror(); foreach($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -3197,12 +3181,10 @@ class OrderLine extends CommonOrderLine } } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEORDER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEORDER_DELETE',$user); + if ($result < 0) $error++; + // End call triggers if (!$error) { $this->db->commit(); @@ -3322,12 +3304,10 @@ class OrderLine extends CommonOrderLine if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEORDER_INSERT',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEORDER_INSERT',$user); + if ($result < 0) $error++; + // End call triggers } if (!$error) { @@ -3439,12 +3419,10 @@ class OrderLine extends CommonOrderLine if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINEORDER_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEORDER_UPDATE',$user); + if ($result < 0) $error++; + // End call triggers } if (!$error) { From bbe400e01f13c7c7a93bcf2bebd8b65e859e0311 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 11 Jul 2014 14:21:36 +0200 Subject: [PATCH 191/502] Update box_actions.php Add popup action feature on homepage --- htdocs/core/boxes/box_actions.php | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 9dcfc76016a..ae138ae1422 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2014 Charles-Fr BENKE * * 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 @@ -151,7 +152,70 @@ class box_actions extends ModeleBoxes */ function showBox($head = null, $contents = null) { + global $langs, $conf; parent::showBox($this->info_box_head, $this->info_box_contents); + if ($conf->global->SHOW_DIALOG_HOMEPAGE) + { + $actioncejour=false; + $contents=$this->info_box_contents; + $nblines=count($contents); + $bcx[0] = 'class="box_pair"'; + $bcx[1] = 'class="box_impair"'; + if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) + { + print '
trans("ActionsToDo").'">'; + print ''; + for ($i=0, $n=$nblines; $i < $n; $i++) + { + if (isset($contents[$i])) + { + // on affiche que les évènement du jours ou passé + // qui ne sont pas à 100% + $actioncejour=true; + $var=!$var; + // TR + $logo=$contents[$i][0]['logo']; + $label=$contents[$i][1]['text']; + $urlevent=$contents[$i][1]['url']; + $logosoc=$contents[$i][2]['logo']; + $nomsoc=$contents[$i][3]['text']; + $urlsoc=$contents[$i][3]['url']; + $dateligne=$contents[$i][4]['text']; + $percentage=$contents[$i][5]['text']; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + } + print '
'; + print img_object("",$logo); + print ''.$label.''.img_object("",$logosoc)." ".$nomsoc.''.$dateligne.''.$percentage.'
'; + + } + print '
'; + if ($actioncejour) + { + print ''; + } + else + { + print ''; + } + } } } From fc61cc9bfa7905dca483accf0508001c1c698dca Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 14:36:13 +0200 Subject: [PATCH 192/502] Refactor: BILL_* and LINEBILL_* trigger --- ChangeLog | 3 +- htdocs/compta/facture/class/facture.class.php | 164 +++++++----------- 2 files changed, 61 insertions(+), 106 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a853809489..6b9acc71682 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,7 +42,8 @@ For developers: - New: Add hook "searchAgendaFrom". - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. -- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. +- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. +- LINEBILL_DELETE trigger called before SQL delete in facturedet WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1cfb5fe3725..7e5af441280 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -482,14 +482,10 @@ class Facture extends CommonInvoice } else if ($reshook < 0) $error++; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_CREATE',$user); + if ($result < 0) $error++; + // End call triggers if (! $error) { @@ -655,14 +651,10 @@ class Facture extends CommonInvoice if ($reshook < 0) $error++; } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_CLONE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_CLONE',$user); + if ($result < 0) $error++; + // End call triggers } // End @@ -1100,14 +1092,10 @@ class Facture extends CommonInvoice { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End call triggers + // Call trigger + $result=$this->call_trigger('BILL_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers } } @@ -1262,14 +1250,10 @@ class Facture extends CommonInvoice if (! $error && ! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } // Removed extrafields @@ -1403,7 +1387,6 @@ class Facture extends CommonInvoice } else { - $this->error=$this->db->lasterror(); $this->db->rollback(); return -2; } @@ -1439,14 +1422,10 @@ class Facture extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_PAYED',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_PAYED',$user); + if ($result < 0) $error++; + // End call triggers } else { @@ -1495,14 +1474,10 @@ class Facture extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_UNPAYED',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_UNPAYED',$user); + if ($result < 0) $error++; + // End call triggers } else { @@ -1562,18 +1537,14 @@ class Facture extends CommonInvoice $resql=$this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_CANCEL',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; - $this->errors=$interface->errors; + // Call trigger + $result=$this->call_trigger('BILL_CANCEL',$user); + if ($result < 0) + { $this->db->rollback(); return -1; - } - // Fin appel triggers + // End call triggers $this->db->commit(); return 1; @@ -1791,14 +1762,11 @@ class Facture extends CommonInvoice // Trigger calls if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_VALIDATE',$user); + if ($result < 0) $error++; + //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail + // End call triggers } } else @@ -1872,17 +1840,15 @@ class Facture extends CommonInvoice $old_statut=$this->statut; $this->brouillon = 1; $this->statut = 0; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_UNVALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { + // Call trigger + $result=$this->call_trigger('BILL_UNVALIDATE',$user); + if ($result < 0) + { $error++; - $this->errors=$interface->errors; $this->statut=$old_statut; $this->brouillon=0; } - // Fin appel triggers + // End call triggers } else { $this->db->rollback(); return -1; @@ -3567,18 +3533,14 @@ class FactureLigne extends CommonInvoiceLine if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINEBILL_INSERT',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; - $this->errors=$interface->errors; + // Call trigger + $result=$this->call_trigger('LINEBILL_INSERT',$user); + if ($result < 0) + { $this->db->rollback(); return -2; } - // Fin appel triggers + // End call triggers } $this->db->commit(); @@ -3683,18 +3645,14 @@ class FactureLigne extends CommonInvoiceLine if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINEBILL_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; - $this->errors=$interface->errors; + // Call trigger + $result=$this->call_trigger('LINEBILL_UPDATE',$user); + if ($result < 0) + { $this->db->rollback(); return -2; } - // Fin appel triggers + // End call triggers } $this->db->commit(); return 1; @@ -3719,26 +3677,22 @@ class FactureLigne extends CommonInvoiceLine $error=0; $this->db->begin(); + + // Call trigger + $result=$this->call_trigger('LINEBILL_DELETE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql) ) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINEBILL_DELETE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; - $this->errors=$interface->errors; - $this->db->rollback(); - return -1; - } - // Fin appel triggers - $this->db->commit(); - return 1; } else From c1a004106deb74317d06da53079a3fa077b6b915 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 14:47:44 +0200 Subject: [PATCH 193/502] Refactor: LOCALTAXE_* trigger --- .../compta/localtax/class/localtax.class.php | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index c8766387cd0..72ce346abad 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -104,13 +104,13 @@ class Localtax extends CommonObject { $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 + // Call trigger + $result=$this->call_trigger('LOCALTAX_CREATE',$user); + if ($result < 0) $error++; + // End call triggers + //FIXME: Add rollback if trigger fail + return $this->id; } else @@ -165,12 +165,12 @@ class Localtax extends CommonObject 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 + // Call trigger + $result=$this->call_trigger('LOCALTAX_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + + //FIXME: Add rollback if trigger fail } return 1; @@ -253,6 +253,12 @@ class Localtax extends CommonObject $error=0; + // Call trigger + $result=$this->call_trigger('LOCALTAX_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax"; $sql.= " WHERE rowid=".$this->id; @@ -264,12 +270,6 @@ class Localtax extends CommonObject 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; } From a7afb5bdae384d62f735754b081c8af742809e99 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 14:54:32 +0200 Subject: [PATCH 194/502] Refactor: PAIEMENT_SALARY_* trigger --- .../salaries/class/paymentsalary.class.php | 56 +++++++------------ 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index c2fc0c9c23a..234b70d84b9 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -124,14 +124,12 @@ class PaymentSalary extends CommonObject if (! $notrigger) { - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_SALARY_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End triggers + // Call trigger + $result=$this->call_trigger('PAYMENT_SALARY_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + + //FIXME: Add rollback if trigger fail } return 1; @@ -224,6 +222,12 @@ class PaymentSalary extends CommonObject global $conf, $langs; $error=0; + + // Call trigger + $result=$this->call_trigger('PAYMENT_SALARY_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary"; $sql.= " WHERE rowid=".$this->id; @@ -236,15 +240,6 @@ class PaymentSalary extends CommonObject return -1; } - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_SALARY_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End triggers - return 1; } @@ -428,34 +423,21 @@ class PaymentSalary extends CommonObject } } - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_SALARY_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End triggers - + // Call trigger + $result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user); + if ($result < 0) $ok=0; + // End call triggers + } else $ok=0; if ($ok) { - if ($ok) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -3; - } + $this->db->commit(); + return $this->id; } else { - $this->error=$this->db->error(); $this->db->rollback(); return -2; } From 971ae8ae599f67b1f3fc2610ae69cc37fc9865cd Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 15:01:51 +0200 Subject: [PATCH 195/502] Refactor: TVA_* trigger --- htdocs/compta/tva/class/tva.class.php | 54 +++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index b19c1cf627d..312da55f138 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -121,13 +121,12 @@ class Tva extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TVA_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End triggers + // Call trigger + $result=$this->call_trigger('TVA_CREATE',$user); + if ($result < 0) $error++; + // End call triggers + //FIXME: Add rollback if trigger fail return $this->id; } else @@ -187,12 +186,12 @@ class Tva extends CommonObject if (! $notrigger) { - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TVA_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End triggers + // Call trigger + $result=$this->call_trigger('TVA_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + + //FIXME: Add rollback if trigger fail } return 1; @@ -279,7 +278,12 @@ class Tva extends CommonObject global $conf, $langs; $error=0; - + + // Call trigger + $result=$this->call_trigger('TVA_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql.= " WHERE rowid=".$this->id; @@ -291,12 +295,6 @@ class Tva extends CommonObject return -1; } - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TVA_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End triggers return 1; } @@ -541,13 +539,16 @@ class Tva extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called paiementtva - // Start triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('TVA_ADDPAYMENT',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End triggers - + // Call trigger + //XXX: Should be done just befor commit no ? + $result=$this->call_trigger('TVA_ADDPAYMENT',$user); + if ($result < 0) + { + $this->id = 0; + $ok = 0; + } + // End call triggers + if ($this->id > 0) { $ok=1; @@ -595,7 +596,6 @@ class Tva extends CommonObject } else { - $this->error=$this->db->error(); $this->db->rollback(); return -2; } From b8499a80ecd0c57da2e33b2bdc9447918e6b6321 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 15:08:01 +0200 Subject: [PATCH 196/502] Refactor: LINK_* trigger --- ChangeLog | 3 ++- htdocs/core/class/link.class.php | 43 ++++++++++---------------------- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b9acc71682..cf42b44558b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,7 +43,8 @@ For developers: - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. - Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. -- LINEBILL_DELETE trigger called before SQL delete in facturedet +- LINEBILL_DELETE trigger called before SQL delete in facturedet +- LINK_DELETE trigger called before SQL delete WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 4316d56f4fe..0c7d52f9569 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -99,15 +99,10 @@ class Link extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "links"); if ($this->id > 0) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINK_CREATE', $this, $user, $langs, $conf); - if ($result < 0) { - $error++; - $this->errors = $interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINK_CREATE',$user); + if ($result < 0) $error++; + // End call triggers } else { $error++; } @@ -190,15 +185,10 @@ class Link extends CommonObject { if ($call_trigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface = new Interfaces($this->db); - $result = $interface->run_triggers('LINK_MODIFY', $this, $user, $langs, $conf); - if ($result < 0) { - $error++; - $this->errors = $interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINK_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -339,6 +329,11 @@ class Link extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $error = 0; + // Call trigger + $result=$this->call_trigger('LINK_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + $this->db->begin(); // Remove link @@ -353,18 +348,6 @@ class Link extends CommonObject } - if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINK_DELETE', $this, $user, $langs, $conf); - if ($result < 0) { - $error++; - $this->errors = $interface->errors; - } - // Fin appel triggers - } - if (! $error) { $this->db->commit(); From bbdaa5992119a1a1fe1bcf784b44d5a51393f7fe Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 15:32:23 +0200 Subject: [PATCH 197/502] Refactor: ORDER_SUPPLIER_* and LINEORDER_SUPPLIER_* trigger --- ChangeLog | 3 +- .../class/fournisseur.commande.class.php | 138 +++++++----------- 2 files changed, 53 insertions(+), 88 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf42b44558b..bf5b4e23044 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,8 +43,7 @@ For developers: - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. - Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. -- LINEBILL_DELETE trigger called before SQL delete in facturedet -- LINK_DELETE trigger called before SQL delete +- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE trigger called before SQL delete WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 19432c09b78..147cf2c39e2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -388,18 +388,14 @@ class CommandeFournisseur extends CommonOrder if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_VALIDATE',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } if (! $error) @@ -653,12 +649,10 @@ class CommandeFournisseur extends CommonOrder if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_APPROVE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_APPROVE',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -714,17 +708,16 @@ class CommandeFournisseur extends CommonOrder if ($error == 0) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_REFUSE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_REFUSE',$user); + if ($result < 0) { $error++; - $this->errors=$interface->errors; $this->db->rollback(); } - // Fin appel triggers + else + $this->db->commit(); + // End call triggers } } else @@ -772,12 +765,10 @@ class CommandeFournisseur extends CommonOrder $result = 0; $this->log($user, $statut, time()); - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_CANCEL',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_CANCEL',$user); + if ($result < 0) $error++; + // End call triggers if ($error == 0) { @@ -967,18 +958,14 @@ class CommandeFournisseur extends CommonOrder if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_CREATE',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } $this->db->commit(); @@ -1041,12 +1028,10 @@ class CommandeFournisseur extends CommonOrder if ($reshook < 0) $error++; } - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_CLONE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_CLONE',$user); + if ($result < 0) $error++; + // End call triggers } // End @@ -1222,18 +1207,14 @@ class CommandeFournisseur extends CommonOrder if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('LINEORDER_SUPPLIER_CREATE',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } $this->update_price('','auto'); @@ -1295,18 +1276,14 @@ class CommandeFournisseur extends CommonOrder if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('LINEORDER_SUPPLIER_DISPATCH',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } $this->db->commit(); @@ -1369,15 +1346,10 @@ class CommandeFournisseur extends CommonOrder if (! $notrigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $result = 0; - $interface=new Interfaces($this->db); - $result = $interface->run_triggers('LINEORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEORDER_SUPPLIER_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -1424,6 +1396,16 @@ class CommandeFournisseur extends CommonOrder require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error = 0; + + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user); + if ($result < 0) + { + dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); + return -1; + } + // End call triggers + $this->db->begin(); @@ -1461,18 +1443,6 @@ class CommandeFournisseur extends CommonOrder } } - if (! $error) - { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('ORDER_SUPPLIER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - } - if (! $error) { // We remove directory @@ -1828,18 +1798,14 @@ class CommandeFournisseur extends CommonOrder if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEORDER_SUPPLIER_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('LINEORDER_SUPPLIER_UPDATE',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } // Mise a jour info denormalisees au niveau facture From 42ef7149fd2465586a0ef8b6b0667f17b5dda80b Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 15:48:25 +0200 Subject: [PATCH 198/502] Refactor: BILL_SUPPLIER_* and LINEBILL_SUPPLIER_* trigger --- .../fourn/class/fournisseur.facture.class.php | 97 +++++++------------ 1 file changed, 36 insertions(+), 61 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b01e3ee7891..9feb52a5417 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -254,12 +254,10 @@ class FactureFournisseur extends CommonInvoice $result=$this->update_price(); if ($result > 0) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_CREATE',$user); + if ($result < 0) $error++; + // End call triggers if (! $error) { @@ -601,11 +599,9 @@ class FactureFournisseur extends CommonInvoice { if (! $notrigger) { - // Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('BILL_SUPPLIER_MODIFY',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + //$result=$this->call_trigger('BILL_SUPPLIER_MODIFY',$user); + //if ($result < 0) $error++; // End call triggers } } @@ -673,13 +669,10 @@ class FactureFournisseur extends CommonInvoice if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_SUPPLIER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; - $this->errors=$interface->errors; + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_DELETE',$user); + if ($result < 0) + { $this->db->rollback(); return -1; } @@ -771,12 +764,10 @@ class FactureFournisseur extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_SUPPLIER_PAYED',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_PAYED',$user); + if ($result < 0) $error++; + // End call triggers } else { @@ -821,12 +812,10 @@ class FactureFournisseur extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_SUPPLIER_UNPAYED',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_UNPAYED',$user); + if ($result < 0) $error++; + // End call triggers } else { @@ -962,12 +951,10 @@ class FactureFournisseur extends CommonInvoice // Triggers call if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('BILL_SUPPLIER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_VALIDATE',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -1129,18 +1116,14 @@ class FactureFournisseur extends CommonInvoice if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEBILL_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) + // Call trigger + $result=$this->call_trigger('LINEBILL_SUPPLIER_CREATE',$user); + if ($result < 0) { - $error++; - $this->errors=$interface->errors; $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } $this->db->commit(); @@ -1263,18 +1246,14 @@ class FactureFournisseur extends CommonInvoice if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEBILL_SUPPLIER_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; - $this->errors=$interface->errors; + // Call trigger + $result=$this->call_trigger('LINEBILL_SUPPLIER_UPDATE',$user); + if ($result < 0) + { $this->db->rollback(); return -1; } - // Fin appel triggers + // End call triggers } // Update total price into invoice record @@ -1312,14 +1291,10 @@ class FactureFournisseur extends CommonInvoice if (! $error && ! $notrigger) { - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('LINEBILL_SUPPLIER_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('LINEBILL_SUPPLIER_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) From 5093fecc6045cf6458c023347be975f55ec46899 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 15:50:40 +0200 Subject: [PATCH 199/502] Refactor: SUPPLIER_PRODUCT_BUYPRICE_ * trigger --- .../fourn/class/fournisseur.product.class.php | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index a384f6ea219..b9cd7f40163 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -203,14 +203,10 @@ class ProductFournisseur extends Product $resql = $this->db->query($sql); if ($resql) { - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('SUPPLIER_PRODUCT_BUYPRICE_UPDATE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; $this->error=$interface->errors; - } + // Call trigger + $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_UPDATE',$user); + if ($result < 0) $error++; + // End call triggers if (empty($error)) { @@ -289,14 +285,10 @@ class ProductFournisseur extends Product if (! $error) { - // Appel des triggers - include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('SUPPLIER_PRODUCT_BUYPRICE_CREATE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; $this->error=$interface->errors; - } + // Call trigger + $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_CREATE',$user); + if ($result < 0) $error++; + // End call triggers if (empty($error)) { From 5e7c0639b0aa00d0d0c4cda3283819c94517103e Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 16:02:27 +0200 Subject: [PATCH 200/502] Refactor: various trigger --- htdocs/fourn/class/paiementfourn.class.php | 10 ++++------ htdocs/fourn/commande/dispatch.php | 9 +++------ htdocs/imports/class/import.class.php | 10 ++++------ .../class/opensurveysondage.class.php | 20 ++++++++----------- .../stock/class/mouvementstock.class.php | 12 +++++------ 5 files changed, 25 insertions(+), 36 deletions(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 6fff76e2ca0..02010d1e2e8 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -201,12 +201,10 @@ class PaiementFourn extends Paiement if (! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PAYMENT_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('PAYMENT_SUPPLIER_CREATE',$user); + if ($result < 0) $error++; + // End call triggers } } else diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 02666e1c855..bea467340e6 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -120,12 +120,9 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece if (! $notrigger) { global $conf, $langs, $user; - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result_trigger=$interface->run_triggers('ORDER_SUPPLIER_DISPATCH',$commande,$user,$langs,$conf); - if ($result_trigger < 0) { $error++; $commande->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$commande->call_trigger('ORDER_SUPPLIER_DISPATCH',$user); + // End call triggers } if ($result > 0) diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index e4acc733a85..58a1bf3e931 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -313,12 +313,10 @@ class Import { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('IMPORT_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End call triggers + // Call trigger + $result=$this->call_trigger('IMPORT_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } } diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 8f3f3fccff8..58351527e6e 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -142,12 +142,10 @@ class Opensurveysondage extends CommonObject { global $langs, $conf; - //// Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('OPENSURVEY_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers + // Call trigger + $result=$this->call_trigger('OPENSURVEY_CREATE',$user); + if ($result < 0) $error++; + // End call triggers } } @@ -338,12 +336,10 @@ class Opensurveysondage extends CommonObject { if (! $notrigger) { - //// Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('OPENSURVEY_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - //// End call triggers + // Call trigger + $result=$this->call_trigger('OPENSURVEY_DELETE',$user); + if ($result < 0) $error++; + // End call triggers } } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 747a737f389..8219da2b814 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -245,17 +245,17 @@ class MouvementStock if ($movestock && ! $error) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); $this->product_id = $fk_product; $this->entrepot_id = $entrepot_id; $this->qty = $qty; - $result=$interface->run_triggers('STOCK_MOVEMENT',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('STOCK_MOVEMENT',$user); + if ($result < 0) $error++; + // End call triggers + + //FIXME: Restore previous value of product_id, entrepot_id, qty if trigger fail } if (! $error) From ca97c0bef3f271896c5cd7418fead986854bed75 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 16:06:06 +0200 Subject: [PATCH 201/502] Refactor: RESOURCE_* trigger --- ChangeLog | 2 +- htdocs/resource/class/resource.class.php | 35 +++++++++--------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf5b4e23044..4a745ca0e9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,7 +43,7 @@ For developers: - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. - Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. -- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE trigger called before SQL delete +- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 22ae2f36bde..f9eacda124a 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -331,7 +331,15 @@ class Resource extends CommonObject global $user,$langs,$conf; $error=0; - + + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('RESOURCE_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + } + $sql = "DELETE FROM ".MAIN_DB_PREFIX."resource"; $sql.= " WHERE rowid =".$rowid; @@ -343,18 +351,6 @@ class Resource extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql)) { - if (! $notrigger) - { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('RESOURCE_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // End call triggers - } - return 1; } else { @@ -734,15 +730,10 @@ class Resource extends CommonObject { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('RESOURCE_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End call triggers + // Call trigger + $result=$this->call_trigger('RESOURCE_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers } } From 2d8fee8adb3819b3710fe1fbde664a818dbc7121 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 16:09:07 +0200 Subject: [PATCH 202/502] Refactor: COMPANY_* trigger --- htdocs/societe/class/societe.class.php | 33 ++++++++++---------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2b519a686cd..814ed4832b3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -441,12 +441,10 @@ class Societe extends CommonObject if ($ret >= 0) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('COMPANY_CREATE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('COMPANY_CREATE',$user); + if ($result < 0) $error++; + // End call triggers } else $error++; @@ -879,12 +877,10 @@ class Societe extends CommonObject if (! $error && $call_trigger) { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('COMPANY_MODIFY',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // Call trigger + $result=$this->call_trigger('COMPANY_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers } if (! $error) @@ -1247,15 +1243,10 @@ class Societe extends CommonObject { $this->db->begin(); - if (! $error) - { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('COMPANY_DELETE',$this,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - } + // Call trigger + $result=$this->call_trigger('COMPANY_DELETE',$user); + if ($result < 0) $error++; + // End call triggers if (! $error) { From 33f293ae195e482e148eec67b67b8bde6443926c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 11 Jul 2014 16:12:31 +0200 Subject: [PATCH 203/502] Use good translation --- htdocs/contrat/fiche.php | 7 ++++--- htdocs/contrat/liste.php | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 51c1202318d..4110f700855 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -47,6 +47,7 @@ $langs->load("orders"); $langs->load("companies"); $langs->load("bills"); $langs->load("products"); +$langs->load('compta'); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); @@ -876,7 +877,7 @@ if ($action == 'create') print ''.$langs->trans('Ref').''.$langs->trans("Draft").''; // Ref Int - print ''.$langs->trans('ExternalRef').''; + print ''.$langs->trans('RefExt').''; print ''; // Customer @@ -1068,9 +1069,9 @@ else print ''; print ''; - print $form->editfieldkey("ExternalRef",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); + print $form->editfieldkey("RefExt",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); print ''; - print $form->editfieldval("ExternalRef",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); + print $form->editfieldval("RefExt",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); print ''; print ''; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index a13cfc8652a..58701a49d2e 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -30,6 +30,7 @@ require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); $langs->load("contracts"); $langs->load("products"); $langs->load("companies"); +$langs->load("compta"); $sortfield=GETPOST('sortfield','alpha'); $sortorder=GETPOST('sortorder','alpha'); @@ -114,7 +115,7 @@ if ($resql) $param.='&search_nom='.$search_nom; $param.='&search_ref_ext='.$search_ref_ext; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExternalRef"), $_SERVER["PHP_SELF"], "c.ref_ext","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefExt"), $_SERVER["PHP_SELF"], "c.ref_ext","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); From f1ef8b8faadc9224eac08d44fe89b598f5e3c139 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Jul 2014 17:34:01 +0200 Subject: [PATCH 204/502] Comment entries --- htdocs/install/mysql/data/llx_c_typent.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_typent.sql b/htdocs/install/mysql/data/llx_c_typent.sql index 8349cd13a5a..7912f1fdab2 100644 --- a/htdocs/install/mysql/data/llx_c_typent.sql +++ b/htdocs/install/mysql/data/llx_c_typent.sql @@ -41,5 +41,6 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WH insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1); -insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A1', 'Type A', 23, 1); -insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B2', 'Type B', 23, 1); +--insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 1); +--insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 1); +--insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 1); From 2766b1d8f153f20425ac22a12e65301577641ce1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Jul 2014 17:43:57 +0200 Subject: [PATCH 205/502] Add record for argentina but disabled by default. --- htdocs/install/mysql/data/llx_c_typent.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_typent.sql b/htdocs/install/mysql/data/llx_c_typent.sql index 7912f1fdab2..918230cc5a3 100644 --- a/htdocs/install/mysql/data/llx_c_typent.sql +++ b/htdocs/install/mysql/data/llx_c_typent.sql @@ -41,6 +41,6 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WH insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0); insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1); insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1); ---insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 1); ---insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 1); ---insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 1); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0); +insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0); From 78ce6c0b1cf25fe75f8920e951dbe56d79960eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 11 Jul 2014 19:57:51 +0200 Subject: [PATCH 206/502] Added labels on form elements for company creation --- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/societe/soc.php | 137 +++++++++++-------- 2 files changed, 82 insertions(+), 57 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 7728080c01b..6f868dd81c8 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -453,7 +453,7 @@ class FormCompany if ($resql) { $out.= '
'; - $out.= ''; if ($country_codeid) $out.= ''; $num = $this->db->num_rows($resql); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a0eec6ffbc8..1308ba24f52 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -772,11 +772,15 @@ else print '
'; print $langs->trans("ThirdPartyType").':     '; print '
'; - print ' '.$langs->trans("Company/Fundation"); + print ''; + print ''; print '     '; - print ' '.$langs->trans("Individual"); + print ''; + print ' '; + print $langs->trans("Individual"); print ' ('.$langs->trans("ToCreateContactWithSameName").')'; print '
'; print "
\n"; @@ -800,7 +804,10 @@ else // Name, firstname if ($object->particulier || $private) { - print ''.$langs->trans('LastName').'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print ''; + print ''; + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''.$langs->trans('Prefix').''; @@ -809,8 +816,11 @@ else } else { - print ''.$langs->trans('ThirdPartyName').'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + print ''; + print ''; + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field1 { print ''.$langs->trans('Prefix').''; } @@ -819,9 +829,10 @@ else // If javascript on, we show option individual if ($conf->use_javascript_ajax) { - print ''.$langs->trans('FirstName').''; + print ''; + print ''; print ' '; - print ''.$langs->trans("UserTitle").''; + print ''; print $formcompany->select_civility($object->civility_id).''; print ' '; } @@ -835,11 +846,11 @@ else print ''; print ''; - print ''.$langs->trans('CustomerCode').''; + print ''; print ''; - print ''; print '
'; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); - print ''; + print ''; print ''; $s=$modCodeClient->getToolTip($langs,$object,0); print $form->textwithpicto('',$s,1); @@ -853,11 +864,11 @@ else print ''.$langs->trans('Supplier').''; print $form->selectyesno("fournisseur",(isset($_POST['fournisseur'])?GETPOST('fournisseur'):$object->fournisseur),1); print ''.$langs->trans('SupplierCode').''; + print ''; print ''; + print ''; } @@ -883,40 +895,44 @@ else print ''; // Zip / Town - print ''; // Country - print ''; // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } // Email web - print ''; + print ''; + print ''; print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; + print ''; } // Phone / Fax - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // Prof ids $i=1; $j=0; @@ -948,9 +964,9 @@ else print ''; - print ''; + print ''; print ''; // Legal Form - print ''; + print ''; print ''; // Capital - print ''; + print ''; // Local Taxes @@ -1037,7 +1054,7 @@ else */ if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1047,7 +1064,7 @@ else { // Assign a Name print ''; - print ''; + print ''; print ''; @@ -1063,7 +1080,7 @@ else // Ajout du logo print ''; - print ''; + print ''; print ''; @@ -1257,12 +1274,13 @@ else print '
'; $tmpcode=$object->code_fournisseur; if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1); - print ''; + print ''; print ''; $s=$modCodeFournisseur->getToolTip($langs,$object,1); print $form->textwithpicto('',$s,1); @@ -873,7 +884,8 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
'.$langs->trans('Gencod').''; + print '
'; print '
'.$langs->trans('Zip').''; + print '
'; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); - print ''.$langs->trans('Town').''; + print ''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans('Country').''; - print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); + print '
'; + print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; - if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code,'state_id'); + print '
'; + if ($object->country_id) print $formcompany->select_state($object->state_id,$object->country_code); else print $countrynotdefined; print '
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print ''.$langs->trans('VATIntra').''; - $s = ''; + $s = ''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) { @@ -988,7 +1004,7 @@ else print '
'.$langs->trans('JuridicalStatus').'
'; if ($object->country_id) { @@ -1001,7 +1017,8 @@ else print '
'.$langs->trans('Capital').' '; + print '
'; print ''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("DefaultLang").''."\n"; + print '
'."\n"; print $formadmin->select_language(($object->default_lang?$object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1); print '
'.$langs->trans("AllocateCommercial").''; $form->select_users((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default print '
'.$langs->trans("Logo").''; print ''; print '
'; // Name - print ''; + print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { - print ''; } @@ -1283,18 +1301,18 @@ else if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print ''; print ''; print ''; - print ''; + print ''; print '
'.$langs->trans('ThirdPartyName').'
'.$langs->trans("Prefix").''; + print '
'; // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { @@ -1271,7 +1289,7 @@ else } else { - print ''; + print ''; } print ''.$langs->trans('CustomerCode').''; + print ''; print ''; - print '"; + print ""; print '\n"; $var=!$var; - print ""; + print ""; print '\n"; @@ -589,20 +589,20 @@ if ($action == 'edit' || $action == 'updateedit') $var=true; $var=!$var; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print ''; /*print ''; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index f618581aecd..241d440cc0f 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -88,7 +88,7 @@ class FormResource if ($resourcestat) { - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); From b57371bfa1b3fb6c81095ba46f3f60937fe45aa1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jul 2014 20:21:01 +0200 Subject: [PATCH 348/502] Fix: New: Differentiate text and img for better accessibility. --- ChangeLog | 1 + htdocs/core/boxes/modules_boxes.php | 4 +-- htdocs/core/lib/functions.lib.php | 54 ++++++++++++++++------------- htdocs/index.php | 2 +- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index f571064ce9c..97225bc21f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,7 @@ For users: - New: First changes for accessibility. - New: Home page of project area shows list of draft project (like other main page). - New: Can search on project ref or string from project main page (like other main page). +- New: Differentiate text and img for better accessibility. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 7b54f0440a0..b7333602bab 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -162,7 +162,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (! empty($head['sublink'])) print ''; if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['sublink'])) ''; - if ($conf->use_javascript_ajax) + if (! empty($conf->use_javascript_ajax)) { print ''."\n"; - foreach($cp->events as $infos_event) { - + foreach($cp->events as $infos_event) + { $var=!$var; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''; $i++; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 72c156c8f3e..17ed437c7a7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1403,6 +1403,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logintext.='>'.$user->login.''; if ($user->societe_id) $logintext.=$companylink; $logintext.=''; + $loginhtmltext.=''.$langs->trans("User").''; $loginhtmltext.='
'.$langs->trans("Name").': '.$user->getFullName($langs); $loginhtmltext.='
'.$langs->trans("Login").': '.$user->login; @@ -1436,7 +1437,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a } else $appli.=" ".DOL_VERSION; - // Link info $logouttext=''; $logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') @@ -1446,13 +1446,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logouttext .='trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); $logouttext .=''; } else { $logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode",$_SESSION["dol_authmode"]); - $logouttext .= img_picto($langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); } print '
'; if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto) { $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); - print ''; + print ''; } else if ($object->codeclient_modifiable()) { - print ''; + print ''; } else { @@ -1315,18 +1333,18 @@ else print ''.$langs->trans('Supplier').''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''.$langs->trans('SupplierCode').''; + print ''; print ''; + print ''; } @@ -1359,14 +1378,14 @@ else print ''; // Zip / Town - print ''; // Country - print ''; @@ -1374,24 +1393,29 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } // EMail / Web - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; + print ''; } // Phone / Fax - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // Prof ids $i=1; $j=0; @@ -1424,9 +1448,9 @@ else print ''; // VAT Code - print ''; + print ''; print ''; - print ''; // Capital - print ''; + print ''; + print ''; // Default language if (! empty($conf->global->MAIN_MULTILANGS)) { - print ''; print ''; @@ -1539,7 +1564,7 @@ else // Logo print ''; - print ''; + print ''; print ''; print "
'; if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) { $tmpcode=$object->code_fournisseur; if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1); - print ''; + print ''; } else if ($object->codefournisseur_modifiable()) { - print ''; + print ''; } else { @@ -1344,7 +1362,8 @@ else // Barcode if (! empty($conf->barcode->enabled)) { - print '
'.$langs->trans('Gencod').''; + print '
'; print '
'.$langs->trans('Zip').''; + print '
'; print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); - print ''.$langs->trans('Town').''; + print ''; print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans('Country').''; + print '
'; print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; + print '
'; print $formcompany->select_state($object->state_id,$object->country_code); print '
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'.$langs->trans('VATIntra').''; - $s =''; + $s =''; if (empty($conf->global->MAIN_DISABLEVATCHECK)) { @@ -1513,17 +1537,18 @@ else if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('JuridicalStatus').''; + print '
'; print $formcompany->select_juridicalstatus($object->forme_juridique_code,$object->country_code); print '
'.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("DefaultLang").''."\n"; + print '
'."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); print '
'.$langs->trans("Logo").''; if ($object->logo) print $form->showphoto('societe',$object,50); $caneditfield=1; From 8a3fbf953316eb0604d74074bd21a41c6c322427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 11 Jul 2014 20:04:18 +0200 Subject: [PATCH 207/502] Mutualized common code --- htdocs/societe/soc.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 1308ba24f52..aad647ec649 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -802,30 +802,23 @@ else print ''; // Name, firstname + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - print ''; } else { - print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field1 - { - print ''; - } - print ''; } + print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; + print ''; + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + print ''; + // If javascript on, we show option individual if ($conf->use_javascript_ajax) { From 1ab938895b3b52cbbb4f4dfe0a9f488cf7d57b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 11 Jul 2014 20:05:45 +0200 Subject: [PATCH 208/502] Added autofocus to name on company creation --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index aad647ec649..f5c1237ef05 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -812,7 +812,7 @@ else print ''; } print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; + print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; From d27ec6306caac651f0f58a7f230cba7f85514211 Mon Sep 17 00:00:00 2001 From: juanjo Date: Fri, 11 Jul 2014 22:00:41 +0200 Subject: [PATCH 209/502] Update ChangeLog: Remove add_photo_web() --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 7c999a2dcd7..ee9b1c94490 100644 --- a/ChangeLog +++ b/ChangeLog @@ -162,6 +162,7 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f So check that return value is 0 to keep default standard behaviour after hook, or 1 to disable default standard behaviour. - Properties "civilite_id" were renamed into "civility_id". +- Remove add_photo_web() that is ot used anymore by core code. From ff19a8794164278e5e57ffbb5c511cb73c27ff9e Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 11 Jul 2014 23:40:17 +0200 Subject: [PATCH 210/502] [Task #1481] Enable BILL_SUPPLIER_MODIFY trigger --- ChangeLog | 1 + htdocs/fourn/class/fournisseur.facture.class.php | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee9b1c94490..3abb0d53fb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,7 @@ For developers: - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. - Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. +- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_MODIFY. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b01e3ee7891..323d8cb9c47 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -601,11 +601,9 @@ class FactureFournisseur extends CommonInvoice { if (! $notrigger) { - // Call triggers - //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - //$interface=new Interfaces($this->db); - //$result=$interface->run_triggers('BILL_SUPPLIER_MODIFY',$this,$user,$langs,$conf); - //if ($result < 0) { $error++; $this->errors=$interface->errors; } + // Call trigger + $result=$this->call_trigger('BILL_SUPPLIER_MODIFY',$user); + if ($result < 0) $error++; // End call triggers } } From 9c2aaf7d235453afbc01e8f5658d81d1b529ca2e Mon Sep 17 00:00:00 2001 From: KreizIT Date: Sat, 12 Jul 2014 00:27:33 +0200 Subject: [PATCH 211/502] [ Task #1495 ] Add trigger LINECONTRACT_CREATE --- ChangeLog | 3 +- htdocs/contrat/class/contrat.class.php | 48 +++++++++++-------- .../interface_90_all_Demo.class.php-NORUN | 8 ++++ .../fourn/class/fournisseur.facture.class.php | 2 +- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3abb0d53fb4..c0f3852d20c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,7 +47,8 @@ For developers: - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. - Qual: Removed hard coded rowid into data init of table llx_c_action_trigger. -- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_MODIFY. +- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE. +- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d07aebfebc7..7bf3ac6bc02 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -824,6 +824,11 @@ class Contrat extends CommonObject $error=0; $this->db->begin(); + + // Call trigger + $result=$this->call_trigger('CONTRACT_DELETE',$user); + if ($result < 0) { $error++; } + // End call triggers if (! $error) { @@ -909,14 +914,6 @@ class Contrat extends CommonObject } } - if (! $error) - { - // Call trigger - $result=$this->call_trigger('CONTRACT_DELETE',$user); - if ($result < 0) { $error++; } - // End call triggers - } - if (! $error) { // We remove directory @@ -1078,6 +1075,15 @@ class Contrat extends CommonObject $result=$this->update_statut($user); if ($result > 0) { + // Call trigger + $result=$this->call_trigger('LINECONTRACT_CREATE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + $this->db->commit(); return 1; } @@ -1222,6 +1228,15 @@ class Contrat extends CommonObject $result=$this->update_statut($user); if ($result >= 0) { + // Call trigger + $result=$this->call_trigger('LINECONTRACT_UPDATE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -3; + } + // End call triggers + $this->db->commit(); return 1; } @@ -1257,6 +1272,11 @@ class Contrat extends CommonObject if ($this->statut >= 0) { + // Call trigger + $result=$this->call_trigger('LINECONTRACT_DELETE',$user); + if ($result < 0) return -1; + // End call triggers + $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."contratdet"; @@ -1271,11 +1291,6 @@ class Contrat extends CommonObject return -1; } - // Call trigger - $result=$this->call_trigger('LINECONTRACT_DELETE',$user); - if ($result < 0) { $error++; $this->db->rollback(); return -1; } - // End call triggers - $this->db->commit(); return 1; } @@ -1734,13 +1749,8 @@ class Contrat extends CommonObject /** * Classe permettant la gestion des lignes de contrats */ -class ContratLigne +class ContratLigne extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - //var $element='contratdet'; //!< Id that identify managed objects - //var $table_element='contratdet'; //!< Name of table without prefix where object is stored var $id; var $ref; diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 8bc4e42ed3f..4b9d923de03 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -417,6 +417,10 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINECONTRACT_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } elseif ($action == 'LINECONTRACT_UPDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); @@ -484,6 +488,10 @@ class InterfaceDemo elseif ($action == 'BILL_SUPPLIER_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'BILL_SUPPLIER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } elseif ($action == 'BILL_SUPPLIER_DELETE') { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 323d8cb9c47..fe2c4230dd6 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -602,7 +602,7 @@ class FactureFournisseur extends CommonInvoice if (! $notrigger) { // Call trigger - $result=$this->call_trigger('BILL_SUPPLIER_MODIFY',$user); + $result=$this->call_trigger('BILL_SUPPLIER_UPDATE',$user); if ($result < 0) $error++; // End call triggers } From 893240ce213272dd06bb891514ed43a8c4416970 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 12 Jul 2014 09:48:10 +0200 Subject: [PATCH 212/502] Qual: Uniformize code. Errors --- .../salaries/class/paymentsalary.class.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 234b70d84b9..5e728b0cc64 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -1,19 +1,20 @@ + * Copyright (C) 2014 Juanjo Menent * -* 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 . -*/ + * 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 . + */ /** * \file htdocs/compta/salaries/class/paymentsalary.class.php @@ -278,6 +279,8 @@ class PaymentSalary extends CommonObject function create($user) { global $conf,$langs; + + $error=0; // Clean parameters $this->amount=price2num(trim($this->amount)); @@ -351,7 +354,6 @@ class PaymentSalary extends CommonObject $result = $this->db->query($sql); if ($result) { - $ok=1; $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary"); @@ -387,10 +389,10 @@ class PaymentSalary extends CommonObject else { $this->error=$acc->error; - $ok=0; + $error++; } - if ($ok) + if (! $error) { // Add link 'payment_salary' in bank_url between payment and bank transaction $url=DOL_URL_ROOT.'/compta/salaries/fiche.php?id='; @@ -399,7 +401,7 @@ class PaymentSalary extends CommonObject if ($result <= 0) { $this->error=$acc->error; - $ok=0; + $error++; } } @@ -419,19 +421,19 @@ class PaymentSalary extends CommonObject if ($result <= 0) { $this->error=$acc->error; - $ok=0; + $error++; } } // Call trigger $result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user); - if ($result < 0) $ok=0; + if ($result < 0) $error++; // End call triggers } - else $ok=0; + else $error++; - if ($ok) + if (! $error) { $this->db->commit(); return $this->id; From 494e5b20a5bd5c8ad2068c500049260580c9a921 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 12 Jul 2014 10:17:04 +0200 Subject: [PATCH 213/502] chnagelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 54737e4edd2..0621064fb3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,7 @@ For users: - Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action - Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message -- New: [ task #1204 ] add a ref_int contract field +- New: [ task #1204 ] add a External reference to contract For translators: - Update language files. From d02814192f16ecc70b0486b63f01905e3825eba5 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 12 Jul 2014 10:56:13 +0200 Subject: [PATCH 214/502] Qual: More intuitive if contract ref_ext we say ref. customer Visu: ref. customer is not required --- htdocs/contrat/fiche.php | 8 ++++---- htdocs/contrat/liste.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 4110f700855..e073566c55f 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * @@ -877,7 +877,7 @@ if ($action == 'create') print ''; // Ref Int - print ''; + print ''; print ''; // Customer @@ -1069,9 +1069,9 @@ else print ''; print ''; print ''; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 58701a49d2e..16586b9dd4c 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -115,7 +116,7 @@ if ($resql) $param.='&search_nom='.$search_nom; $param.='&search_ref_ext='.$search_ref_ext; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefExt"), $_SERVER["PHP_SELF"], "c.ref_ext","","$param",'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_ext","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); From f1853c435b99da33b54794dc293449acefff94ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 12 Jul 2014 12:04:39 +0200 Subject: [PATCH 215/502] More labels and autofocus for thirdparty and contact forms --- htdocs/contact/fiche.php | 114 +++++++++++-------- htdocs/core/class/html.formcompany.class.php | 4 +- htdocs/societe/soc.php | 77 +++++++------ 3 files changed, 112 insertions(+), 83 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 0d8a26cf81f..4f793fe8538 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -439,42 +439,45 @@ else print '
'; if ($object->particulier || $private) { - print '
'; print ''; - print ''.$langs->trans('Prefix').'
'; print ''; - print ''.$langs->trans('Prefix').'
'.$langs->trans('Prefix').'
'.$langs->trans('Prefix').'
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefExt').'
'.$langs->trans('RefCustomer').'
'; - print $form->editfieldkey("RefExt",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); + print $form->editfieldkey("RefCustomer",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); print ''; - print $form->editfieldval("RefExt",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); + print $form->editfieldval("RefCustomer",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer); print '
'; // Name - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { if ($socid > 0) { - print ''; + print ''; print ''; - print ''; + print ''; print ''; } else { - print ''; } } // Civility - print ''; - print ''; + print ''; + print ''; $colspan=3; if ($conf->use_javascript_ajax && $socid > 0) $colspan=2; // Address if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party - print ''; + print ''; + print ''; if ($conf->use_javascript_ajax && $socid > 0) { @@ -490,13 +493,13 @@ else // Zip / Town if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party - print ''; // Country - print ''; @@ -504,7 +507,7 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // EMail if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party - print ''; + print ''; + print ''; if (! empty($conf->mailing->enabled)) { - print ''; + print ''; + print ''; } else { @@ -539,16 +548,18 @@ else print ''; // Instant message and no email - print ''; + print ''; + print ''; // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; + print ''; } // Visibility - print ''; @@ -570,7 +581,7 @@ else print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").'lastname).'">'.$langs->trans("Firstname").'firstname).'">
lastname).'" autofocus="autofocus">firstname).'">
'.$langs->trans("Company").'
'; print $objsoc->getNomUrl(1); print '
'.$langs->trans("Company").''; + print '
'; print $form->select_company($socid,'socid','',1); print '
'.$langs->trans("UserTitle").''; + print '
'; print $formcompany->select_civility(GETPOST("civility_id",'alpha')?GETPOST("civility_id",'alpha'):$object->civility_id); print '
'.$langs->trans("PostOrFunction").'poste).'">
poste).'">
'.$langs->trans("Address"); - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
/ '; print $formcompany->select_ziptown((GETPOST("zipcode")?GETPOST("zipcode"):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((GETPOST("town")?GETPOST("town"):$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").''; + print '
'; print $form->select_country((GETPOST("country_id",'alpha')?GETPOST("country_id",'alpha'):$object->country_id),'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; + print '
'; if ($object->country_id) { print $formcompany->select_state(GETPOST("state_id",'alpha')?GETPOST("state_id",'alpha'):$object->state_id,$object->country_code,'state_id'); @@ -518,19 +521,25 @@ else // Phone / Fax if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party - print '
'.$langs->trans("PhonePro").'phone_pro).'">'.$langs->trans("PhonePerso").'phone_perso).'">
phone_pro).'">phone_perso).'">
'.$langs->trans("PhoneMobile").'phone_mobile).'">'.$langs->trans("Fax").'fax).'">
phone_mobile).'">fax).'">
'.$langs->trans("Email").'email).'">
email).'">'.$langs->trans("No_Email").''.$form->selectyesno('no_email',(GETPOST("no_email",'alpha')?GETPOST("no_email",'alpha'):$object->no_email), 1).''.$form->selectyesno('no_email',(GETPOST("no_email",'alpha')?GETPOST("no_email",'alpha'):$object->no_email), 1).'
'.$langs->trans("IM").'jabberid).'">
jabberid).'">
'.$langs->trans("Skype").'skype).'">
skype).'">
'.$langs->trans("ContactVisibility").''; + print '
'; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,(GETPOST("priv",'alpha')?GETPOST("priv",'alpha'):$object->priv),0); print '
'; // Date To Birth - print ''; - print ''; + print ''; } else { - print ''; + print ''; } print ''; @@ -664,13 +675,15 @@ else print ''; // Lastname - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''; + print ''; print ''; @@ -678,15 +691,16 @@ else } // Civility - print ''; - print ''; + print ''; + print ''; // Address - print ''; + print ''; + print ''; $rowspan=3; if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; @@ -696,13 +710,13 @@ else print ''; // Zip / Town - print ''; // Country - print ''; @@ -710,20 +724,25 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } // Phone - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // EMail - print ''; + print ''; + print ''; if (! empty($conf->mailing->enabled)) { $langs->load("mails"); @@ -737,10 +756,12 @@ else print ''; // Jabberid - print ''; + print ''; + print ''; if (! empty($conf->mailing->enabled)) { - print ''; + print ''; + print ''; } else { @@ -751,23 +772,24 @@ else // Skype if (! empty($conf->skype->enabled)) { - print ''; + print ''; + print ''; } // Visibility - print ''; // Note Public - print ''; // Note Private - print ''; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 6f868dd81c8..183f713aa96 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -374,7 +374,7 @@ class FormCompany $resql=$this->db->query($sql); if ($resql) { - $out.= ''; $out.= ''; $num = $this->db->num_rows($resql); $i = 0; @@ -772,7 +772,7 @@ class FormCompany $maxlength=$formlength; if (empty($formlength)) { $formlength=24; $maxlength=128; } - $out = ''; + $out = ''; return $out; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f5c1237ef05..7ca032cf422 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -805,14 +805,14 @@ else print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print ''; + print ''; if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; @@ -831,7 +831,8 @@ else } // Prospect/Customer - print ''; + print ''; - print ''; print ''; @@ -883,7 +884,8 @@ else } // Address - print ''; @@ -912,7 +914,8 @@ else // Email web print ''; print ''; - print ''; + print ''; + print ''; // Skype if (! empty($conf->skype->enabled)) @@ -934,16 +937,17 @@ else $idprof=$langs->transcountry('ProfId'.$i,$object->country_code); if ($idprof!='-') { + $key='idprof'.$i; + if (($j % 2) == 0) print ''; $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; if(empty($conf->global->$idprof_mandatory)) - print ''; if (($j % 2) == 1) print ''; $j++; @@ -953,7 +957,7 @@ else if ($j % 2 == 1) print ''; // Assujeti TVA - print ''; + print ''; print ''; @@ -987,11 +991,11 @@ else print ''; // Type - Size - print ''; - print ''; @@ -1268,7 +1272,7 @@ else // Name print ''; - print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field @@ -1288,7 +1292,8 @@ else } // Prospect/Customer - print ''; + print ''; - print ''; print ''; // Address - print ''; @@ -1417,16 +1423,17 @@ else $idprof=$langs->transcountry('ProfId'.$i,$object->country_code); if ($idprof!='-') { - if (($j % 2) == 0) print ''; + $key='idprof'.$i; - $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; - if(empty($conf->global->$idprof_mandatory)) - print ''; - $key='idprof'.$i; - print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if(empty($conf->global->$idprof_mandatory)) + print ''; if (($j % 2) == 1) print ''; $j++; @@ -1436,7 +1443,7 @@ else if ($j % 2 == 1) print ''; // VAT payers - print ''; @@ -1474,7 +1481,7 @@ else //TODO: Place into a function to control showing by country or study better option if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - print ''; - print ''; From 94bcb0dc40bcbf8ec2be111be4b586bec24b2be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Sat, 12 Jul 2014 14:45:09 +0200 Subject: [PATCH 216/502] Labels and autofocus for company card forms --- htdocs/admin/company.php | 146 +++++++++---------- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 4 +- htdocs/core/class/html.formother.class.php | 2 +- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f136c1200cf..c69f269f301 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -300,74 +300,74 @@ if ($action == 'edit' || $action == 'updateedit') print ''."\n"; $var=!$var; - print ''."\n"; + print ''."\n"; $var=!$var; - print ''."\n"; + print ''."\n"; $var=!$var; - print ''."\n"; + print ''."\n"; $var=!$var; - print ''."\n"; + print ''."\n"; // Country $var=!$var; - print ''."\n"; $var=!$var; - print ''."\n"; $var=!$var; - print ''."\n"; $var=!$var; - print ''; + print ''; print ''."\n"; $var=!$var; - print ''; + print ''; print ''."\n"; $var=!$var; - print ''; + print ''; print ''."\n"; // Web $var=!$var; - print ''; + print ''; print ''."\n"; // Barcode if (! empty($conf->barcode->enabled)) { $var=!$var; - print ''; + print ''; print ''; } // Logo $var=!$var; - print ''; + print ''; // Capital $var=!$var; - print ''; + print ''; // Forme juridique $var=!$var; - print ''; print '
'.$langs->trans("DateToBirth").''; + print '
'; $form=new Form($db); if ($object->birthday) { @@ -582,14 +593,14 @@ else } print ''.$langs->trans("Alert").': '; + print ': '; if ($object->birthday_alert) { - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").'lastname).'">'.$langs->trans("Firstname").'firstname).'">
lastname).'" autofocus="autofocus">firstname).'">
'.$langs->trans("Company").'
'; print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); print '
'.$langs->trans("UserTitle").''; + print '
'; print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id); print '
'.$langs->trans("PostOrFunction").'poste).'">
poste).'">
'.$langs->trans("Address"); - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''; + print '
/ '; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' '; print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print '
'.$langs->trans("Country").''; + print '
'; print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('State').''; + print '
'; print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id'); print '
'.$langs->trans("PhonePro").'phone_pro).'">'.$langs->trans("PhonePerso").'phone_perso).'">
phone_pro).'">phone_perso).'">
'.$langs->trans("PhoneMobile").'phone_mobile).'">'.$langs->trans("Fax").'fax).'">
phone_mobile).'">fax).'">
'.$langs->trans("EMail").'email).'">
email).'">
'.$langs->trans("Jabberid").'jabberid).'">
jabberid).'">'.$langs->trans("No_Email").''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'
'.$langs->trans("Skype").'skype).'">
skype).'">
'.$langs->trans("ContactVisibility").''; + print '
'; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('priv',$selectarray,$object->priv,0); print '
'.$langs->trans("NotePublic").''; + print '
'; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print '
'.$langs->trans("NotePrivate").''; + print '
'; $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); print '
'; if ($object->particulier || $private) { - print ''; + print ''; } else { - print ''; + print ''; } print ''.$langs->trans('Prefix').'
'.$langs->trans('ProspectCustomer').'
'.$langs->trans('Supplier').''; + print ''; print $form->selectyesno("fournisseur",(isset($_POST['fournisseur'])?GETPOST('fournisseur'):$object->fournisseur),1); print ''; @@ -870,7 +871,7 @@ else } // Status - print '
'.$langs->trans('Status').''; + print '
'; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),1); print '
'.$langs->trans('Address').'
'.$langs->trans('Web').'
'.$idprof.''; + print ''; else - print ''.$idprof.''; + print ''; - $key='idprof'.$i; - print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); + print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); print '
'.$langs->trans('VATIsUsed').'
'; print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print '
'.$langs->trans("ThirdPartyType").''."\n"; + print '
'."\n"; print $form->selectarray("typent_id", $formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.$langs->trans("Staff").''; + print ''; print $form->selectarray("effectif_id", $formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans('ProspectCustomer').'
'.$langs->trans('Supplier').''; + print ''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''; @@ -1361,12 +1366,13 @@ else } // Status - print '
'.$langs->trans("Status").''; + print '
'; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$object->status); print '
'.$langs->trans('Address').'
'.$idprof.''; - else - print ''.$idprof.''; + if (($j % 2) == 0) print '
'; + else + print ''; + + print $formcompany->get_input_id_prof($i,$key,$object->$key,$object->country_code); print '
'.$langs->trans('VATIsUsed').''; + print '
'; print $form->selectyesno('assujtva_value',$object->tva_assuj,1); print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print '
'; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1483,7 +1490,7 @@ else print ''; } - print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print ''; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if (! isOnlyOneLocalTax(2)) { @@ -1496,7 +1503,7 @@ else } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { - print '
'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).''; + print '
'; print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); if(! isOnlyOneLocalTax(1)) { @@ -1509,7 +1516,7 @@ else } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { - print '
'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; + print '
'; print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); if(! isOnlyOneLocalTax(2)) { @@ -1521,11 +1528,11 @@ else } // Type - Size - print '
'.$langs->trans("ThirdPartyType").''; + print '
'; print $form->selectarray("typent_id",$formcompany->typent_array(0), $object->typent_id, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''.$langs->trans("Staff").''; + print ''; print $form->selectarray("effectif_id",$formcompany->effectif_array(0), $object->effectif_id); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; - print '
'; + print '
'.$langs->trans("CompanyAddress").''; - print '
'; + print '
'.$langs->trans("CompanyZip").''; - print '
'; + print '
'.$langs->trans("CompanyTown").''; - print '
'; + print '
'.$langs->trans("Country").''; + print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
'.$langs->trans("State").''; + print '
'; $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); print '
'.$langs->trans("CompanyCurrency").''; + print '
'; print $form->selectCurrency($conf->currency,"currency"); print '
'.$langs->trans("Phone").''; - print '
'; + print '
'.$langs->trans("Fax").''; - print '
'; + print '
'.$langs->trans("EMail").''; - print '
'; + print '
'.$langs->trans("Web").''; - print '
'; + print '
'.$langs->trans("Gencod").''; - print '
'; + print '
'.$langs->trans("Logo").' (png,jpg)'; + print ''; print ''; + print ''; print ''; print '
'; - print ''; + print ''; print ''; if (! empty($mysoc->logo_mini)) { @@ -387,8 +387,8 @@ if ($action == 'edit' || $action == 'updateedit') // Note $var=!$var; - print '
'.$langs->trans("Note").''; - print '
'; + print '
'; @@ -404,17 +404,17 @@ if ($action == 'edit' || $action == 'updateedit') // Managing Director(s) $var=!$var; - print '
'.$langs->trans("ManagingDirectors").''; - print '
'; + print '
'.$langs->trans("Capital").''; - print '
'; + print '
'.$langs->trans("JuridicalStatus").''; + print '
'; if ($mysoc->country_code) { print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE,$mysoc->country_code); @@ -429,10 +429,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -445,10 +445,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -461,10 +461,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -477,10 +477,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -493,10 +493,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -509,10 +509,10 @@ if ($action == 'edit' || $action == 'updateedit') if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') { $var=!$var; - print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; + print '
'; if (! empty($mysoc->country_code)) { - print ''; + print ''; } else { @@ -523,8 +523,8 @@ if ($action == 'edit' || $action == 'updateedit') // TVA Intra $var=!$var; - print '
'.$langs->trans("VATIntra").''; - print ''; + print '
'; + print ''; print '
'; @@ -539,7 +539,7 @@ if ($action == 'edit' || $action == 'updateedit') $var=true; $var=!$var; - print '
'.$langs->trans("FiscalMonthStart").''; + print '
'; print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',1) . '
"; @@ -555,19 +555,19 @@ if ($action == 'edit' || $action == 'updateedit') $var=true; $var=!$var; - print "
'; print ""; - print ""; + print ""; print "\n"; print "
".$langs->trans("VATIsUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "
'; print ""; - print ""; + print ""; print "\n"; print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(1)) { - print ''; - print ''; @@ -610,10 +610,10 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=!$var; - print ""; + print ""; print '"; + print ""; print ''; + print '\n"; + print ''; + print "\n"; + print '"; + print '\n"; + print '\n"; + print ''; + print "\n"; + $i++; + } + } + print "
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
'.$langs->trans("LTRate").': '; + print '
: '; $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); } print '
'.$langs->trans("CalcLocaltax").': '; + print '
'.$langs->trans("CalcLocaltax").': '; $opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code)); print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); print '
global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; @@ -633,19 +633,19 @@ if ($action == 'edit' || $action == 'updateedit') $var=!$var; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print "
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"\n":""); - print ''; } - print ''; @@ -653,10 +653,10 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; $var=!$var; - print ""; + print ""; print '"; + print ""; print '\n"; $var=!$var; - print ""; + print ""; print '\n"; @@ -994,10 +994,10 @@ else $var=true; $var=!$var; - print ""; + print ""; print ''; + print '"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) + print '\n"; + if (! empty($conf->global->DISPLAY_MARK_RATES)) + print "\n"; + print ''; + print "\n"; + print "
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
'.$langs->transcountry("LTRate").': '; + print '
: '; if(! isOnlyOneLocalTax(2)) { $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); print '
'.$langs->trans("CalcLocaltax").': '; + print '
: '; $opcions=array($langs->transcountry("CalcLocaltax1",$mysoc->country_code),$langs->transcountry("CalcLocaltax2",$mysoc->country_code),$langs->transcountry("CalcLocaltax3",$mysoc->country_code)); print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); print '
global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; @@ -959,19 +959,19 @@ else $var=true; $var=!$var; - print "
global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."'; print ""; - print ""; + print ""; print "\n"; print "
".$langs->trans("VATIsUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "
global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."'; print ""; - print ""; + print ""; print "\n"; print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) @@ -1022,10 +1022,10 @@ else print "\n"; $var=!$var; - print ""; + print ""; print '"; + print ""; print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
"; @@ -1045,10 +1045,10 @@ else $var=true; $var=!$var; - print "
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) @@ -1074,10 +1074,10 @@ else print "\n"; $var=!$var; - print ""; + print ""; print '"; } else { + print '\n"; + print $text.= ' - '.$objp->label; + print "\n"; + //print "\n"; } print "\n"; print "\n"; From 8eced58ba0eeb8c7ab48a3deb0f480d4dd20d8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garc=C3=ADa?= Date: Mon, 14 Jul 2014 19:16:28 +0200 Subject: [PATCH 223/502] Removed @ operator from dol_include_once Adding @ operator to include_once makes include errors untraceable, it shouldn't be there. Errors must be thrown so that we notice them. It is PHP configuration's choice to decide wether to log them or print them. --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b1f11590bdc..78326ee3bb7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -243,9 +243,9 @@ function dol_include_once($relpath, $classname='') global $conf,$langs,$user,$mysoc; // Other global var must be retreived with $GLOBALS['var'] if (! empty($classname) && ! class_exists($classname)) { - return @include dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems + return include dol_buildpath($relpath); } else { - return @include_once dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems + return include_once dol_buildpath($relpath); } } From 9410b1847367074db6a4df309b34a1d0234374bf Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 14 Jul 2014 19:38:00 +0200 Subject: [PATCH 224/502] Fix: Import ProfId1 to siren and ProfId2 to siret --- htdocs/core/modules/modSociete.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index ee48e4d7ff7..746046cb3da 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2012-2013 Juanjo Menent + * Copyright (C) 2012-2014 Juanjo Menent * * 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 @@ -382,7 +382,7 @@ class modSociete extends DolibarrModules $this->import_icon[$r]='company'; $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order) - $this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_departement'=>"StateId",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation"); + $this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_departement'=>"StateId",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation"); // Add extra fields $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity = ".$conf->entity; $resql=$this->db->query($sql); From ccf32636f8cb7cc57a2322616a3abf659605afff Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 14 Jul 2014 19:42:54 +0200 Subject: [PATCH 225/502] Fix: Import ProfId1 to siren and ProfId2 to siret Conflicts: ChangeLog --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0621064fb3c..40ad4d41945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -211,6 +211,8 @@ Fix: [ bug #1461 ] LINEORDER_SUPPLIER_CREATE does not intercept supplier order l Fix: [ bug #1484 ] BILL_SUPPLIER_PAYED trigger action does not intercept failure under some circumstances Fix: [ bug #1482 ] Several supplier invoice triggers do not show trigger error messages Fix: [ bug #1486 ] LINEBILL_SUPPLIER_CREATE and LINEBILL_SUPPLIER_UPDATE triggers do not intercept trigger action +Fix: [ bug #1522 ] Element list into associate object into project are no more filterd by project thirdparty +Fix: Import ProfId1 to siren and ProfId2 to siret ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. From dda17f4082784fcbc8a277a65bb34a14685613d1 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 12 Jul 2014 16:22:49 +0200 Subject: [PATCH 226/502] Security fix --- htdocs/product/stock/fiche.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index ecc29a55927..874b082ceae 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -39,6 +39,7 @@ $action=GETPOST('action'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); +$id = GETPOST("id",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="DESC"; @@ -109,7 +110,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) { $object = new Entrepot($db); - if ($object->fetch($_POST["id"])) + if ($object->fetch($id)) { $object->libelle = $_POST["libelle"]; $object->description = $_POST["desc"]; @@ -120,23 +121,20 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) $object->town = $_POST["town"]; $object->country_id = $_POST["country_id"]; - if ( $object->update($_POST["id"], $user) > 0) + if ( $object->update($id, $user) > 0) { $action = ''; - $_GET["id"] = $_POST["id"]; //$mesg = '
Fiche mise a jour
'; } else { $action = 'edit'; - $_GET["id"] = $_POST["id"]; $mesg = '
'.$object->error.'
'; } } else { $action = 'edit'; - $_GET["id"] = $_POST["id"]; $mesg = '
'.$object->error.'
'; } } @@ -144,7 +142,6 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) if ($_POST["cancel"] == $langs->trans("Cancel")) { $action = ''; - $_GET["id"] = $_POST["id"]; } @@ -219,12 +216,13 @@ if ($action == 'create') } else { - if ($_GET["id"]) + $id=GETPOST("id",'int'); + if ($id) { dol_htmloutput_mesg($mesg); $object = new Entrepot($db); - $result = $object->fetch($_GET["id"]); + $result = $object->fetch($id); if ($result < 0) { dol_print_error($db); @@ -368,13 +366,13 @@ else print '
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; + print ""; $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d1b338176a4..8dfe80368e9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3306,7 +3306,7 @@ class Form if ($selected=='euro' || $selected=='euros') $selected='EUR'; // Pour compatibilite - $out.= ''; foreach ($langs->cache_currencies as $code_iso => $currency) { if ($selected && $selected == $code_iso) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 183f713aa96..fd7db5fa94f 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -782,7 +782,7 @@ class FormCompany * * @param int $local LocalTax * @param int $selected Preselected value - * @param varchar $htmlname HTML select name + * @param string $htmlname HTML select name * @return void */ function select_localtax($local, $selected, $htmlname) @@ -798,7 +798,7 @@ class FormCompany if (count($valors) > 1) { //montar select - print ''; while ($i <= (count($valors))-1) { if ($selected == $valors[$i]) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index f51cf060af8..ab924d482a7 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -760,7 +760,7 @@ class FormOther $montharray = monthArray($langs); // Get array - $select_month = ''; if ($useempty) { $select_month .= ''; From 0c8765bfe3f58fac55f3a5a73b9f8b6fcdf91c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 12 Jul 2014 14:56:22 +0200 Subject: [PATCH 217/502] Updated vagrant box --- dev/vagrant/README.md | 21 +- dev/vagrant/dolibarrdev/Vagrantfile | 25 +- dev/vagrant/dolibarrdev/puphpet/config.yaml | 20 +- .../dolibarrdev/puphpet/files/dot/.gitignore | 5 +- .../puphpet/files/startup-always/empty | 0 .../puphpet/files/startup-once/empty | 0 .../dolibarrdev/puphpet/puppet/manifest.pp | 45 ++-- .../puppet/parser/functions/hash_key_true.rb | 42 ++++ .../puppet/modules/puphpet/manifests/hhvm.pp | 26 +- .../modules/puphpet/manifests/python/pip.pp | 22 ++ .../puppet/modules/supervisord/.fixtures.yml | 8 +- .../puppet/modules/supervisord/.travis.yml | 23 +- .../puppet/modules/supervisord/Changelog | 63 +++++ .../puppet/modules/supervisord/Gemfile | 28 ++- .../puppet/modules/supervisord/Modulefile | 2 +- .../puppet/modules/supervisord/README.md | 54 ++++- .../puppet/modules/supervisord/Rakefile | 25 +- .../lib/puppet/parser/functions/array2csv.rb | 2 - .../lib/puppet/parser/functions/hash2csv.rb | 2 - .../modules/supervisord/manifests/config.pp | 26 +- .../supervisord/manifests/eventlistener.pp | 70 +++++- .../supervisord/manifests/fcgi_program.pp | 69 +++++- .../modules/supervisord/manifests/group.pp | 14 +- .../modules/supervisord/manifests/init.pp | 74 +++++- .../modules/supervisord/manifests/install.pp | 6 +- .../modules/supervisord/manifests/params.pp | 22 +- .../modules/supervisord/manifests/pip.pp | 8 +- .../modules/supervisord/manifests/program.pp | 68 +++++- .../modules/supervisord/manifests/reload.pp | 21 ++ .../modules/supervisord/manifests/service.pp | 6 +- .../supervisord/manifests/supervisorctl.pp | 29 +++ .../acceptance/nodesets/centos-65-i386.yml | 10 + .../acceptance/nodesets/centos-65-x64.yml | 10 + .../acceptance/nodesets/debian-73-i386.yml | 10 + .../acceptance/nodesets/debian-73-x64.yml | 10 + .../spec/acceptance/nodesets/default.yml | 10 + .../spec/acceptance/supervisord_spec.rb | 114 +++++++++ .../spec/classes/supervisord_spec.rb | 227 +++++++++++++++++- .../spec/defines/eventlistener_spec.rb | 85 ++++++- .../spec/defines/fcgi_program_spec.rb | 94 ++++++-- .../supervisord/spec/defines/program_spec.rb | 90 ++++++- .../supervisord/spec/defines/supervisorctl.rb | 13 + .../modules/supervisord/spec/spec_helper.rb | 1 + .../spec/spec_helper_acceptance.rb | 24 ++ .../supervisord/spec/spec_helper_system.rb | 25 -- .../supervisord/spec/system/basic_spec.rb | 120 --------- .../templates/conf/eventlistener.erb | 8 +- .../templates/conf/fcgi_program.erb | 8 +- .../supervisord/templates/conf/program.erb | 8 +- .../{debian_extra.erb => Debian/defaults.erb} | 0 .../init/{debian_init.erb => Debian/init.erb} | 6 +- .../{redhat_extra.erb => RedHat/defaults.erb} | 2 +- .../init/{redhat_init.erb => RedHat/init.erb} | 5 +- .../templates/supervisord_main.erb | 10 +- .../templates/supervisord_unix.erb | 4 +- .../modules/supervisord/tests/program.pp | 34 ++- .../puphpet/shell/execute-files.sh | 31 ++- .../dolibarrdev/puphpet/shell/ssh-keygen.sh | 81 +++++-- 58 files changed, 1491 insertions(+), 375 deletions(-) create mode 100644 dev/vagrant/dolibarrdev/puphpet/files/startup-always/empty create mode 100644 dev/vagrant/dolibarrdev/puphpet/files/startup-once/empty create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb delete mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb delete mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb rename dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/{debian_extra.erb => Debian/defaults.erb} (100%) rename dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/{debian_init.erb => Debian/init.erb} (96%) rename dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/{redhat_extra.erb => RedHat/defaults.erb} (81%) rename dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/{redhat_init.erb => RedHat/init.erb} (94%) diff --git a/dev/vagrant/README.md b/dev/vagrant/README.md index 8056643520e..dc0bc4234e2 100644 --- a/dev/vagrant/README.md +++ b/dev/vagrant/README.md @@ -23,7 +23,7 @@ Usage `cd` into the vagrant box directory and simply type `vagrant up`. -That's all you need to do. It will build a brand new VirtalBox machine for you with everything you need to develop on Dolibarr. +That's all you need to do. It will build a brand new VirtualBox machine for you with everything you need to develop on Dolibarr. ### Name resolution For easy access to the VM you need to setup name resolution to the machines IP. @@ -45,9 +45,16 @@ Somewhat bleeding edge vagrant box for develop branch related work. - IP: 192.168.42.101 - Vhost: dev.dolibarr.org -- OS: Debian Wheezy 7.5 +- OS: Debian Wheezy 7.5 x64 - Webserver: Apache 2.2.22 -- PHP: mod_php 5.5.13-1~dotdeb.1 +- PHP: mod_php 5.5.14-1~dotdeb.1 + Installed modules: + - cli + - curl + - gd + - imagick + - intl + - mcrypt - Database: MySQL 5.5 - Root user: root - Root password: root @@ -55,7 +62,13 @@ Somewhat bleeding edge vagrant box for develop branch related work. - Database user: user - Database password: user - Initial data: dev/initdata/mysqldump_dolibarr-3.5.0.sql +- Database: PostgreSQL 9.3 +- Adminer: lightweight database management. Access through http://192.168.42.101/adminer - Debugger: XDebug -- Profiler: Xhprof +- Profiler: Xhprof. Access through http://192.168.42.101/xhprof/xhprof_html You can access MailCatcher to read all outgoing emails at http://192.168.42.101:1080 + +To access the machine you must use the following private keys: +- User root: located at puphpet/files/dot/ssh/root_rsa +- User vagrant: located at puphpet/files/dot/ssh/id_rsa diff --git a/dev/vagrant/dolibarrdev/Vagrantfile b/dev/vagrant/dolibarrdev/Vagrantfile index f73476207d0..89c2c75a5b7 100644 --- a/dev/vagrant/dolibarrdev/Vagrantfile +++ b/dev/vagrant/dolibarrdev/Vagrantfile @@ -25,11 +25,19 @@ Vagrant.configure("2") do |config| data['vm']['synced_folder'].each do |i, folder| if folder['source'] != '' && folder['target'] != '' - nfs = (folder['nfs'] == "true") ? "nfs" : nil - if nfs == "nfs" - config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: nfs + if folder['sync_type'] == 'nfs' + config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "nfs" + elsif folder['sync_type'] == 'smb' + config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "smb" + elsif folder['sync_type'] == 'rsync' + rsync_args = !folder['rsync']['args'].nil? ? folder['rsync']['args'] : ["--verbose", "--archive", "--delete", "-z"] + rsync_auto = !folder['rsync']['auto'].nil? ? folder['rsync']['auto'] : true + rsync_exclude = !folder['rsync']['exclude'].nil? ? folder['rsync']['exclude'] : [".vagrant/"] + + config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", + rsync__args: rsync_args, rsync__exclude: rsync_exclude, rsync__auto: rsync_auto, type: "rsync" else - config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: nfs, + config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", group: 'www-data', owner: 'www-data', mount_options: ["dmode=775", "fmode=764"] end end @@ -128,7 +136,14 @@ Vagrant.configure("2") do |config| end end - config.vm.provision :shell, :path => "puphpet/shell/execute-files.sh" + config.vm.provision :shell do |s| + s.path = "puphpet/shell/execute-files.sh" + s.args = ["exec-once", "exec-always"] + end + config.vm.provision :shell, run: "always" do |s| + s.path = "puphpet/shell/execute-files.sh" + s.args = ["startup-once", "startup-always"] + end config.vm.provision :shell, :path => "puphpet/shell/important-notices.sh" if File.file?("#{dir}/puphpet/files/dot/ssh/id_rsa") diff --git a/dev/vagrant/dolibarrdev/puphpet/config.yaml b/dev/vagrant/dolibarrdev/puphpet/config.yaml index 5cfb2601f21..96c01695cec 100644 --- a/dev/vagrant/dolibarrdev/puphpet/config.yaml +++ b/dev/vagrant/dolibarrdev/puphpet/config.yaml @@ -29,10 +29,12 @@ vagrantfile-local: - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml' - '--parser future' synced_folder: - PL1BkioqqvGY: + jopH6005bn96: source: ../../../ target: /var/www - nfs: 'false' + sync_type: default + rsync: + auto: 'false' usable_port_range: 2200..2250 ssh: host: null @@ -71,7 +73,7 @@ apache: settings: user: www-data group: www-data - default_vhost: false + default_vhost: true manage_user: false manage_group: false sendfile: 0 @@ -79,7 +81,7 @@ apache: - php - rewrite vhosts: - CGyWQB0fx4x0: + b2tOrs1TMtoF: servername: dev.dolibarr.org docroot: /var/www/htdocs port: '80' @@ -97,7 +99,7 @@ apache: nginx: install: 0 vhosts: - jeF1sybIJ3V2: + 0dU5luf5AnIe: server_name: awesome.dev server_aliases: - www.awesome.dev @@ -152,7 +154,7 @@ mysql: root_password: root adminer: 0 databases: - 2OfuuapoIqsl: + V6H3W2FVB7Yq: grant: - ALTER - CREATE @@ -168,14 +170,14 @@ mysql: password: user sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql postgresql: - install: 0 + install: '1' settings: - root_password: '123' + root_password: root user_group: postgres encoding: UTF8 version: '9.3' databases: { } - adminer: 0 + adminer: '1' mariadb: install: 0 root_password: '123' diff --git a/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore b/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore index dcf60545594..e9b023ea6a6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore +++ b/dev/vagrant/dolibarrdev/puphpet/files/dot/.gitignore @@ -1,4 +1 @@ -ssh/id_rsa -ssh/id_rsa.pub -ssh/insecure_private_key -ssh/id_rsa.ppk \ No newline at end of file +ssh/* \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/files/startup-always/empty b/dev/vagrant/dolibarrdev/puphpet/files/startup-always/empty new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/vagrant/dolibarrdev/puphpet/files/startup-once/empty b/dev/vagrant/dolibarrdev/puphpet/files/startup-once/empty new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp index 57f759e5531..6f560f8735f 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp @@ -279,8 +279,14 @@ if hash_key_equals($mailcatcher_values, 'install', 1) { } if ! defined(Class['supervisord']) { + class{ 'puphpet::python::pip': } + class { 'supervisord': - install_pip => true, + install_pip => false, + require => [ + Class['my_fw::post'], + Class['Puphpet::Python::Pip'], + ], } } @@ -467,15 +473,16 @@ if hash_key_equals($apache_values, 'install', 1) { $apache_vhosts = merge($apache_values['vhosts'], { 'default_vhost_80' => { 'servername' => 'default', - 'serveraliases' => ['*'], 'docroot' => '/var/www/default', 'port' => 80, + 'default_vhost' => true, }, 'default_vhost_443' => { 'servername' => 'default', - 'serveraliases' => ['*'], 'docroot' => '/var/www/default', 'port' => 443, + 'default_vhost' => true, + 'ssl' => 1, }, }) } else { @@ -515,11 +522,11 @@ if hash_key_equals($apache_values, 'install', 1) { create_resources(apache::vhost, { "${key}" => merge($vhost, { 'custom_fragment' => template('puphpet/apache/custom_fragment.erb'), - 'ssl' => 'ssl' in $vhost and str2bool($vhost['ssl']) ? { true => true, default => false }, - 'ssl_cert' => 'ssl_cert' in $vhost and $vhost['ssl_cert'] ? { undef => undef, '' => undef, default => $vhost['ssl_cert'] }, - 'ssl_key' => 'ssl_key' in $vhost and $vhost['ssl_key'] ? { undef => undef, '' => undef, default => $vhost['ssl_key'] }, - 'ssl_chain' => 'ssl_chain' in $vhost and $vhost['ssl_chain'] ? { undef => undef, '' => undef, default => $vhost['ssl_chain'] }, - 'ssl_certs_dir' => 'ssl_certs_dir' in $vhost and $vhost['ssl_certs_dir'] ? { undef => undef, '' => undef, default => $vhost['ssl_certs_dir'] } + 'ssl' => 'ssl' in $vhost and str2bool($vhost['ssl']) ? { true => true, default => false }, + 'ssl_cert' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_cert'], default => undef }, + 'ssl_key' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_key'], default => undef }, + 'ssl_chain' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_chain'], default => undef }, + 'ssl_certs_dir' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_certs_dir'], default => undef } }) }) @@ -662,10 +669,6 @@ if hash_key_equals($nginx_values, 'install', 1) { } } elsif hash_key_equals($hhvm_values, 'install', 1) { $fastcgi_pass = '127.0.0.1:9000' - - set_php5_fpm_sock_group_and_user { 'hhvm': - require => Package['nginx'], - } } else { $fastcgi_pass = '' } @@ -1096,7 +1099,7 @@ if hash_key_equals($xhprof_values, 'install', 1) } if hash_key_equals($apache_values, 'install', 1) { - $xhprof_webroot_location = $puphpet::params::apache_webroot_location + $xhprof_webroot_location = '/var/www/default' $xhprof_webserver_service = 'httpd' } elsif hash_key_equals($nginx_values, 'install', 1) { $xhprof_webroot_location = $puphpet::params::nginx_webroot_location @@ -1216,11 +1219,11 @@ if hash_key_equals($mysql_values, 'install', 1) { if hash_key_equals($mysql_values, 'adminer', 1) and $mysql_php_installed { if hash_key_equals($apache_values, 'install', 1) { - $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location + $mysql_adminer_webroot_location = '/var/www/default' } elsif hash_key_equals($nginx_values, 'install', 1) { $mysql_adminer_webroot_location = $puphpet::params::nginx_webroot_location } else { - $mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location + $mysql_adminer_webroot_location = '/var/www/default' } class { 'puphpet::adminer': @@ -1329,11 +1332,11 @@ if hash_key_equals($postgresql_values, 'install', 1) { if hash_key_equals($postgresql_values, 'adminer', 1) and $postgresql_php_installed { if hash_key_equals($apache_values, 'install', 1) { - $postgresql_adminer_webroot_location = $puphpet::params::apache_webroot_location + $postgresql_adminer_webroot_location = '/var/www/default' } elsif hash_key_equals($nginx_values, 'install', 1) { $postgresql_adminer_webroot_location = $puphpet::params::nginx_webroot_location } else { - $postgresql_adminer_webroot_location = $puphpet::params::apache_webroot_location + $postgresql_adminer_webroot_location = '/var/www/default' } class { 'puphpet::adminer': @@ -1364,7 +1367,7 @@ define postgresql_db ( $table = "${name}.*" exec{ "${name}-import": - command => "psql ${name} < ${sql_file}", + command => "sudo -u postgres psql ${name} < ${sql_file}", logoutput => true, refreshonly => $refresh, require => Postgresql::Server::Db[$name], @@ -1491,11 +1494,11 @@ if hash_key_equals($mariadb_values, 'install', 1) { if hash_key_equals($mariadb_values, 'adminer', 1) and $mariadb_php_installed { if hash_key_equals($apache_values, 'install', 1) { - $mariadb_adminer_webroot_location = $puphpet::params::apache_webroot_location + $mariadb_adminer_webroot_location = '/var/www/default' } elsif hash_key_equals($nginx_values, 'install', 1) { $mariadb_adminer_webroot_location = $puphpet::params::nginx_webroot_location } else { - $mariadb_adminer_webroot_location = $puphpet::params::apache_webroot_location + $mariadb_adminer_webroot_location = '/var/www/default' } class { 'puphpet::adminer': @@ -1662,7 +1665,7 @@ if $beanstalkd_values == undef { } if hash_key_equals($apache_values, 'install', 1) { - $beanstalk_console_webroot_location = "${puphpet::params::apache_webroot_location}/beanstalk_console" + $beanstalk_console_webroot_location = '/var/www/default/beanstalk_console' } elsif hash_key_equals($nginx_values, 'install', 1) { $beanstalk_console_webroot_location = "${puphpet::params::nginx_webroot_location}/beanstalk_console" } else { diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb new file mode 100644 index 00000000000..fd495f8f143 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb @@ -0,0 +1,42 @@ +# +# hash_key_true.rb +# + +module Puppet::Parser::Functions + + newfunction(:hash_key_true, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| + + Returns true if the key within hash is truthy + ENDHEREDOC + + unless args.length == 2 + raise Puppet::ParseError, ("hash_key_true(): wrong number of arguments (#{args.length}; must be 2)") + end + + arr = args[0] + key = args[1] + + unless arr.is_a?(Hash) + return false + end + + unless arr.has_key?(key) + return false + end + + if arr[key].nil? + return false + end + + if arr[key].empty? + return false + end + + if arr[key] == 'false' + return false + end + + return true + + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp index 90083232cdc..3b27ab90af6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp @@ -69,17 +69,39 @@ class puphpet::hhvm( } } 'centos': { + $jemalloc_url = 'http://files.puphpet.com/centos6/jemalloc-3.6.0-1.el6.x86_64.rpm' + $jemalloc_download_location = '/.puphpet-stuff/jemalloc-3.6.0-1.el6.x86_64.rpm' + + $require = defined(Class['my_fw::post']) ? { + true => Class['my_fw::post'], + default => [], + } + + exec { "download jemalloc to ${download_location}": + creates => $download_location, + command => "wget --quiet --tries=5 --connect-timeout=10 -O '${jemalloc_download_location}' '${jemalloc_url}'", + timeout => 30, + path => '/usr/bin', + require => $require + } + + package { 'jemalloc': + ensure => latest, + provider => yum, + source => $download_location, + require => Exec["download jemalloc to ${download_location}"], + } + yum::managed_yumrepo { 'hop5': descr => 'hop5 repository', baseurl => 'http://www.hop5.in/yum/el6/', gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-HOP5', enabled => 1, gpgcheck => 0, - priority => 1 + priority => 1, } } } - if $real_webserver == 'apache2' { if ! defined(Class['apache::mod::mime']) { class { 'apache::mod::mime': } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp new file mode 100644 index 00000000000..14b13fe08c6 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/python/pip.pp @@ -0,0 +1,22 @@ +class puphpet::python::pip { + + Exec { path => [ '/usr/bin/', '/usr/local/bin', '/bin', '/usr/local/sbin', '/usr/sbin', '/sbin' ] } + + if ! defined(Package['python-setuptools']) { + package { 'python-setuptools': } + } + + exec { 'easy_install pip': + unless => 'which pip', + require => Package['python-setuptools'], + } + + if $::osfamily == 'RedHat' { + exec { 'rhel pip_provider_name_fix': + command => 'alternatives --install /usr/bin/pip-python pip-python /usr/bin/pip 1', + subscribe => Exec['easy_install pip'], + unless => 'which pip-python', + } + } + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml index 15f96922e01..3f18ef2fca2 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.fixtures.yml @@ -1,6 +1,10 @@ fixtures: repositories: - stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib" - concat: "git://github.com/puppetlabs/puppetlabs-concat" + 'stdlib': + repo: 'git://github.com/puppetlabs/puppetlabs-stdlib' + ref: '4.1.0' + 'concat': + repo: 'git://github.com/puppetlabs/puppetlabs-concat' + ref: '1.0.1' symlinks: supervisord: "#{source_dir}" \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml index 6e544518c19..bc96a165e59 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/.travis.yml @@ -1,21 +1,28 @@ language: ruby bundler_args: --without development -script: "bundle exec rake spec lint" +script: "bundle exec rake test" rvm: - 1.8.7 - 1.9.3 - 2.0.0 env: - matrix: - - PUPPET_GEM_VERSION="~> 2.7.0" - - PUPPET_GEM_VERSION="~> 3.3.0" - - PUPPET_GEM_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 2.7.0" + - PUPPET_VERSION="~> 3.1.0" + - PUPPET_VERSION="~> 3.2.0" + - PUPPET_VERSION="~> 3.3.0" + - PUPPET_VERSION="~> 3.4.0" + - PUPPET_VERSION="~> 3.5.0" + - PUPPET_VERSION="~> 3.6.0" matrix: exclude: - - rvm: 1.9.3 - env: PUPPET_GEM_VERSION="~> 2.7.0" - rvm: 2.0.0 - env: PUPPET_GEM_VERSION="~> 2.7.0" + env: PUPPET_VERSION="~> 2.7.0" + - rvm: 1.9.3 + env: PUPPET_VERSION="~> 2.7.0" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 3.1.0" + - rvm: 1.8.7 + env: PUPPET_VERSION="~> 3.2.0" notifications: email: false diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog index ab4faa445ff..b1e3228ff02 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Changelog @@ -1,3 +1,66 @@ +2014-06-20 - v0.4.0 + +Fixes: + +- Removed root as group and replaced with uid 0 to enhance system +compatibility + +Enhancements: + +- Made package provider a user definable param see supervisord::package_provider and README for details of how to change this. +- All define types can now be automatically pulled in from hiera see example https://github.com/ajcrowe/puppet-supervisord#configure-a-program +- You can now override the default include path of $config_include/*.conf with your own array using $config_dirs. Bear in mind this would need to include whatever you set $config_include to be, with *.conf on the end. + +Many thanks for the PRs from @jasperla, @mvantellingen for the bug report on the service name and @hasc for the enhancement ideas. + +2014-06-06 - v0.3.3 + +Fixes: + +- Fixed typo in stopwaitsec param, should have been stopwaitsecs, thanks to @rchrd2 + +2014-05-03 - v0.3.2 + +Changes: + +- Added supervisord::executable_ctl variable for supervisorctl binary path, thanks to @bpgoldsb + +2014-04-22 - v0.3.1 + +Fixes: + +- Fixed typo in unix_socket_group param, thanks to @dig412 + +2014-03-11 - v0.3.0 + +Fixes: + +- Fixed typo in fcgi config +- Fixed typo in supervisord config with minfds and minprocs, thanks to @peefourtee +- Typo in README fixed thanks to @hopkinsth +- Removed refreshonly from pip_install exec resource +- Number of syntax fixes thanks to `puppet lint` + +Important Changes: + +- Lots of input validation has been added **PLEASE** check your config works before upgrading! +- Changed init_extras naming to defaults and cleaned things up. +- Starting and stopping apps is now done with supervisorctl commands to avoid service restarts + +Other Changes: + +- CSV functions now order things consistently +- Included description for classes and functions +- Expanded spec testing built with Travis CI +- Added beaker acceptance tests +- Added greater validation of various parameters +- Added coverage reporting for resources + +To-Do: + +- Add support for additional OS families such as Solaris. + + 2013-10-31 - v0.2.3 Fixes: diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile index 8612255f5b8..ba9a19d533a 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Gemfile @@ -1,14 +1,26 @@ source 'https://rubygems.org' -group :development, :test do +group :test do gem 'rake' - gem 'puppetlabs_spec_helper', :require => false - gem 'rspec-system-puppet', '~> 2.0' - gem 'puppet-lint', '~> 0.3.2' + gem 'puppet-lint' + gem 'puppet-syntax' + gem 'puppetlabs_spec_helper' + gem 'rspec-puppet', :git => 'https://github.com/rodjek/rspec-puppet.git' , :ref => 'c44381a240ec420d4ffda7bffc55ee4d9c08d682' + gem 'rspec', '2.14.1' end -if puppetversion = ENV['PUPPET_GEM_VERSION'] - gem 'puppet', puppetversion, :require => false -else - gem 'puppet', :require => false +group :development do + gem 'travis' + gem 'travis-lint' + gem 'beaker' + gem 'beaker-rspec' + gem 'pry' + gem 'guard-rake' +end + + +if puppetversion = ENV['PUPPET_VERSION'] + gem 'puppet', puppetversion +else + gem 'puppet', '~> 3.4.0' end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile index 4a0552115da..0c99b04baf2 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Modulefile @@ -1,5 +1,5 @@ name 'ajcrowe-supervisord' -version '0.2.3' +version '0.4.0' source 'git@github.com/ajcrowe/puppet-supervisord.git' author 'Alex Crowe' license 'Apache License, Version 2.0' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md index a8419a09082..b454cd9307a 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/README.md @@ -4,7 +4,7 @@ Puppet module to manage the [supervisord](http://supervisord.org/) process control system. -Functions available to configure +Functions available to configure * [programs](http://supervisord.org/configuration.html#program-x-section-settings) * [groups](http://supervisord.org/configuration.html#group-x-section-settings) @@ -31,10 +31,16 @@ class supervisord { } ``` -This will download [setuptool](https://bitbucket.org/pypa/setuptools) and install pip with easy_install. +This will download [setuptool](https://bitbucket.org/pypa/setuptools) and install pip with easy_install. You can pass a specific url with `$setuptools_url = 'url'` +### Install without pip + +If you want to use your system package manager you can specify that with `supervisord::package_provider`. + +You'll also likely need to adjust the `supervisord::service_name` to match that installed by the system package. If you're using Debian or Redhat OS families you'll also want to disable the init scripts with `supervisord::install_init = false`. + Note: Only Debian and RedHat families have an init script currently. ### Configure a program @@ -61,23 +67,61 @@ supervisord::program { 'myprogram': } ``` +Or you can fully define your programs in hiera: + +```yaml +supervisord::programs: + 'myprogram': + command: 'command --args' + autostart: yes + autorestart: 'true' + environment: + HOME: '/home/myuser' + PATH: '/bin:/sbin:/usr/bin:/usr/sbin' + SECRET: 'mysecret' +``` + ### Configure a group ```ruby supervisord::group { 'mygroup': priority => 100, - program => ['program1', 'program2', 'program3'] + programs => ['program1', 'program2', 'program3'] } ``` +### Configure an eventlistener + +```ruby +supervisord::eventlistener { 'mylistener': + command => 'command --args', + events => ['PROCESS_STATE', 'PROCESS_STATE_START'] + priority => '100', + env_var => 'my_common_envs' +} +``` + +### Run supervisorctl Commands + +Should you need to run a sequence of command with `supervisorctl` you can use the define type `supervisord::supervisorctl` + +```ruby +supervisord::supervisorctl { 'restart_myapp': + command => 'restart', + process => 'myapp' +} +``` + +You can also issue a command without specifying a process. + ### Development If you have suggestions or improvements please file an issue or pull request, i'll try and sort them as quickly as possble. -If you submit a pull please try and include tests for the new functionality. The module is tested with [Travis-CI](https://travis-ci.org/ajcrowe/puppet-supervisord). +If you submit a pull please try and include tests for the new functionality/fix. The module is tested with [Travis-CI](https://travis-ci.org/ajcrowe/puppet-supervisord). ### Credits * Debian init script sourced from the system package. -* RedHat/Centos init script sourced from https://github.com/Supervisor/initscripts +* RedHat/Centos init script sourced from https://github.com/Supervisor/initscripts diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile index e00f7d11877..cd592af48f4 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/Rakefile @@ -1,7 +1,28 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' -require 'rspec-system/rake_task' +require 'puppet-syntax/tasks/puppet-syntax' PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_class_inherits_from_params_class') -PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_quoted_booleans') +PuppetLint.configuration.send('disable_autoloader_layout') + +exclude_paths = [ + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc "Acceptance Tests" +RSpec::Core::RakeTask.new(:acceptance) do |t| + t.pattern = 'spec/acceptance' +end + +desc "Test Suite" +task :test => [ + :lint, + :syntax, + :spec +] \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb index cfa52b2bbf2..6d34d5d5474 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/array2csv.rb @@ -1,14 +1,12 @@ # # Converts the array to a csv string # -# # $array = [ 'string1', 'string2', 'string3' ] # # becomes: # # $string = "string1,string2,string3" # - module Puppet::Parser::Functions newfunction(:array2csv, :type => :rvalue, :doc => <<-'EOS' Returns a sorted csv formatted string from an array in the form diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb index 6098b67367d..5371328f2ff 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/lib/puppet/parser/functions/hash2csv.rb @@ -1,7 +1,6 @@ # # Converts the hash to a csv string # -# # $hash = { # HOME => '/home/user', # ENV1 => 'env1', @@ -12,7 +11,6 @@ # # $string = "HOME='/home/user',ENV1='env1',SECRET='secret'" # - module Puppet::Parser::Functions newfunction(:hash2csv, :type => :rvalue, :doc => <<-'EOS' Returns a csv formatted string from an hash in the form diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp index cc8b1ee49d0..93713729e8b 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/config.pp @@ -1,6 +1,16 @@ +# Class: supervisord::config +# +# Configuration class for supervisor init and conf directories +# class supervisord::config inherits supervisord { - file { [ "${supervisord::config_include}", "${supervisord::log_path}"]: + file { $supervisord::config_include: + ensure => directory, + owner => 'root', + mode => '0755' + } + + file { $supervisord::log_path: ensure => directory, owner => 'root', mode => '0755' @@ -15,30 +25,26 @@ class supervisord::config inherits supervisord { } if $supervisord::install_init { - - $osname = downcase($::osfamily) - file { '/etc/init.d/supervisord': ensure => present, owner => 'root', mode => '0755', - content => template("supervisord/init/${osname}_init.erb") + content => template("supervisord/init/${::osfamily}/init.erb") } - if $supervisord::init_extras { - file { $supervisord::init_extras: + if $supervisord::init_defaults { + file { $supervisord::init_defaults: ensure => present, owner => 'root', mode => '0755', - content => template("supervisord/init/${osname}_extra.erb") + content => template("supervisord/init/${::osfamily}/defaults.erb") } } - } concat { $supervisord::config_file: owner => 'root', - group => 'root', + group => '0', mode => '0755' } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp index 41b7cf6c730..fd52d6e4da4 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/eventlistener.pp @@ -1,8 +1,16 @@ +# Define: supervisord::eventlistener +# +# This define creates an eventlistener configuration file +# +# Documentation on parameters available at: +# http://supervisord.org/configuration.html#eventlistener-x-section-settings +# define supervisord::eventlistener( $command, $ensure = present, + $ensure_process = 'running', + $buffer_size = 10, $events = undef, - $buffer_size = undef, $result_handler = undef, $env_var = undef, $process_name = undef, @@ -15,16 +23,16 @@ define supervisord::eventlistener( $startretries = undef, $exitcodes = undef, $stopsignal = undef, - $stopwaitsec = undef, + $stopwaitsecs = undef, $stopasgroup = undef, $killasgroup = undef, $user = undef, $redirect_stderr = undef, - $stdout_logfile = "${supervisord::log_path}/eventlistener_${name}.log", + $stdout_logfile = "eventlistener_${name}.log", $stdout_logfile_maxbytes = undef, $stdout_logfile_backups = undef, $stdout_events_enabled = undef, - $stderr_logfile = "${supervisord::log_path}/eventlistener_${name}.error", + $stderr_logfile = "eventlistener_${name}.error", $stderr_logfile_maxbytes = undef, $stderr_logfile_backups = undef, $stderr_events_enabled = undef, @@ -36,11 +44,45 @@ define supervisord::eventlistener( include supervisord + # parameter validation + validate_string($command) + validate_re($ensure_process, ['running', 'stopped', 'removed']) + validate_re($buffer_size, '^\d+') + if $events { validate_array($events) } + if $result_handler { validate_string($result_handler) } + if $numprocs { validate_re($numprocs, '^\d+')} + if $numprocs_start { validate_re($numprocs_start, '^\d+')} + if $priority { validate_re($priority, '^\d+') } + if $autostart { validate_bool($autostart) } + if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) } + if $startsecs { validate_re($startsecs, '^\d+')} + if $startretries { validate_re($startretries, '^\d+')} + if $exitcodes { validate_string($exitcodes)} + if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')} + if $stopasgroup { validate_bool($stopasgroup) } + if $killasgroup { validate_bool($killasgroup) } + if $user { validate_string($user) } + if $redirect_stderr { validate_bool($redirect_stderr) } + validate_string($stdout_logfile) + if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } + if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')} + if $stdout_events_enabled { validate_bool($stdout_events_enabled) } + validate_string($stderr_logfile) + if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } + if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')} + if $stderr_events_enabled { validate_bool($stderr_events_enabled) } + if $directory { validate_absolute_path($directory) } + if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } + + # convert environment data into a csv if $env_var { - $env_hash = hiera($env_var) + $env_hash = hiera_hash($env_var) + validate_hash($env_hash) $env_string = hash2csv($env_hash) } elsif $environment { + validate_hash($environment) $env_string = hash2csv($environment) } @@ -55,6 +97,22 @@ define supervisord::eventlistener( owner => 'root', mode => '0755', content => template('supervisord/conf/eventlistener.erb'), - notify => Class['supervisord::service'] + notify => Class['supervisord::reload'] + } + + case $ensure_process { + 'stopped': { + supervisord::supervisorctl { "stop_${name}": + command => 'stop', + process => $name + } + } + 'removed': { + supervisord::supervisorctl { "remove_${name}": + command => 'remove', + process => $name + } + } + default: { } } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp index 923b1798bff..633b024917e 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/fcgi_program.pp @@ -1,7 +1,15 @@ +# Define: supervisord::fcgi_program +# +# This define creates an eventlistener configuration file +# +# Documentation on parameters available at: +# http://supervisord.org/configuration.html#fcgi-program-x-section-settings +# define supervisord::fcgi_program( $command, $socket, $ensure = present, + $ensure_process = 'running', $socket_owner = undef, $socket_mode = undef, $env_var = undef, @@ -15,17 +23,17 @@ define supervisord::fcgi_program( $startretries = undef, $exitcodes = undef, $stopsignal = undef, - $stopwaitsec = undef, + $stopwaitsecs = undef, $stopasgroup = undef, $killasgroup = undef, $user = undef, $redirect_stderr = undef, - $stdout_logfile = "${supervisord::log_path}/fcgi-program_${name}.log", + $stdout_logfile = "fcgi-program_${name}.log", $stdout_logfile_maxbytes = undef, $stdout_logfile_backups = undef, $stdout_capture_maxbytes = undef, $stdout_events_enabled = undef, - $stderr_logfile = "${supervisord::log_path}/fcgi-program_${name}.error", + $stderr_logfile = "fcgi-program_${name}.error", $stderr_logfile_maxbytes = undef, $stderr_logfile_backups = undef, $stderr_capture_maxbytes = undef, @@ -38,11 +46,46 @@ define supervisord::fcgi_program( include supervisord + # parameter validation + validate_string($command) + validate_re($ensure_process, ['running', 'stopped', 'removed']) + validate_re($socket, ['^tcp:\/\/.*:\d+$', '^unix:\/\/\/']) + if $process_name { validate_string($process_name) } + if $numprocs { validate_re($numprocs, '^\d+')} + if $numprocs_start { validate_re($numprocs_start, '^\d+')} + if $priority { validate_re($priority, '^\d+') } + if $autostart { validate_bool($autostart) } + if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) } + if $startsecs { validate_re($startsecs, '^\d+')} + if $startretries { validate_re($startretries, '^\d+')} + if $exitcodes { validate_string($exitcodes)} + if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')} + if $stopasgroup { validate_bool($stopasgroup) } + if $killasgroup { validate_bool($killasgroup) } + if $user { validate_string($user) } + if $redirect_stderr { validate_bool($redirect_stderr) } + validate_string($stdout_logfile) + if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } + if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')} + if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) } + if $stdout_events_enabled { validate_bool($stdout_events_enabled) } + validate_string($stderr_logfile) + if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } + if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')} + if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) } + if $stderr_events_enabled { validate_bool($stderr_events_enabled) } + if $directory { validate_absolute_path($directory) } + if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } + + # convert environment data into a csv if $env_var { - $env_hash = hiera($env_var) + $env_hash = hiera_hash($env_var) + validate_hash($env_hash) $env_string = hash2csv($env_hash) } elsif $environment { + validate_hash($environment) $env_string = hash2csv($environment) } @@ -53,6 +96,22 @@ define supervisord::fcgi_program( owner => 'root', mode => '0755', content => template('supervisord/conf/fcgi_program.erb'), - notify => Class['supervisord::service'] + notify => Class['supervisord::reload'] + } + + case $ensure_process { + 'stopped': { + supervisord::supervisorctl { "stop_${name}": + command => 'stop', + process => $name + } + } + 'removed': { + supervisord::supervisorctl { "remove_${name}": + command => 'remove', + process => $name + } + } + default: { } } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp index 0f6b1ca2adc..45cb29cf290 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/group.pp @@ -1,3 +1,10 @@ +# Define: supervisord::group +# +# This define creates an group configuration file +# +# Documentation on parameters available at: +# http://supervisord.org/configuration.html#group-x-section-settings +# define supervisord::group ( $programs, $ensure = present, @@ -6,6 +13,10 @@ define supervisord::group ( include supervisord + # parameter validation + validate_array($programs) + if $priority { validate_re($priority, '^\d+', "invalid priority value of: ${priority}") } + $progstring = array2csv($programs) $conf = "${supervisord::config_include}/group_${name}.conf" @@ -13,6 +24,7 @@ define supervisord::group ( ensure => $ensure, owner => 'root', mode => '0755', - content => template('supervisord/conf/group.erb') + content => template('supervisord/conf/group.erb'), + notify => Class['supervisord::reload'] } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp index 801c46b3b36..1d2d55148d9 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/init.pp @@ -1,12 +1,18 @@ -# This class installs supervisord and configured it to run on boot +# Class: supervisord +# +# This class installs supervisord via pip +# class supervisord( $package_ensure = $supervisord::params::package_ensure, + $package_provider = $supervisord::params::package_provider, $service_ensure = $supervisord::params::service_ensure, + $service_name = $supervisord::params::service_name, $install_init = $supervisord::params::install_init, $install_pip = false, - $init_extras = $supervisord::params::init_extras, + $init_defaults = $supervisord::params::init_defaults, $setuptools_url = $supervisord::params::setuptools_url, $executable = $supervisord::params::executable, + $executable_ctl = $supervisord::params::executable_ctl, $log_path = $supervisord::params::log_path, $log_file = $supervisord::params::log_file, @@ -19,20 +25,20 @@ class supervisord( $nodaemon = $supervisord::params::nodaemon, $minfds = $supervisord::params::minfds, $minprocs = $supervisord::params::minprocs, - $config_path = $supervisord::params::config_path, $config_include = $supervisord::params::config_include, $config_file = $supervisord::params::config_file, + $config_dirs = undef, $umask = $supervisord::params::umask, $unix_socket = $supervisord::params::unix_socket, $unix_socket_file = $supervisord::params::unix_socket_file, $unix_socket_mode = $supervisord::params::unix_socket_mode, $unix_socket_owner = $supervisord::params::unix_socket_owner, - $unix_scoket_group = $supervisord::params::unix_socket_group, + $unix_socket_group = $supervisord::params::unix_socket_group, $inet_server = $supervisord::params::inet_server, - $inet_server_hostname = $supervisord::params::inet_hostname, - $inet_server_port = $supervisord::params::inet_port, + $inet_server_hostname = $supervisord::params::inet_server_hostname, + $inet_server_port = $supervisord::params::inet_server_port, $unix_auth = false, $unix_username = undef, @@ -47,26 +53,76 @@ class supervisord( $childlogdir = undef, $environment = undef, $env_var = undef, + $directory = undef, $strip_ansi = false, - $nocleanup = false + $nocleanup = false, + + $eventlisteners = {}, + $fcgi_programs = {}, + $groups = {}, + $programs = {} ) inherits supervisord::params { + validate_bool($install_pip) + validate_bool($install_init) + validate_bool($nodaemon) + validate_bool($unix_auth) + validate_bool($inet_auth) + validate_bool($strip_ansi) + validate_bool($nocleanup) + + validate_hash($eventlisteners) + validate_hash($fcgi_programs) + validate_hash($groups) + validate_hash($programs) + + validate_absolute_path($config_include) + validate_absolute_path($log_path) + validate_absolute_path($run_path) + if $childlogdir { validate_absolute_path($childlogdir) } + if $directory { validate_absolute_path($directory) } + + $log_levels = ['^critical$', '^error$', '^warn$', '^info$', '^debug$', '^trace$', '^blather$'] + validate_re($log_level, $log_levels, "invalid log_level: ${log_level}") + validate_re($umask, '^0[0-7][0-7]$', "invalid umask: ${umask}.") + validate_re($unix_socket_mode, '^[0-7][0-7][0-7][0-7]$', "invalid unix_socket_mode: ${unix_socket_mode}") + + if ! is_integer($logfile_backups) { fail("invalid logfile_backups: ${logfile_backups}.")} + if ! is_integer($minfds) { fail("invalid minfds: ${minfds}.")} + if ! is_integer($minprocs) { fail("invalid minprocs: ${minprocs}.")} + if ! is_integer($inet_server_port) { fail("invalid inet_server_port: ${inet_server_port}.")} + if $env_var { + validate_hash($env_var) $env_hash = hiera($env_var) $env_string = hash2csv($env_hash) } elsif $environment { + validate_hash($environment) $env_string = hash2csv($environment) } + if $config_dirs { + validate_array($config_dirs) + $config_include_string = join($config_dirs, " ") + } + else { + $config_include_string = "${config_include}/*.conf" + } + + create_resources('supervisord::eventlistener', $eventlisteners) + create_resources('supervisord::fcgi_program', $fcgi_programs) + create_resources('supervisord::group', $groups) + create_resources('supervisord::program', $programs) + if $install_pip { include supervisord::pip Class['supervisord::pip'] -> Class['supervisord::install'] } - include supervisord::install, supervisord::config, supervisord::service + include supervisord::install, supervisord::config, supervisord::service, supervisord::reload Class['supervisord::install'] -> Class['supervisord::config'] ~> Class['supervisord::service'] - + Class['supervisord::reload'] -> Supervisord::Supervisorctl <| |> } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp index 1d36ec68334..31a63f3b59e 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/install.pp @@ -1,6 +1,10 @@ +# Class supervisord::install +# +# Installs supervisor package (defaults to using pip) +# class supervisord::install inherits supervisord { package { 'supervisor': ensure => $supervisord::package_ensure, - provider => 'pip' + provider => $supervisord::package_provider } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp index 87d17d16179..f9d82e5804b 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp @@ -1,13 +1,21 @@ +# Class: supervisord::params +# +# Default parameters for supervisord +# class supervisord::params { + # default supervisord params $package_ensure = 'installed' + $package_provider = 'pip' $service_ensure = 'running' + $service_name = 'supervisord' $package_name = 'supervisor' - $executable = '/usr/local/bin/supervisord' + $executable = 'supervisord' + $executable_ctl = 'supervisorctl' $run_path = '/var/run' - $pid_file = "${run_path}/supervisord.pid" + $pid_file = 'supervisord.pid' $log_path = '/var/log/supervisor' - $log_file = "${log_path}/supervisord.log" + $log_file = 'supervisord.log' $logfile_maxbytes = '50MB' $logfile_backups = '10' $log_level = 'info' @@ -20,7 +28,7 @@ class supervisord::params { $setuptools_url = 'https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py' $unix_socket = true - $unix_socket_file = "${run_path}/supervisor.sock" + $unix_socket_file = 'supervisor.sock' $unix_socket_mode = '0700' $unix_socket_owner = 'nobody' @@ -31,17 +39,17 @@ class supervisord::params { case $::osfamily { 'RedHat': { - $init_extras = '/etc/sysconfig/supervisord' + $init_defaults = '/etc/sysconfig/supervisord' $unix_socket_group = 'nobody' $install_init = true } 'Debian': { - $init_extras = '/etc/default/supervisor' + $init_defaults = '/etc/default/supervisor' $unix_socket_group = 'nogroup' $install_init = true } default: { - $init_extras = false + $init_defaults = false $unix_socket_group = 'nogroup' $install_init = false } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp index c05f2d7f64b..71dd3653da3 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp @@ -1,8 +1,10 @@ +# Class: supervisord::pip +# +# Optional class to install setuptool and pip +# class supervisord::pip inherits supervisord { - Exec { - path => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin' - } + Exec { path => [ '/usr/bin/', '/usr/local/bin', '/bin', '/usr/local/sbin', '/usr/sbin', '/sbin' ] } exec { 'install_setuptools': command => "curl ${supervisord::setuptools_url} | python", diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp index 8a00d41c77c..617a68ab208 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/program.pp @@ -1,6 +1,14 @@ +# Define: supervisord::program +# +# This define creates an program configuration file +# +# Documentation on parameters available at: +# http://supervisord.org/configuration.html#program-x-section-settings +# define supervisord::program( $command, $ensure = present, + $ensure_process = 'running', $env_var = undef, $process_name = undef, $numprocs = undef, @@ -12,17 +20,17 @@ define supervisord::program( $startretries = undef, $exitcodes = undef, $stopsignal = undef, - $stopwaitsec = undef, + $stopwaitsecs = undef, $stopasgroup = undef, $killasgroup = undef, $user = undef, $redirect_stderr = undef, - $stdout_logfile = "${supervisord::log_path}/program_${name}.log", + $stdout_logfile = "program_${name}.log", $stdout_logfile_maxbytes = undef, $stdout_logfile_backups = undef, $stdout_capture_maxbytes = undef, $stdout_events_enabled = undef, - $stderr_logfile = "${supervisord::log_path}/program_${name}.error", + $stderr_logfile = "program_${name}.error", $stderr_logfile_maxbytes = undef, $stderr_logfile_backups = undef, $stderr_capture_maxbytes = undef, @@ -35,11 +43,45 @@ define supervisord::program( include supervisord + # parameter validation + validate_string($command) + validate_re($ensure_process, ['running', 'stopped', 'removed']) + if $process_name { validate_string($process_name) } + if $numprocs { validate_re($numprocs, '^\d+')} + if $numprocs_start { validate_re($numprocs_start, '^\d+')} + if $priority { validate_re($priority, '^\d+') } + if $autostart { validate_bool($autostart) } + if $autorestart { validate_re($autorestart, ['true', 'false', 'unexpected']) } + if $startsecs { validate_re($startsecs, '^\d+')} + if $startretries { validate_re($startretries, '^\d+')} + if $exitcodes { validate_string($exitcodes)} + if $stopsignal { validate_re($stopsignal, ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']) } + if $stopwaitsecs { validate_re($stopwaitsecs, '^\d+')} + if $stopasgroup { validate_bool($stopasgroup) } + if $killasgroup { validate_bool($killasgroup) } + if $user { validate_string($user) } + if $redirect_stderr { validate_bool($redirect_stderr) } + validate_string($stdout_logfile) + if $stdout_logfile_maxbytes { validate_string($stdout_logfile_maxbytes) } + if $stdout_logfile_backups { validate_re($stdout_logfile_backups, '^\d+')} + if $stdout_capture_maxbytes { validate_string($stdout_capture_maxbytes) } + if $stdout_events_enabled { validate_bool($stdout_events_enabled) } + validate_string($stderr_logfile) + if $stderr_logfile_maxbytes { validate_string($stderr_logfile_maxbytes) } + if $stderr_logfile_backups { validate_re($stderr_logfile_backups, '^\d+')} + if $stderr_capture_maxbytes { validate_string($stderr_capture_maxbytes) } + if $stderr_events_enabled { validate_bool($stderr_events_enabled) } + if $directory { validate_absolute_path($directory) } + if $umask { validate_re($umask, '^[0-7][0-7][0-7]$') } + + # convert environment data into a csv if $env_var { - $env_hash = hiera($env_var) + $env_hash = hiera_hash($env_var) + validate_hash($env_hash) $env_string = hash2csv($env_hash) } elsif $environment { + validate_hash($environment) $env_string = hash2csv($environment) } @@ -50,6 +92,22 @@ define supervisord::program( owner => 'root', mode => '0755', content => template('supervisord/conf/program.erb'), - notify => Class['supervisord::service'] + notify => Class['supervisord::reload'] + } + + case $ensure_process { + 'stopped': { + supervisord::supervisorctl { "stop_${name}": + command => 'stop', + process => $name + } + } + 'removed': { + supervisord::supervisorctl { "remove_${name}": + command => 'remove', + process => $name + } + } + default: { } } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp new file mode 100644 index 00000000000..e5a4637e430 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp @@ -0,0 +1,21 @@ +# Class: supervisord::reload +# +# Class to reread and update supervisord with supervisorctl +# +class supervisord::reload { + + Exec { path => [ '/usr/bin/', '/usr/local/bin' ] } + + $supervisorctl = $::supervisord::executable_ctl + + exec { 'supervisorctl_reread': + command => "${supervisorctl} reread", + refreshonly => true, + returns => [0, 2], + } + exec { 'supervisorctl_update': + command => "${supervisorctl} update", + refreshonly => true, + returns => [0, 2], + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp index 6e17976165d..f02a0d0a081 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/service.pp @@ -1,5 +1,9 @@ +# Class: supervisord::service +# +# Class for the supervisord service +# class supervisord::service inherits supervisord { - service { 'supervisord': + service { $supervisord::service_name: ensure => $supervisord::service_ensure, enable => true, hasrestart => true, diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp new file mode 100644 index 00000000000..ec4dbed9337 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp @@ -0,0 +1,29 @@ +# Define: supervisord:supervisorctl +# +# This define executes command with the supervisorctl tool +# +define supervisord::supervisorctl( + $command, + $process = undef, + $refreshonly = false +) { + + Exec { path => [ '/usr/bin/', '/usr/local/bin' ] } + + validate_string($command) + validate_string($process) + + $supervisorctl = $::supervisord::executable_ctl + + if $process { + $cmd = join([$supervisorctl, $command, $process], ' ') + } + else { + $cmd = join([$supervisorctl, $command]) + } + + exec { "supervisorctl_command_${name}": + command => $cmd, + refreshonly => $refreshonly + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml new file mode 100644 index 00000000000..f8d4013a31b --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-i386.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-65-i386: + roles: + - master + platform: el-6-i386 + box : centos-65-i386-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-i386-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml new file mode 100644 index 00000000000..7535c104afb --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/centos-65-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + centos-65-x64: + roles: + - master + platform: el-6-x86_64 + box : centos-65-x64-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml new file mode 100644 index 00000000000..d1233aa83d1 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-i386.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-73-i386: + roles: + - master + platform: debian-7-i386 + box : debian-73-i386-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-i386-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml new file mode 100644 index 00000000000..5b87870a909 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/debian-73-x64.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-73-x64: + roles: + - master + platform: debian-7-amd64 + box : debian-73-x64-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml new file mode 100644 index 00000000000..5b87870a909 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/nodesets/default.yml @@ -0,0 +1,10 @@ +HOSTS: + debian-73-x64: + roles: + - master + platform: debian-7-amd64 + box : debian-73-x64-virtualbox-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box + hypervisor : vagrant +CONFIG: + type: foss diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb new file mode 100644 index 00000000000..47d052a4eec --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/acceptance/supervisord_spec.rb @@ -0,0 +1,114 @@ +require 'spec_helper_acceptance' + +describe 'supervisord install' do + + context 'default parameters with pip and init install' do + it 'should work with no errors' do + pp = <<-EOS + class { 'supervisord': install_pip => true, install_init => true} + EOS + + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to eq(0) + end + + describe service('supervisord') do + it { should be_enabled } + it { should be_running } + it 'should restart successfully' do + cmd="service supervisord restart" + expect(shell(cmd).exit_code).to_not eq(1) + end + end + end +end + +describe 'supervisord::program' do + context 'create a program config' do + it 'should install a program file' do + + pp = <<-EOS + include supervisord + supervisord::program { 'test': + command => 'echo', + priority => '100', + environment => { + 'HOME' => '/root', + 'PATH' => '/bin', + } + } + EOS + + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to eq(0) + end + + it 'should contain the correct values' do + cmd='grep command=echo /etc/supervisor.d/program_test.conf' + expect(shell(cmd).exit_code).to eq(0) + cmd='grep priority=100 /etc/supervisor.d/program_test.conf' + expect(shell(cmd).exit_code).to eq(0) + cmd='grep "environment=" /etc/supervisor.d/program_test.conf' + expect(shell(cmd).exit_code).to eq(0) + end + end +end + +describe 'supervisord::fcgi-program' do + context 'create fcgi-program config' do + it 'should install a fcgi-program file' do + + pp = <<-EOS + include supervisord + supervisord::fcgi_program { 'test': + socket => 'tcp://localhost:1000', + command => 'echo', + priority => '100', + environment => { + 'HOME' => '/root', + 'PATH' => '/bin', + } + } + EOS + + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to eq(0) + end + + it 'should contain the correct values' do + cmd='grep socket=tcp://localhost:1000 /etc/supervisor.d/fcgi-program_test.conf' + expect(shell(cmd).exit_code).to eq(0) + cmd="grep command=echo /etc/supervisor.d/fcgi-program_test.conf" + expect(shell(cmd).exit_code).to eq(0) + cmd="grep priority=100 /etc/supervisor.d/fcgi-program_test.conf" + expect(shell(cmd).exit_code).to eq(0) + cmd='grep "environment=" /etc/supervisor.d/fcgi-program_test.conf' + expect(shell(cmd).exit_code).to eq(0) + end + end +end + +describe 'supervisord::group' do + context 'create group config' do + it 'should install a group config' do + + pp = <<-EOS + include supervisord + supervisord::group { 'test': + programs => ['test'], + priority => '100', + } + EOS + + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to eq(0) + end + + it 'should contain the correct values' do + cmd='grep "programs=test" /etc/supervisor.d/group_test.conf' + expect(shell(cmd).exit_code).to eq(0) + cmd="grep priority=100 /etc/supervisor.d/group_test.conf" + expect(shell(cmd).exit_code).to eq(0) + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb index 238876c7dcd..b845920f6fe 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/classes/supervisord_spec.rb @@ -3,14 +3,26 @@ require 'spec_helper' describe 'supervisord' do concatdir = '/var/lib/puppet/concat' - configfile = '/etc/supervisord.conf' let(:facts) {{ :concat_basedir => concatdir }} it { should contain_class('supervisord') } it { should contain_class('supervisord::install') } it { should contain_class('supervisord::config') } it { should contain_class('supervisord::service') } - it { should contain_concat__fragment('supervisord_main').with_content(/logfile/) } + it { should contain_class('supervisord::params') } + it { should contain_class('supervisord::reload') } + it { should contain_package('supervisor') } + + describe '#service_name' do + context 'default' do + it { should contain_service('supervisord') } + end + + context 'specified' do + let(:params) {{ :service_name => 'myservicename' }} + it { should contain_service('myservicename') } + end + end describe '#install_pip' do context 'default' do @@ -18,8 +30,16 @@ describe 'supervisord' do end context 'true' do - let (:params) {{ :install_pip => true }} + let(:params) {{ :install_pip => true }} it { should contain_class('supervisord::pip') } + it { should contain_exec('install_setuptools') } + it { should contain_exec('install_pip') } + end + + context 'true and RedHat' do + let(:params) {{ :install_pip => true }} + let(:facts) {{ :osfamily => 'RedHat', :concat_basedir => concatdir }} + it { should contain_exec('pip_provider_name_fix') } end end @@ -28,11 +48,6 @@ describe 'supervisord' do it { should contain_class('supervisord').without_env_hash } it { should contain_class('supervisord').without_env_string } end - #context 'is specified' do - # let(:params) {{ :env_var => 'foovars' }} - # let(:hiera_data) {{ :foovars => { 'key1' => 'value1', 'key2' => 'value2' } }} - # it { should contain_concat__fragment('supervisord_main').with_content(/environment=key1='value1',key2='value2'/) } - #end end describe '#environment' do @@ -41,7 +56,8 @@ describe 'supervisord' do end context 'is specified' do let(:params) {{ :environment => { 'key1' => 'value1', 'key2' => 'value2' } }} - it { should contain_concat__fragment('supervisord_main').with_content(/environment=key1='value1',key2='value2'/) } + it { should contain_concat__fragment('supervisord_main')\ + .with_content(/environment=key1='value1',key2='value2'/) } end end @@ -54,17 +70,20 @@ describe 'supervisord' do it { should_not contain_file('/etc/init.d/supervisord') } end - describe 'on supported OS' + describe 'on supported OS' do context 'with Debian' do let(:facts) {{ :osfamily => 'Debian', :concat_basedir => concatdir }} it { should contain_file('/etc/init.d/supervisord') } + it { should contain_file('/etc/default/supervisor') } end context 'with RedHat' do let(:facts) {{ :osfamily => 'RedHat', :concat_basedir => concatdir }} it { should contain_file('/etc/init.d/supervisord') } + it { should contain_file('/etc/sysconfig/supervisord') } end end + end describe '#unix_socket' do context 'default' do @@ -89,10 +108,192 @@ describe 'supervisord' do describe '#run_path' do context 'default' do it { should_not contain_file('/var/run') } + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/pidfile=\/var\/run\/supervisord.pid$/) } end - context 'custom setting' do - let(:params) {{ :run_path => '/var/run/supervisord'}} - it { should contain_file('/var/run/supervisord') } + context 'is specified' do + let(:params) {{ :run_path => '/opt/supervisord/run' }} + it { should contain_file('/opt/supervisord/run') } + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/pidfile=\/opt\/supervisord\/run\/supervisord.pid$/) } + end + end + + describe '#log_path' do + context 'default' do + it { should contain_file('/var/log/supervisor') } + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/logfile=\/var\/log\/supervisor\/supervisord.log$/) } + end + context 'is specified' do + let(:params) {{ :log_path => '/opt/supervisord/logs' }} + it { should contain_file('/opt/supervisord/logs')} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/logfile=\/opt\/supervisord\/logs\/supervisord.log$/) } + end + end + + describe '#config_include' do + context 'default' do + it { should contain_file('/etc/supervisor.d') } + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/files=\/etc\/supervisor.d\/\*.conf$/) } + end + context 'is specified' do + let(:params) {{ :config_include => '/opt/supervisord/conf.d' }} + it { should contain_file('/opt/supervisord/conf.d') } + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/files=\/opt\/supervisord\/conf.d\/\*.conf$/) } + end + end + + describe '#config_dirs' do + context 'is specified' do + let(:params) {{ :config_dirs => ['/etc/supervisor.d/*.conf', '/opt/supervisor.d/*', '/usr/share/supervisor.d/*.config'] }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/files=\/etc\/supervisor.d\/\*.conf \/opt\/supervisor.d\/\* \/usr\/share\/supervisor.d\/\*.config$/) } + end + end + + describe '#config_file' do + context 'default' do + it { should contain_file('/etc/supervisord.conf') } + end + context 'is specified' do + let(:params) {{ :config_file => '/opt/supervisord/supervisor.conf' }} + it { should contain_file('/opt/supervisord/supervisor.conf') } + end + end + + describe '#nodaemon' do + context 'default' do + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/nodaemon=false$/) } + end + context 'true' do + let(:params) {{ :nodaemon => true }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/nodaemon=true$/) } + end + context 'invalid' do + let(:params) {{ :nodaemon => 'invalid' }} + it { expect { raise_error(Puppet::Error, /is not a boolean/) }} + end + end + + describe '#minfds' do + context 'default' do + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/minfds=1024$/) } + end + context 'specified' do + let(:params) {{ :minfds => 2048 }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/minfds=2048$/) } + end + context 'invalid' do + let(:params) {{ :minfds => 'string' }} + it { expect { raise_error(Puppet::Error, /invalid minfds/) }} + end + end + + describe '#minprocs' do + context 'default' do + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/minprocs=200$/) } + end + context 'specified' do + let(:params) {{ :minprocs => 300 }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/minprocs=300$/) } + end + context 'invalid' do + let(:params) {{ :minfds => 'string' }} + it { expect { raise_error(Puppet::Error, /invalid minprocs/) }} + end + end + + describe '#strip_ansi' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/strip_ansi$/) } + end + context 'true' do + let(:params) {{ :strip_ansi => true }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/strip_ansi=true$/) } + end + context 'invalid' do + let(:params) {{ :strip_ansi => 'string' }} + it { expect { raise_error(Puppet::Error, /is not a boolean/) }} + end + end + + describe '#user' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/user$/) } + end + context 'specified' do + let(:params) {{ :user => 'myuser' }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/user=myuser$/) } + end + end + + describe '#identifier' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/identifier$/) } + end + context 'specified' do + let(:params) {{ :identifier => 'myidentifier' }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/identifier=myidentifier$/) } + end + end + + describe '#directory' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/directory$/) } + end + context 'specified' do + let(:params) {{ :directory => '/opt/supervisord' }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/directory=\/opt\/supervisord$/) } + end + end + + describe '#nocleanup' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/nocleanup$/) } + end + context 'true' do + let(:params) {{ :nocleanup => true }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/nocleanup=true$/) } + end + context 'invalid' do + let(:params) {{ :nocleanup => 'string' }} + it { expect { raise_error(Puppet::Error, /is not a boolean/) }} + end + end + + describe '#childlogdir' do + context 'default' do + it { should_not contain_concat__fragment('supervisord_main') \ + .with_content(/childlogdir$/) } + end + context 'specified' do + let(:params) {{ :childlogdir => '/opt/supervisord/logdir' }} + it { should contain_concat__fragment('supervisord_main') \ + .with_content(/childlogdir=\/opt\/supervisord\/logdir$/) } + end + context 'invalid' do + let(:params) {{ :childlogdir => 'not_a_path' }} + it { expect { raise_error(Puppet::Error, /is not an absolute path/) }} end end end \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb index 6e04f44f97b..1083b8a3230 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/eventlistener_spec.rb @@ -2,14 +2,85 @@ require 'spec_helper' describe 'supervisord::eventlistener', :type => :define do let(:title) {'foo'} - let(:default_params) {{ :command => 'bar', - :stdout_logfile => '/var/log/supervisor/eventlistener_foo.log', - :stderr_logfile => '/var/log/supervisor/eventlistener_foo.error', - }} - let(:params) { default_params } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }} + let(:default_params) do + { + :command => 'bar', + :process_name => '%(process_num)s', + :events => ['PROCESS_STATE', 'PROCESS_STATE_STARTING'], + :buffer_size => 10, + :numprocs => '1', + :numprocs_start => '0', + :priority => '999', + :autostart => true, + :autorestart => 'unexpected', + :startsecs => '1', + :startretries => '3', + :exitcodes => '0,2', + :stopsignal => 'TERM', + :stopwaitsecs => '10', + :stopasgroup => true, + :killasgroup => true, + :user => 'baz', + :redirect_stderr => true, + :stdout_logfile => 'eventlistener_foo.log', + :stdout_logfile_maxbytes => '50MB', + :stdout_logfile_backups => '10', + :stdout_events_enabled => true, + :stderr_logfile => 'eventlistener_foo.error', + :stderr_logfile_maxbytes => '50MB', + :stderr_logfile_backups => '10', + :stderr_events_enabled => true, + :environment => { 'env1' => 'value1', 'env2' => 'value2' }, + :directory => '/opt/supervisord/chroot', + :umask => '022', + :serverurl => 'AUTO' + } + end - it { should contain_supervisord__eventlistener('foo') } - it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/command=bar/) } + context 'default' do + let(:params) { default_params } + it { should contain_supervisord__eventlistener('foo') } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/\[eventlistener:foo\]/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/command=bar/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/process_name=\%\(process_num\)s/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/events=PROCESS_STATE,PROCESS_STATE_STARTING/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/buffer_size=10/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/numprocs=1/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/numprocs_start=0/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/priority=999/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/autostart=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/startsecs=1/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/startretries=3/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/exitcodes=0,2/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopsignal=TERM/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopwaitsecs=10/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stopasgroup=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/killasgroup=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/user=baz/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/redirect_stderr=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/eventlistener_foo.log/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stdout_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/eventlistener_foo.error/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/stderr_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/environment=env1='value1',env2='value2'/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/umask=022/) } + it { should contain_file('/etc/supervisor.d/eventlistener_foo.conf').with_content(/serverurl=AUTO/) } + end + + context 'ensure_process_stopped' do + let(:params) { default_params.merge({ :ensure_process => 'stopped' }) } + it { should contain_supervisord__supervisorctl('stop_foo') } + end + + context 'ensure_process_removed' do + let(:params) { default_params.merge({ :ensure_process => 'removed' }) } + it { should contain_supervisord__supervisorctl('remove_foo') } + end end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb index 7fd8ab07b86..e01311be70d 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/fcgi_program_spec.rb @@ -2,21 +2,87 @@ require 'spec_helper' describe 'supervisord::fcgi_program', :type => :define do let(:title) {'foo'} - let(:default_params) {{ :command => 'bar', - :socket => 'tcp://localhost:1000', - :stdout_logfile => '/var/log/supervisor/fcgi-program_foo.log', - :stderr_logfile => '/var/log/supervisor/fcgi-program_foo.error', - :user => 'baz' - }} - let(:params) { default_params } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }} + let(:default_params) do + { + :command => 'bar', + :socket => 'tcp://localhost:1000', + :process_name => '%(process_num)s', + :numprocs => '1', + :numprocs_start => '0', + :priority => '999', + :autostart => true, + :autorestart => 'unexpected', + :startsecs => '1', + :startretries => '3', + :exitcodes => '0,2', + :stopsignal => 'TERM', + :stopwaitsecs => '10', + :stopasgroup => true, + :killasgroup => true, + :user => 'baz', + :redirect_stderr => true, + :stdout_logfile => 'fcgi-program_foo.log', + :stdout_logfile_maxbytes => '50MB', + :stdout_logfile_backups => '10', + :stdout_capture_maxbytes => '0', + :stdout_events_enabled => true, + :stderr_logfile => 'fcgi-program_foo.error', + :stderr_logfile_maxbytes => '50MB', + :stderr_logfile_backups => '10', + :stderr_capture_maxbytes => '0', + :stderr_events_enabled => true, + :environment => { 'env1' => 'value1', 'env2' => 'value2' }, + :directory => '/opt/supervisord/chroot', + :umask => '022', + :serverurl => 'AUTO' + } + end - it { should contain_supervisord__fcgi_program('foo') } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/\[fcgi-program:foo\]/) } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/socket=tcp:\/\/localhost:1000/) } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/command=bar/) } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/user=baz/) } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/fcgi-program_foo.log/) } - it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/fcgi-program_foo.error/) } + context 'default' do + let(:params) { default_params } + it { should contain_supervisord__fcgi_program('foo') } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/\[fcgi-program:foo\]/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/socket=tcp:\/\/localhost:1000/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/command=bar/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/process_name=\%\(process_num\)s/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/numprocs=1/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/numprocs_start=0/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/priority=999/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/autostart=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/startsecs=1/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/startretries=3/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/exitcodes=0,2/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopsignal=TERM/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopwaitsecs=10/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stopasgroup=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/killasgroup=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/user=baz/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/redirect_stderr=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/fcgi-program_foo.log/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_capture_maxbytes=0/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stdout_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/fcgi-program_foo.error/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_capture_maxbytes=0/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/stderr_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/environment=env1='value1',env2='value2'/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/umask=022/) } + it { should contain_file('/etc/supervisor.d/fcgi-program_foo.conf').with_content(/serverurl=AUTO/) } + end + + context 'ensure_process_stopped' do + let(:params) { default_params.merge({ :ensure_process => 'stopped' }) } + it { should contain_supervisord__supervisorctl('stop_foo') } + end + + context 'ensure_process_removed' do + let(:params) { default_params.merge({ :ensure_process => 'removed' }) } + it { should contain_supervisord__supervisorctl('remove_foo') } + end end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb index 077828bdfcf..e32c24ab2d5 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/program_spec.rb @@ -2,19 +2,85 @@ require 'spec_helper' describe 'supervisord::program', :type => :define do let(:title) {'foo'} - let(:default_params) {{ :command => 'bar', - :stdout_logfile => '/var/log/supervisor/program_foo.log', - :stderr_logfile => '/var/log/supervisor/program_foo.error', - :user => 'baz' - }} - let(:params) { default_params } let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }} + let(:default_params) do + { + :command => 'bar', + :process_name => '%(process_num)s', + :numprocs => '1', + :numprocs_start => '0', + :priority => '999', + :autostart => true, + :autorestart => 'unexpected', + :startsecs => '1', + :startretries => '3', + :exitcodes => '0,2', + :stopsignal => 'TERM', + :stopwaitsecs => '10', + :stopasgroup => true, + :killasgroup => true, + :user => 'baz', + :redirect_stderr => true, + :stdout_logfile => 'program_foo.log', + :stdout_logfile_maxbytes => '50MB', + :stdout_logfile_backups => '10', + :stdout_capture_maxbytes => '0', + :stdout_events_enabled => true, + :stderr_logfile => 'program_foo.error', + :stderr_logfile_maxbytes => '50MB', + :stderr_logfile_backups => '10', + :stderr_capture_maxbytes => '0', + :stderr_events_enabled => true, + :environment => { 'env1' => 'value1', 'env2' => 'value2' }, + :directory => '/opt/supervisord/chroot', + :umask => '022', + :serverurl => 'AUTO' + } + end - it { should contain_supervisord__program('foo') } - it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/\[program:foo\]/) } - it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/command=bar/) } - it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/user=baz/) } - it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/program_foo.log/) } - it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/program_foo.error/) } + context 'default' do + let(:params) { default_params } + it { should contain_supervisord__program('foo') } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/\[program:foo\]/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/command=bar/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/process_name=\%\(process_num\)s/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/numprocs=1/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/numprocs_start=0/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/priority=999/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/autostart=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/startsecs=1/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/startretries=3/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/exitcodes=0,2/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopsignal=TERM/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopwaitsecs=10/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stopasgroup=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/killasgroup=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/user=baz/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/redirect_stderr=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile=\/var\/log\/supervisor\/program_foo.log/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_capture_maxbytes=0/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stdout_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile=\/var\/log\/supervisor\/program_foo.error/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile_maxbytes=50MB/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_logfile_backups=10/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_capture_maxbytes=0/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/stderr_events_enabled=true/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/environment=env1='value1',env2='value2'/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/directory=\/opt\/supervisord\/chroot/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/umask=022/) } + it { should contain_file('/etc/supervisor.d/program_foo.conf').with_content(/serverurl=AUTO/) } + end + + context 'ensure_process_stopped' do + let(:params) { default_params.merge({ :ensure_process => 'stopped' }) } + it { should contain_supervisord__supervisorctl('stop_foo') } + end + + context 'ensure_process_removed' do + let(:params) { default_params.merge({ :ensure_process => 'removed' }) } + it { should contain_supervisord__supervisorctl('remove_foo') } + end end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb new file mode 100644 index 00000000000..33cfd75efe9 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/defines/supervisorctl.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +describe 'supervisord::supervisorctl', :type => :define do + let(:title) {'command_foo'} + let(:default_params) {{ + :command => 'command', + :process => 'foo' + }} + let(:params) { default_params } + let(:facts) {{ :concat_basedir => '/var/lib/puppet/concat' }} + + it { should contain_supervisord__supervisorctl('command_foo') } +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb index 644f7c33ac0..745ad4a5493 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper.rb @@ -7,3 +7,4 @@ RSpec.configure do |c| c.manifest_dir = File.join(fixture_path, 'manifests') end +at_exit { RSpec::Puppet::Coverage.report! } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb new file mode 100644 index 00000000000..dcae2850d27 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_acceptance.rb @@ -0,0 +1,24 @@ +require 'beaker-rspec' + +hosts.each do |host| + # Install Puppet + install_puppet +end + +RSpec.configure do |c| + # Project root + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + + # Readable test descriptions + c.formatter = :documentation + + # Configure all nodes in nodeset + c.before :suite do + # Install module + puppet_module_install(:source => proj_root, :module_name => 'supervisord') + hosts.each do |host| + on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] } + on host, puppet('module','install','puppetlabs-concat'), { :acceptable_exit_codes => [0,1] } + end + end +end \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb deleted file mode 100644 index a790d7d526c..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/spec_helper_system.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'rspec-system/spec_helper' -require 'rspec-system-puppet/helpers' - -include RSpecSystemPuppet::Helpers - -RSpec.configure do |c| - # Project root - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - - # Enable colour - c.tty = true - - # This is where we 'setup' the nodes before running our tests - c.before :suite do - # Install puppet - puppet_install - puppet_master_install - - # Replace mymodule with your module name - puppet_module_install(:source => proj_root, :module_name => 'supervisord') - shell('puppet module install puppetlabs/stdlib') - shell('puppet module install puppetlabs/concat') - - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb deleted file mode 100644 index 62cf7dd8c2e..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/spec/system/basic_spec.rb +++ /dev/null @@ -1,120 +0,0 @@ -require 'spec_helper_system' - -describe 'basic install' do - - it 'class should work with no errors' do - pp = <<-EOS - class { 'supervisord': install_pip => true, install_init => true} - EOS - - puppet_apply(pp) do |r| - r.exit_code.should_not == 1 - r.refresh - r.exit_code.should be_zero - end - - shell("pgrep supervisord") do |r| - r.exit_code.should be_zero - end - - end -end - -describe 'add a program config' do - - it 'supervisord::program should install a program config' do - - pp = <<-EOS - include supervisord - supervisord::program { 'test': - command => 'echo', - priority => '100', - environment => { - 'HOME' => '/root', - 'PATH' => '/bin', - } - } - EOS - - puppet_apply(pp) do |r| - r.exit_code.should_not == 1 - r.refresh - r.exit_code.should be_zero - end - - shell("grep command=echo /etc/supervisor.d/program_test.conf") do |r| - r.exit_code.should be_zero - end - shell("grep priority=100 /etc/supervisor.d/program_test.conf") do |r| - r.exit_code.should be_zero - end - shell('grep "environment=" /etc/supervisor.d/program_test.conf') do |r| - r.exit_code.should be_zero - end - end -end - -describe 'add a fcgi-program config' do - - it 'supervisord::fcgi_program should install a program config' do - - pp = <<-EOS - include supervisord - supervisord::fcgi_program { 'test': - socket => 'tcp://localhost:1000', - command => 'echo', - priority => '100', - environment => { - 'HOME' => '/root', - 'PATH' => '/bin', - } - } - EOS - - puppet_apply(pp) do |r| - r.exit_code.should_not == 1 - r.refresh - r.exit_code.should be_zero - end - - shell("grep socket=tcp://localhost:1000 /etc/supervisor.d/fcgi-program_test.conf") do |r| - r.exit_code.should be_zero - end - shell("grep command=echo /etc/supervisor.d/fcgi-program_test.conf") do |r| - r.exit_code.should be_zero - end - shell("grep priority=100 /etc/supervisor.d/fcgi-program_test.conf") do |r| - r.exit_code.should be_zero - end - shell('grep "environment=" /etc/supervisor.d/fcgi-program_test.conf') do |r| - r.exit_code.should be_zero - end - end -end - -describe 'add a group config' do - - it 'supervisord::group should install a program config' do - - pp = <<-EOS - include supervisord - supervisord::group { 'test': - programs => ['program1', 'program2'], - priority => '100', - } - EOS - - puppet_apply(pp) do |r| - r.exit_code.should_not == 1 - r.refresh - r.exit_code.should be_zero - end - - shell('grep "programs=program1,program2" /etc/supervisor.d/group_test.conf') do |r| - r.exit_code.should be_zero - end - shell("grep priority=100 /etc/supervisor.d/fcgi-program_test.conf") do |r| - r.exit_code.should be_zero - end - end -end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb index 4ee2b893419..9875c8ef5b2 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/eventlistener.erb @@ -39,8 +39,8 @@ exitcodes=<%= @exitcodes %> <% if @stopsignal -%> stopsignal=<%= @stopsignal %> <% end -%> -<% if @stopwaitsec -%> -stopwaitsec=<%= @stopwaitsec %> +<% if @stopwaitsecs -%> +stopwaitsecs=<%= @stopwaitsecs %> <% end -%> <% if @stopasgroup -%> stopasgroup=<%= @stopasgroup %> @@ -54,7 +54,7 @@ user=<%= @user %> <% if @redirect_stderr -%> redirect_stderr=<%= @redirect_stderr %> <% end -%> -stdout_logfile=<%= @stdout_logfile %> +stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %> <% if @stdout_logfile_maxbytes -%> stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %> <% end -%> @@ -64,7 +64,7 @@ stdout_logfile_backups=<%= @stdout_logfile_backups %> <% if @stdout_events_enabled -%> stdout_events_enabled=<%= @stdout_events_enabled %> <% end -%> -stderr_logfile=<%= @stderr_logfile %> +stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %> <% if @stderr_logfile_maxbytes -%> stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %> <% end -%> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb index a1478bce536..98a7fb1cb32 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/fcgi_program.erb @@ -37,8 +37,8 @@ exitcodes=<%= @exitcodes %> <% if @stopsignal -%> stopsignal=<%= @stopsignal %> <% end -%> -<% if @stopwaitsec -%> -stopwaitsec=<%= @stopwaitsec %> +<% if @stopwaitsecs -%> +stopwaitsecs=<%= @stopwaitsecs %> <% end -%> <% if @stopasgroup -%> stopasgroup=<%= @stopasgroup %> @@ -53,7 +53,7 @@ user=<%= @user %> redirect_stderr=<%= @redirect_stderr %> <% end -%> <% if @stdout_logfile -%> -stdout_logfile=<%= @stdout_logfile %> +stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %> <% end -%> <% if @stdout_logfile_maxbytes -%> stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %> @@ -68,7 +68,7 @@ stdout_capture_maxbytes=<%= @stdout_capture_maxbytes %> stdout_events_enabled=<%= @stdout_events_enabled %> <% end -%> <% if @stderr_logfile -%> -stderr_logfile=<%= @stderr_logfile %> +stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %> <% end -%> <% if @stderr_logfile_maxbytes -%> stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb index ca96d34d6ad..78002c87ca6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/conf/program.erb @@ -30,8 +30,8 @@ exitcodes=<%= @exitcodes %> <% if @stopsignal -%> stopsignal=<%= @stopsignal %> <% end -%> -<% if @stopwaitsec -%> -stopwaitsec=<%= @stopwaitsec %> +<% if @stopwaitsecs -%> +stopwaitsecs=<%= @stopwaitsecs %> <% end -%> <% if @stopasgroup -%> stopasgroup=<%= @stopasgroup %> @@ -46,7 +46,7 @@ user=<%= @user %> redirect_stderr=<%= @redirect_stderr %> <% end -%> <% if @stdout_logfile -%> -stdout_logfile=<%= @stdout_logfile %> +stdout_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stdout_logfile %> <% end -%> <% if @stdout_logfile_maxbytes -%> stdout_logfile_maxbytes=<%= @stdout_logfile_maxbytes %> @@ -61,7 +61,7 @@ stdout_capture_maxbytes=<%= @stdout_capture_maxbytes %> stdout_events_enabled=<%= @stdout_events_enabled %> <% end -%> <% if @stderr_logfile -%> -stderr_logfile=<%= @stderr_logfile %> +stderr_logfile=<%= scope.lookupvar('supervisord::log_path') %>/<%= @stderr_logfile %> <% end -%> <% if @stderr_logfile_maxbytes -%> stderr_logfile_maxbytes=<%= @stderr_logfile_maxbytes %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_extra.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/defaults.erb similarity index 100% rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_extra.erb rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/defaults.erb diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb similarity index 96% rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb index b94f9337f59..bff9857257a 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/debian_init.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb @@ -19,15 +19,15 @@ DESC=supervisor test -x $DAEMON || exit 0 LOGDIR=<%= @log_path %> -PIDFILE=<%= @pid_file %> +PIDFILE=<%= @run_path %>/<%= @pid_file %> DODTIME=5 # Time to wait for the server to die, in seconds # If this value is set too low you might not # let some servers to die gracefully and # 'restart' will not work # Include supervisor defaults if available -if [ -f /etc/default/supervisor ] ; then - . /etc/default/supervisor +if [ -f <%= @init_defaults %> ] ; then + . <%= @init_defaults %> fi set -e diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb similarity index 81% rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb index b892c2d6203..0d7862d0233 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_extra.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/defaults.erb @@ -5,4 +5,4 @@ set -a # should probably put both of these options as runtime arguments OPTIONS="-c <%= @config_file %>" -PIDFILE=<%= @pid_file %> +PIDFILE=<%= @run_path %><%= @pid_file %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb similarity index 94% rename from dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb rename to dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb index 1dc2da2aff1..dabb2784510 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/redhat_init.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb @@ -13,18 +13,19 @@ # xmlrpc interface as well as a few other nifty features. # processname: supervisord # config: <%= @config_file %> -# pidfile: <%= @pid_file %> +# pidfile: <%= @run_path %>/<%= @pid_file %> # # source function library . /etc/rc.d/init.d/functions # source system settings -[ -e <%= @init_extras %> ] && . <%= @init_extras %> +[ -e <%= @init_defaults %> ] && . <%= @init_defaults %> RETVAL=0 DAEMON=/usr/bin/supervisord DESC=supervisord +PIDFILE=<%= @run_path %>/<%= @pid_file %> running_pid() { diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb index 1baf5607a2f..8ab8fee51df 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_main.erb @@ -1,9 +1,9 @@ [supervisord] -logfile=<%= @log_file %> -pidfile=<%= @pid_file %> +logfile=<%= @log_path %>/<%= @log_file %> +pidfile=<%= @run_path %>/<%= @pid_file %> nodaemon=<%= @nodaemon %> minfds=<%= @minfds %> -minfds=<%= @minprocs %> +minprocs=<%= @minprocs %> umask=<%= @umask %> <% if @strip_ansi -%> strip_ansi=<%= @strip_ansi %> @@ -12,7 +12,7 @@ strip_ansi=<%= @strip_ansi %> user=<%= @user %> <% end -%> <% if @identifier -%> -indentifier=<%= @identifier %> +identifier=<%= @identifier %> <% end -%> <% if @directory -%> directory=<%= @directory %> @@ -31,4 +31,4 @@ environment=<%= @env_string %> supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [include] -files=<%= @config_include %>/*.conf +files=<%= @config_include_string %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb index 414e75198ba..39e85199916 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/supervisord_unix.erb @@ -1,5 +1,5 @@ [unix_http_server] -file=<%= @unix_socket_file %> +file=<%= @run_path %>/<%= @unix_socket_file %> chmod=<%= @unix_socket_mode %> chown=<%= @unix_socket_owner %>:<%= @unix_socket_group %> <% if @unix_auth -%> @@ -8,7 +8,7 @@ password=<%= @unix_socket_password %> <% end -%> [supervisorctl] -serverurl=unix://<%= @unix_socket_file %> +serverurl=unix://<%= @run_path %>/<%= @unix_socket_file %> <% if @unix_auth -%> username=<%= @unix_username %> password=<%= @unix_password %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp index 6c789c96dc1..0d45ebe1b3d 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/tests/program.pp @@ -1,9 +1,35 @@ supervisord::program { 'myprogram': - command => 'command --args', - priority => '100', - environment => { + command => 'command --args', + process_name => '%(process_num)s', + numprocs => '1', + numprocs_start => '0', + priority => '999', + autostart => true, + autorestart => 'unexpected', + startsecs => '1', + startretries => '3', + exitcodes => '0,2', + stopsignal => 'TERM', + stopwaitsecs => '10', + stopasgroup => false, + killasgroup => false, + redirect_stderr => false, + stdout_logfile => 'program_foo.log', + stdout_logfile_maxbytes => '50MB', + stdout_logfile_backups => '10', + stdout_capture_maxbytes => '0', + stdout_events_enabled => false, + stderr_logfile => 'program_foo.error', + stderr_logfile_maxbytes => '50MB', + stderr_logfile_backups => '10', + stderr_capture_maxbytes => '0', + stderr_events_enabled => false, + environment => { 'HOME' => '/home/myuser', 'PATH' => '/bin:/sbin:/usr/bin:/usr/sbin', 'SECRET' => 'mysecret' - } + }, + directory => undef, + umask => '022', + serverurl => 'AUTO' } \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh index 06713c2ee99..c6c08a7b04c 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh @@ -4,17 +4,26 @@ export DEBIAN_FRONTEND=noninteractive VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') -shopt -s nullglob -files=("${VAGRANT_CORE_FOLDER}"/files/exec-once/*) +EXEC_ONCE_DIR="$1" +EXEC_ALWAYS_DIR="$2" -if [[ ! -f '/.puphpet-stuff/exec-once-ran' && (${#files[@]} -gt 0) ]]; then - echo 'Running files in files/exec-once' - find "${VAGRANT_CORE_FOLDER}/files/exec-once" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \; - echo 'Finished running files in files/exec-once' - echo 'To run again, delete file /.puphpet-stuff/exec-once-ran' - touch /.puphpet-stuff/exec-once-ran +shopt -s nullglob +files=("${VAGRANT_CORE_FOLDER}"/files/"${EXEC_ONCE_DIR}"/*) + +if [[ (${#files[@]} -gt 0) ]]; then + echo "Running files in files/${EXEC_ONCE_DIR}" + + if [ ! -d "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" ]; then + mkdir "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" + echo "Created directory /.puphpet-stuff/${EXEC_ONCE_DIR}-ran" + fi + + find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ONCE_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec cp -n '{}' "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" \; + find "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" -maxdepth 1 -type f -exec chmod +x '{}' \; -exec {} \; -exec sh -c '>{}' \; + echo "Finished running files in files/${EXEC_ONCE_DIR}" + echo "To run again, delete file(s) you want rerun in /.puphpet-stuff/${EXEC_ONCE_DIR}-ran or the whole folder to rerun all" fi -echo 'Running files in files/exec-always' -find "${VAGRANT_CORE_FOLDER}/files/exec-always" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \; -echo 'Finished running files in files/exec-always' +echo "Running files in files/${EXEC_ALWAYS_DIR}" +find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ALWAYS_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \; +echo "Finished running files in files/${EXEC_ALWAYS_DIR}" diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh b/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh index 6bb7614f9c6..ef00495b2b6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/ssh-keygen.sh @@ -5,37 +5,76 @@ VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID) VAGRANT_SSH_USERNAME=$(echo "$1") -if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" ]]; then - ssh-keygen -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" -P "" +function create_key() +{ + BASE_KEY_NAME=$(echo "$1") - if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.ppk" ]]; then - if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then - apt-get install -y putty-tools >/dev/null - elif [ "${OS}" == 'centos' ]; then - yum -y install putty >/dev/null + if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" ]]; then + ssh-keygen -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" -P "" + + if [[ ! -f "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}.ppk" ]]; then + if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then + apt-get install -y putty-tools >/dev/null + elif [ "${OS}" == 'centos' ]; then + yum -y install putty >/dev/null + fi + + puttygen "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}" -O private -o "${VAGRANT_CORE_FOLDER}/files/dot/ssh/${BASE_KEY_NAME}.ppk" fi - puttygen "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" -O private -o "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.ppk" + echo "Your private key for SSH-based authentication has been saved to 'puphpet/files/dot/ssh/${BASE_KEY_NAME}'!" + else + echo "Pre-existing private key found at 'puphpet/files/dot/ssh/${BASE_KEY_NAME}'" fi +} - echo 'Your private key for SSH-based authentication have been saved to "puphpet/files/dot/ssh/"!' -else - echo 'Using pre-existing private key at "puphpet/files/dot/ssh/id_rsa"' +create_key 'root_id_rsa' +create_key 'id_rsa' + +PUBLIC_SSH_KEY=$(cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub") + +echo 'Adding generated key to /root/.ssh/id_rsa' +echo 'Adding generated key to /root/.ssh/id_rsa.pub' +echo 'Adding generated key to /root/.ssh/authorized_keys' + +mkdir -p /root/.ssh + +cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" '/root/.ssh/' +cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" '/root/.ssh/' + +if [[ ! -f '/root/.ssh/authorized_keys' ]] || ! grep -q "${PUBLIC_SSH_KEY}" '/root/.ssh/authorized_keys'; then + cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" >> '/root/.ssh/authorized_keys' fi -echo 'Adding generated key to /root/.ssh/authorized_keys' -mkdir -p /root/.ssh -cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" > '/root/.ssh/authorized_keys' +chown -R root '/root/.ssh' +chgrp -R root '/root/.ssh' +chmod 700 '/root/.ssh' +chmod 644 '/root/.ssh/id_rsa.pub' +chmod 600 '/root/.ssh/id_rsa' chmod 600 '/root/.ssh/authorized_keys' if [ "${VAGRANT_SSH_USERNAME}" != 'root' ]; then VAGRANT_SSH_FOLDER="/home/${VAGRANT_SSH_USERNAME}/.ssh"; - echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/authorized_keys" - cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" > "${VAGRANT_SSH_FOLDER}/authorized_keys" - chown "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}/authorized_keys" - chgrp "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}/authorized_keys" - chmod 600 "${VAGRANT_SSH_FOLDER}/authorized_keys" -fi + mkdir -p "${VAGRANT_SSH_FOLDER}" -passwd -d vagrant >/dev/null + echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/id_rsa" + echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/id_rsa.pub" + echo "Adding generated key to ${VAGRANT_SSH_FOLDER}/authorized_keys" + + cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa" "${VAGRANT_SSH_FOLDER}/id_rsa" + cp "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" "${VAGRANT_SSH_FOLDER}/id_rsa.pub" + + if [[ ! -f "${VAGRANT_SSH_FOLDER}/authorized_keys" ]] || ! grep -q "${PUBLIC_SSH_KEY}" "${VAGRANT_SSH_FOLDER}/authorized_keys"; then + cat "${VAGRANT_CORE_FOLDER}/files/dot/ssh/id_rsa.pub" >> "${VAGRANT_SSH_FOLDER}/authorized_keys" + fi + + chown -R "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}" + chgrp -R "${VAGRANT_SSH_USERNAME}" "${VAGRANT_SSH_FOLDER}" + chmod 700 "${VAGRANT_SSH_FOLDER}" + chmod 644 "${VAGRANT_SSH_FOLDER}/id_rsa.pub" + chmod 600 "${VAGRANT_SSH_FOLDER}/id_rsa" + chmod 600 "${VAGRANT_SSH_FOLDER}/authorized_keys" + + passwd -d "${VAGRANT_SSH_USERNAME}" >/dev/null +fi From 43f6d3deafe8a185b1e696acbdd4777d5571dd11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 12 Jul 2014 15:51:39 +0200 Subject: [PATCH 218/502] Moved dolibarr source to another folder of /var/www so that external libraries get separated from dolibarr core --- dev/vagrant/dolibarrdev/puphpet/config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/vagrant/dolibarrdev/puphpet/config.yaml b/dev/vagrant/dolibarrdev/puphpet/config.yaml index 96c01695cec..c9c8440c87d 100644 --- a/dev/vagrant/dolibarrdev/puphpet/config.yaml +++ b/dev/vagrant/dolibarrdev/puphpet/config.yaml @@ -31,7 +31,7 @@ vagrantfile-local: synced_folder: jopH6005bn96: source: ../../../ - target: /var/www + target: /var/www/dolibarr sync_type: default rsync: auto: 'false' @@ -83,7 +83,7 @@ apache: vhosts: b2tOrs1TMtoF: servername: dev.dolibarr.org - docroot: /var/www/htdocs + docroot: /var/www/dolibarr/htdocs port: '80' setenv: - 'APP_ENV dev' @@ -168,7 +168,7 @@ mysql: host: localhost user: user password: user - sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql + sql_file: /var/www/dolibarr/dev/initdata/mysqldump_dolibarr_3.5.0.sql postgresql: install: '1' settings: From ec661d0c6ca9af7fb3f3ef29e4d17379f0644890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 12 Jul 2014 23:18:57 +0200 Subject: [PATCH 219/502] Removed index.php and replaced them with blank index.html as it is more appropriate --- htdocs/accountancy/class/index.html | 0 htdocs/accountancy/index.html | 0 htdocs/accountancy/index.php | 1 - htdocs/adherents/canvas/default/index.php | 1 - htdocs/adherents/canvas/default/tpl/index.html | 0 htdocs/adherents/canvas/default/tpl/index.php | 1 - htdocs/adherents/canvas/index.html | 0 htdocs/adherents/canvas/index.php | 1 - htdocs/adherents/cartes/index.html | 0 htdocs/adherents/cartes/index.php | 1 - htdocs/adherents/class/index.html | 0 htdocs/asterisk/index.html | 0 htdocs/asterisk/index.php | 1 - htdocs/barcode/index.html | 0 htdocs/bookmarks/admin/index.html | 0 htdocs/bookmarks/class/index.html | 0 htdocs/bookmarks/index.html | 0 htdocs/bookmarks/index.php | 1 - htdocs/boutique/admin/index.html | 0 htdocs/boutique/client/class/index.html | 0 htdocs/boutique/commande/class/index.html | 0 htdocs/boutique/critiques/class/index.html | 0 htdocs/boutique/promotion/class/index.html | 0 htdocs/cashdesk/admin/index.html | 0 htdocs/cashdesk/class/index.html | 0 htdocs/cashdesk/class/index.php | 1 - htdocs/cashdesk/css/index.html | 0 htdocs/cashdesk/img/index.html | 0 htdocs/cashdesk/img/index.php | 1 - htdocs/cashdesk/include/index.html | 0 htdocs/cashdesk/include/index.php | 1 - htdocs/cashdesk/javascript/index.html | 0 htdocs/cashdesk/javascript/index.php | 1 - htdocs/cashdesk/tpl/index.html | 0 htdocs/cashdesk/tpl/index.php | 1 - htdocs/categories/admin/index.html | 0 htdocs/categories/class/index.html | 0 htdocs/comm/action/class/index.html | 0 htdocs/comm/admin/index.html | 0 htdocs/comm/mailing/class/index.html | 0 htdocs/comm/propal/class/index.html | 0 htdocs/comm/propal/tpl/index.html | 0 htdocs/comm/prospect/class/index.html | 0 htdocs/commande/class/index.html | 0 htdocs/commande/tpl/index.html | 0 htdocs/compta/bank/class/index.html | 0 htdocs/compta/deplacement/class/index.html | 0 htdocs/compta/dons/class/index.html | 0 htdocs/compta/facture/admin/index.html | 0 htdocs/compta/facture/class/index.html | 0 htdocs/compta/facture/index.html | 0 htdocs/compta/facture/index.php | 1 - htdocs/compta/facture/tpl/index.html | 0 htdocs/compta/journal/index.html | 0 htdocs/compta/localtax/class/index.html | 0 htdocs/compta/paiement/cheque/class/index.html | 0 htdocs/compta/paiement/class/index.html | 0 htdocs/compta/payment_sc/index.html | 0 htdocs/compta/prelevement/class/index.html | 0 htdocs/compta/salaries/class/index.html | 0 htdocs/compta/sociales/class/index.html | 0 htdocs/compta/tva/class/index.html | 0 htdocs/conf/index.html | 0 htdocs/contact/canvas/default/index.html | 0 htdocs/contact/canvas/default/index.php | 1 - htdocs/contact/canvas/default/tpl/index.html | 0 htdocs/contact/canvas/default/tpl/index.php | 1 - htdocs/contact/canvas/index.html | 0 htdocs/contact/canvas/index.php | 1 - htdocs/contact/class/index.html | 0 htdocs/contact/index.html | 0 htdocs/contact/index.php | 1 - htdocs/contrat/admin/index.html | 0 htdocs/contrat/class/index.html | 0 htdocs/contrat/tpl/index.html | 0 htdocs/core/ajax/index.html | 0 htdocs/core/ajax/index.php | 1 - htdocs/core/boxes/index.html | 0 htdocs/core/boxes/index.php | 1 - htdocs/core/class/index.html | 0 htdocs/core/class/index.php | 1 - htdocs/core/db/index.html | 0 htdocs/core/db/index.php | 1 - .../filemanagerdol/browser/default/images/icons/32/index.html | 0 .../core/filemanagerdol/browser/default/images/icons/index.html | 0 htdocs/core/filemanagerdol/browser/default/images/index.html | 0 htdocs/core/filemanagerdol/browser/default/index.html | 0 htdocs/core/filemanagerdol/browser/default/js/index.html | 0 htdocs/core/filemanagerdol/browser/index.html | 0 htdocs/core/filemanagerdol/connectors/index.html | 0 htdocs/core/filemanagerdol/connectors/php/index.html | 0 htdocs/core/filemanagerdol/index.html | 0 htdocs/core/filemanagerdol/index.php | 1 - htdocs/core/index.html | 0 htdocs/core/index.php | 1 - htdocs/core/js/index.html | 0 htdocs/core/js/index.php | 1 - htdocs/core/lib/index.html | 0 htdocs/core/lib/index.php | 1 - htdocs/core/login/index.html | 0 htdocs/core/login/index.php | 1 - htdocs/core/menus/index.html | 0 htdocs/core/menus/index.php | 1 - htdocs/core/menus/standard/index.html | 0 htdocs/core/menus/standard/index.php | 1 - htdocs/core/modules/action/index.html | 0 htdocs/core/modules/barcode/doc/index.html | 0 htdocs/core/modules/barcode/index.html | 0 htdocs/core/modules/cheque/index.html | 0 htdocs/core/modules/cheque/pdf/index.html | 0 htdocs/core/modules/commande/doc/index.html | 0 htdocs/core/modules/commande/index.html | 0 htdocs/core/modules/contract/doc/index.html | 0 htdocs/core/modules/contract/index.html | 0 htdocs/core/modules/dons/index.html | 0 htdocs/core/modules/expedition/doc/index.html | 0 htdocs/core/modules/expedition/index.html | 0 htdocs/core/modules/export/index.html | 0 htdocs/core/modules/facture/doc/index.html | 0 htdocs/core/modules/facture/index.html | 0 htdocs/core/modules/fichinter/doc/index.html | 0 htdocs/core/modules/fichinter/index.html | 0 htdocs/core/modules/import/index.html | 0 htdocs/core/modules/index.html | 0 htdocs/core/modules/index.php | 1 - htdocs/core/modules/livraison/index.html | 0 htdocs/core/modules/livraison/pdf/index.html | 0 htdocs/core/modules/mailings/index.html | 0 htdocs/core/modules/member/doc/index.html | 0 htdocs/core/modules/member/index.html | 0 htdocs/core/modules/printsheet/doc/index.html | 0 htdocs/core/modules/printsheet/index.html | 0 htdocs/core/modules/product/index.html | 0 htdocs/core/modules/project/index.html | 0 htdocs/core/modules/project/pdf/index.html | 0 htdocs/core/modules/project/task/index.html | 0 htdocs/core/modules/project/task/pdf/index.html | 0 htdocs/core/modules/propale/doc/index.html | 0 htdocs/core/modules/propale/index.html | 0 htdocs/core/modules/rapport/index.html | 0 htdocs/core/modules/security/generate/index.html | 0 htdocs/core/modules/security/index.html | 0 htdocs/core/modules/societe/doc/index.html | 0 htdocs/core/modules/societe/index.html | 0 htdocs/core/modules/supplier_invoice/index.html | 0 htdocs/core/modules/supplier_invoice/pdf/index.html | 0 htdocs/core/modules/supplier_order/index.html | 0 htdocs/core/modules/supplier_order/pdf/index.html | 0 htdocs/core/modules/syslog/index.html | 0 htdocs/core/tpl/ajax/index.html | 0 htdocs/core/tpl/index.html | 0 htdocs/core/tpl/index.php | 1 - htdocs/core/triggers/index.html | 0 htdocs/core/triggers/index.php | 1 - htdocs/cron/admin/index.html | 0 htdocs/cron/class/index.html | 0 htdocs/cron/index.html | 0 htdocs/ecm/ajax/index.html | 0 htdocs/ecm/class/index.html | 0 htdocs/ecm/tpl/index.html | 0 htdocs/expedition/class/index.html | 0 htdocs/expedition/tpl/index.html | 0 htdocs/exports/class/index.html | 0 htdocs/externalsite/admin/index.html | 0 htdocs/externalsite/index.html | 0 htdocs/externalsite/index.php | 1 - htdocs/fichinter/admin/index.html | 0 htdocs/fichinter/class/index.html | 0 htdocs/fichinter/index.html | 0 htdocs/fichinter/index.php | 1 - htdocs/fichinter/tpl/index.html | 0 htdocs/fourn/ajax/index.html | 0 htdocs/fourn/class/index.html | 0 htdocs/fourn/commande/tpl/index.html | 0 htdocs/fourn/facture/index.html | 0 htdocs/fourn/facture/index.php | 1 - htdocs/fourn/facture/tpl/index.html | 0 htdocs/fourn/paiement/index.html | 0 htdocs/fourn/paiement/index.php | 1 - htdocs/ftp/admin/index.html | 0 htdocs/holiday/admin/index.html | 0 htdocs/holiday/class/index.html | 0 htdocs/holiday/img/index.html | 0 htdocs/imports/class/index.html | 0 htdocs/includes/adodbtime/index.html | 0 htdocs/includes/adodbtime/index.php | 1 - htdocs/includes/index.html | 0 htdocs/includes/index.php | 1 - htdocs/install/doctemplates/index.html | 0 htdocs/install/doctemplates/invoices/index.html | 0 htdocs/install/doctemplates/orders/index.html | 0 htdocs/install/doctemplates/projects/index.html | 0 htdocs/install/doctemplates/proposals/index.html | 0 htdocs/install/doctemplates/shipment/index.html | 0 htdocs/install/doctemplates/tasks/index.html | 0 htdocs/install/doctemplates/thirdparties/index.html | 0 htdocs/install/lib/index.html | 0 htdocs/install/mssql/functions/index.html | 0 htdocs/install/mssql/index.html | 0 htdocs/install/mysql/data/index.html | 0 htdocs/install/mysql/functions/index.html | 0 htdocs/install/mysql/index.html | 0 htdocs/install/mysql/migration/index.html | 0 htdocs/install/mysql/tables/index.html | 0 htdocs/install/pgsql/functions/index.html | 0 htdocs/install/pgsql/index.html | 0 htdocs/livraison/class/index.html | 0 htdocs/livraison/index.html | 0 htdocs/livraison/index.php | 1 - htdocs/mailmanspip/class/index.html | 0 htdocs/mailmanspip/index.html | 0 htdocs/margin/admin/index.html | 0 htdocs/margin/lib/index.html | 0 htdocs/margin/tabs/index.html | 0 htdocs/opensurvey/class/index.html | 0 htdocs/opensurvey/css/index.html | 0 htdocs/opensurvey/img/index.html | 0 htdocs/opensurvey/public/index.html | 0 htdocs/paybox/admin/index.html | 0 htdocs/paybox/img/index.html | 0 htdocs/paybox/index.html | 0 htdocs/paybox/index.php | 1 - htdocs/paybox/lib/index.html | 0 htdocs/paypal/admin/index.html | 0 htdocs/paypal/img/index.html | 0 htdocs/paypal/index.html | 0 htdocs/paypal/index.php | 1 - htdocs/paypal/lib/index.html | 0 htdocs/printipp/admin/index.html | 0 htdocs/printipp/lib/index.html | 0 htdocs/product/admin/index.html | 0 htdocs/product/ajax/index.html | 0 htdocs/product/canvas/index.html | 0 htdocs/product/canvas/index.php | 1 - htdocs/product/canvas/product/index.html | 0 htdocs/product/canvas/product/index.php | 1 - htdocs/product/canvas/product/tpl/index.html | 0 htdocs/product/canvas/product/tpl/index.php | 1 - htdocs/product/canvas/service/index.html | 0 htdocs/product/canvas/service/index.php | 1 - htdocs/product/canvas/service/tpl/index.html | 0 htdocs/product/canvas/service/tpl/index.php | 1 - htdocs/product/class/index.html | 0 htdocs/product/composition/index.html | 0 htdocs/product/composition/index.php | 1 - htdocs/product/stats/index.html | 0 htdocs/product/stats/index.php | 1 - htdocs/product/stock/class/index.html | 0 htdocs/product/stock/img/index.html | 0 htdocs/product/stock/lib/index.html | 0 htdocs/projet/admin/index.html | 0 htdocs/projet/class/index.html | 0 htdocs/public/cron/index.html | 0 htdocs/public/emailing/index.html | 0 htdocs/resource/class/index.html | 0 htdocs/resource/img/index.html | 0 htdocs/resource/index.html | 0 htdocs/societe/ajax/index.html | 0 htdocs/societe/canvas/company/index.html | 0 htdocs/societe/canvas/company/index.php | 1 - htdocs/societe/canvas/company/tpl/index.html | 0 htdocs/societe/canvas/company/tpl/index.php | 1 - htdocs/societe/canvas/index.html | 0 htdocs/societe/canvas/individual/index.html | 0 htdocs/societe/canvas/individual/index.php | 1 - htdocs/societe/canvas/individual/tpl/index.html | 0 htdocs/societe/canvas/individual/tpl/index.php | 1 - htdocs/societe/checkvat/index.html | 0 htdocs/societe/checkvat/index.php | 1 - htdocs/societe/class/index.html | 0 htdocs/societe/tpl/index.html | 0 htdocs/theme/amarok/ckeditor/index.html | 0 htdocs/theme/amarok/img/index.html | 0 htdocs/theme/amarok/index.html | 0 htdocs/theme/amarok/index.php | 1 - htdocs/theme/amarok/tpl/index.html | 0 htdocs/theme/amarok/tpl/index.php | 1 - htdocs/theme/auguria/ckeditor/index.html | 0 htdocs/theme/auguria/img/index.html | 0 htdocs/theme/auguria/img/menus/index.html | 0 htdocs/theme/auguria/index.html | 0 htdocs/theme/auguria/index.php | 1 - htdocs/theme/auguria/tpl/index.html | 0 htdocs/theme/auguria/tpl/index.php | 1 - htdocs/theme/bureau2crea/ckeditor/index.html | 0 htdocs/theme/bureau2crea/img/bouton/index.html | 0 htdocs/theme/bureau2crea/img/index.html | 0 htdocs/theme/bureau2crea/img/menus/index.html | 0 htdocs/theme/bureau2crea/index.html | 0 htdocs/theme/bureau2crea/index.php | 1 - htdocs/theme/bureau2crea/tpl/index.html | 0 htdocs/theme/bureau2crea/tpl/index.php | 1 - htdocs/theme/cameleo/ckeditor/index.html | 0 htdocs/theme/cameleo/img/bouton/index.html | 0 htdocs/theme/cameleo/img/index.html | 0 htdocs/theme/cameleo/img/menus/index.html | 0 htdocs/theme/cameleo/index.html | 0 htdocs/theme/cameleo/index.php | 1 - htdocs/theme/cameleo/tpl/index.html | 0 htdocs/theme/cameleo/tpl/index.php | 1 - htdocs/theme/common/devices/index.html | 0 htdocs/theme/common/emotes/index.html | 0 htdocs/theme/common/flags/index.html | 0 htdocs/theme/common/index.html | 0 htdocs/theme/common/mime/index.html | 0 htdocs/theme/common/treemenu/index.html | 0 htdocs/theme/common/weather/index.html | 0 htdocs/theme/eldy/ckeditor/index.html | 0 htdocs/theme/eldy/img/index.html | 0 htdocs/theme/eldy/img/menus/index.html | 0 htdocs/theme/eldy/index.html | 0 htdocs/theme/eldy/index.php | 1 - htdocs/theme/eldy/tpl/index.html | 0 htdocs/theme/eldy/tpl/index.php | 1 - htdocs/theme/index.html | 0 htdocs/theme/index.php | 1 - htdocs/user/admin/index.html | 0 htdocs/user/class/index.html | 0 htdocs/webservices/admin/index.html | 0 319 files changed, 63 deletions(-) create mode 100644 htdocs/accountancy/class/index.html create mode 100644 htdocs/accountancy/index.html delete mode 100644 htdocs/accountancy/index.php delete mode 100644 htdocs/adherents/canvas/default/index.php create mode 100644 htdocs/adherents/canvas/default/tpl/index.html delete mode 100644 htdocs/adherents/canvas/default/tpl/index.php create mode 100644 htdocs/adherents/canvas/index.html delete mode 100644 htdocs/adherents/canvas/index.php create mode 100644 htdocs/adherents/cartes/index.html delete mode 100644 htdocs/adherents/cartes/index.php create mode 100644 htdocs/adherents/class/index.html create mode 100644 htdocs/asterisk/index.html delete mode 100644 htdocs/asterisk/index.php create mode 100644 htdocs/barcode/index.html create mode 100644 htdocs/bookmarks/admin/index.html create mode 100644 htdocs/bookmarks/class/index.html create mode 100644 htdocs/bookmarks/index.html delete mode 100644 htdocs/bookmarks/index.php create mode 100644 htdocs/boutique/admin/index.html create mode 100644 htdocs/boutique/client/class/index.html create mode 100644 htdocs/boutique/commande/class/index.html create mode 100644 htdocs/boutique/critiques/class/index.html create mode 100644 htdocs/boutique/promotion/class/index.html create mode 100644 htdocs/cashdesk/admin/index.html create mode 100644 htdocs/cashdesk/class/index.html delete mode 100644 htdocs/cashdesk/class/index.php create mode 100644 htdocs/cashdesk/css/index.html create mode 100644 htdocs/cashdesk/img/index.html delete mode 100644 htdocs/cashdesk/img/index.php create mode 100644 htdocs/cashdesk/include/index.html delete mode 100644 htdocs/cashdesk/include/index.php create mode 100644 htdocs/cashdesk/javascript/index.html delete mode 100644 htdocs/cashdesk/javascript/index.php create mode 100644 htdocs/cashdesk/tpl/index.html delete mode 100644 htdocs/cashdesk/tpl/index.php create mode 100644 htdocs/categories/admin/index.html create mode 100644 htdocs/categories/class/index.html create mode 100644 htdocs/comm/action/class/index.html create mode 100644 htdocs/comm/admin/index.html create mode 100644 htdocs/comm/mailing/class/index.html create mode 100644 htdocs/comm/propal/class/index.html create mode 100644 htdocs/comm/propal/tpl/index.html create mode 100644 htdocs/comm/prospect/class/index.html create mode 100644 htdocs/commande/class/index.html create mode 100644 htdocs/commande/tpl/index.html create mode 100644 htdocs/compta/bank/class/index.html create mode 100644 htdocs/compta/deplacement/class/index.html create mode 100644 htdocs/compta/dons/class/index.html create mode 100644 htdocs/compta/facture/admin/index.html create mode 100644 htdocs/compta/facture/class/index.html create mode 100644 htdocs/compta/facture/index.html delete mode 100644 htdocs/compta/facture/index.php create mode 100644 htdocs/compta/facture/tpl/index.html create mode 100644 htdocs/compta/journal/index.html create mode 100644 htdocs/compta/localtax/class/index.html create mode 100644 htdocs/compta/paiement/cheque/class/index.html create mode 100644 htdocs/compta/paiement/class/index.html create mode 100644 htdocs/compta/payment_sc/index.html create mode 100644 htdocs/compta/prelevement/class/index.html create mode 100644 htdocs/compta/salaries/class/index.html create mode 100644 htdocs/compta/sociales/class/index.html create mode 100644 htdocs/compta/tva/class/index.html create mode 100644 htdocs/conf/index.html create mode 100644 htdocs/contact/canvas/default/index.html delete mode 100644 htdocs/contact/canvas/default/index.php create mode 100644 htdocs/contact/canvas/default/tpl/index.html delete mode 100644 htdocs/contact/canvas/default/tpl/index.php create mode 100644 htdocs/contact/canvas/index.html delete mode 100644 htdocs/contact/canvas/index.php create mode 100644 htdocs/contact/class/index.html create mode 100644 htdocs/contact/index.html delete mode 100644 htdocs/contact/index.php create mode 100644 htdocs/contrat/admin/index.html create mode 100644 htdocs/contrat/class/index.html create mode 100644 htdocs/contrat/tpl/index.html create mode 100644 htdocs/core/ajax/index.html delete mode 100644 htdocs/core/ajax/index.php create mode 100644 htdocs/core/boxes/index.html delete mode 100644 htdocs/core/boxes/index.php create mode 100644 htdocs/core/class/index.html delete mode 100644 htdocs/core/class/index.php create mode 100644 htdocs/core/db/index.html delete mode 100644 htdocs/core/db/index.php create mode 100644 htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html create mode 100644 htdocs/core/filemanagerdol/browser/default/images/icons/index.html create mode 100644 htdocs/core/filemanagerdol/browser/default/images/index.html create mode 100644 htdocs/core/filemanagerdol/browser/default/index.html create mode 100644 htdocs/core/filemanagerdol/browser/default/js/index.html create mode 100644 htdocs/core/filemanagerdol/browser/index.html create mode 100644 htdocs/core/filemanagerdol/connectors/index.html create mode 100644 htdocs/core/filemanagerdol/connectors/php/index.html create mode 100644 htdocs/core/filemanagerdol/index.html delete mode 100644 htdocs/core/filemanagerdol/index.php create mode 100644 htdocs/core/index.html delete mode 100644 htdocs/core/index.php create mode 100644 htdocs/core/js/index.html delete mode 100644 htdocs/core/js/index.php create mode 100644 htdocs/core/lib/index.html delete mode 100644 htdocs/core/lib/index.php create mode 100644 htdocs/core/login/index.html delete mode 100644 htdocs/core/login/index.php create mode 100644 htdocs/core/menus/index.html delete mode 100644 htdocs/core/menus/index.php create mode 100644 htdocs/core/menus/standard/index.html delete mode 100644 htdocs/core/menus/standard/index.php create mode 100644 htdocs/core/modules/action/index.html create mode 100644 htdocs/core/modules/barcode/doc/index.html create mode 100644 htdocs/core/modules/barcode/index.html create mode 100644 htdocs/core/modules/cheque/index.html create mode 100644 htdocs/core/modules/cheque/pdf/index.html create mode 100644 htdocs/core/modules/commande/doc/index.html create mode 100644 htdocs/core/modules/commande/index.html create mode 100644 htdocs/core/modules/contract/doc/index.html create mode 100644 htdocs/core/modules/contract/index.html create mode 100644 htdocs/core/modules/dons/index.html create mode 100644 htdocs/core/modules/expedition/doc/index.html create mode 100644 htdocs/core/modules/expedition/index.html create mode 100644 htdocs/core/modules/export/index.html create mode 100644 htdocs/core/modules/facture/doc/index.html create mode 100644 htdocs/core/modules/facture/index.html create mode 100644 htdocs/core/modules/fichinter/doc/index.html create mode 100644 htdocs/core/modules/fichinter/index.html create mode 100644 htdocs/core/modules/import/index.html create mode 100644 htdocs/core/modules/index.html delete mode 100644 htdocs/core/modules/index.php create mode 100644 htdocs/core/modules/livraison/index.html create mode 100644 htdocs/core/modules/livraison/pdf/index.html create mode 100644 htdocs/core/modules/mailings/index.html create mode 100644 htdocs/core/modules/member/doc/index.html create mode 100644 htdocs/core/modules/member/index.html create mode 100644 htdocs/core/modules/printsheet/doc/index.html create mode 100644 htdocs/core/modules/printsheet/index.html create mode 100644 htdocs/core/modules/product/index.html create mode 100644 htdocs/core/modules/project/index.html create mode 100644 htdocs/core/modules/project/pdf/index.html create mode 100644 htdocs/core/modules/project/task/index.html create mode 100644 htdocs/core/modules/project/task/pdf/index.html create mode 100644 htdocs/core/modules/propale/doc/index.html create mode 100644 htdocs/core/modules/propale/index.html create mode 100644 htdocs/core/modules/rapport/index.html create mode 100644 htdocs/core/modules/security/generate/index.html create mode 100644 htdocs/core/modules/security/index.html create mode 100644 htdocs/core/modules/societe/doc/index.html create mode 100644 htdocs/core/modules/societe/index.html create mode 100644 htdocs/core/modules/supplier_invoice/index.html create mode 100644 htdocs/core/modules/supplier_invoice/pdf/index.html create mode 100644 htdocs/core/modules/supplier_order/index.html create mode 100644 htdocs/core/modules/supplier_order/pdf/index.html create mode 100644 htdocs/core/modules/syslog/index.html create mode 100644 htdocs/core/tpl/ajax/index.html create mode 100644 htdocs/core/tpl/index.html delete mode 100644 htdocs/core/tpl/index.php create mode 100644 htdocs/core/triggers/index.html delete mode 100644 htdocs/core/triggers/index.php create mode 100644 htdocs/cron/admin/index.html create mode 100644 htdocs/cron/class/index.html create mode 100644 htdocs/cron/index.html create mode 100644 htdocs/ecm/ajax/index.html create mode 100644 htdocs/ecm/class/index.html create mode 100644 htdocs/ecm/tpl/index.html create mode 100644 htdocs/expedition/class/index.html create mode 100644 htdocs/expedition/tpl/index.html create mode 100644 htdocs/exports/class/index.html create mode 100644 htdocs/externalsite/admin/index.html create mode 100644 htdocs/externalsite/index.html delete mode 100644 htdocs/externalsite/index.php create mode 100644 htdocs/fichinter/admin/index.html create mode 100644 htdocs/fichinter/class/index.html create mode 100644 htdocs/fichinter/index.html delete mode 100644 htdocs/fichinter/index.php create mode 100644 htdocs/fichinter/tpl/index.html create mode 100644 htdocs/fourn/ajax/index.html create mode 100644 htdocs/fourn/class/index.html create mode 100644 htdocs/fourn/commande/tpl/index.html create mode 100644 htdocs/fourn/facture/index.html delete mode 100644 htdocs/fourn/facture/index.php create mode 100644 htdocs/fourn/facture/tpl/index.html create mode 100644 htdocs/fourn/paiement/index.html delete mode 100644 htdocs/fourn/paiement/index.php create mode 100644 htdocs/ftp/admin/index.html create mode 100644 htdocs/holiday/admin/index.html create mode 100644 htdocs/holiday/class/index.html create mode 100644 htdocs/holiday/img/index.html create mode 100644 htdocs/imports/class/index.html create mode 100644 htdocs/includes/adodbtime/index.html delete mode 100644 htdocs/includes/adodbtime/index.php create mode 100644 htdocs/includes/index.html delete mode 100644 htdocs/includes/index.php create mode 100644 htdocs/install/doctemplates/index.html create mode 100644 htdocs/install/doctemplates/invoices/index.html create mode 100644 htdocs/install/doctemplates/orders/index.html create mode 100644 htdocs/install/doctemplates/projects/index.html create mode 100644 htdocs/install/doctemplates/proposals/index.html create mode 100644 htdocs/install/doctemplates/shipment/index.html create mode 100644 htdocs/install/doctemplates/tasks/index.html create mode 100644 htdocs/install/doctemplates/thirdparties/index.html create mode 100644 htdocs/install/lib/index.html create mode 100644 htdocs/install/mssql/functions/index.html create mode 100644 htdocs/install/mssql/index.html create mode 100644 htdocs/install/mysql/data/index.html create mode 100644 htdocs/install/mysql/functions/index.html create mode 100644 htdocs/install/mysql/index.html create mode 100644 htdocs/install/mysql/migration/index.html create mode 100644 htdocs/install/mysql/tables/index.html create mode 100644 htdocs/install/pgsql/functions/index.html create mode 100644 htdocs/install/pgsql/index.html create mode 100644 htdocs/livraison/class/index.html create mode 100644 htdocs/livraison/index.html delete mode 100644 htdocs/livraison/index.php create mode 100644 htdocs/mailmanspip/class/index.html create mode 100644 htdocs/mailmanspip/index.html create mode 100644 htdocs/margin/admin/index.html create mode 100644 htdocs/margin/lib/index.html create mode 100644 htdocs/margin/tabs/index.html create mode 100644 htdocs/opensurvey/class/index.html create mode 100644 htdocs/opensurvey/css/index.html create mode 100644 htdocs/opensurvey/img/index.html create mode 100644 htdocs/opensurvey/public/index.html create mode 100644 htdocs/paybox/admin/index.html create mode 100644 htdocs/paybox/img/index.html create mode 100644 htdocs/paybox/index.html delete mode 100644 htdocs/paybox/index.php create mode 100644 htdocs/paybox/lib/index.html create mode 100644 htdocs/paypal/admin/index.html create mode 100644 htdocs/paypal/img/index.html create mode 100644 htdocs/paypal/index.html delete mode 100644 htdocs/paypal/index.php create mode 100644 htdocs/paypal/lib/index.html create mode 100644 htdocs/printipp/admin/index.html create mode 100644 htdocs/printipp/lib/index.html create mode 100644 htdocs/product/admin/index.html create mode 100644 htdocs/product/ajax/index.html create mode 100644 htdocs/product/canvas/index.html delete mode 100644 htdocs/product/canvas/index.php create mode 100644 htdocs/product/canvas/product/index.html delete mode 100644 htdocs/product/canvas/product/index.php create mode 100644 htdocs/product/canvas/product/tpl/index.html delete mode 100644 htdocs/product/canvas/product/tpl/index.php create mode 100644 htdocs/product/canvas/service/index.html delete mode 100644 htdocs/product/canvas/service/index.php create mode 100644 htdocs/product/canvas/service/tpl/index.html delete mode 100644 htdocs/product/canvas/service/tpl/index.php create mode 100644 htdocs/product/class/index.html create mode 100644 htdocs/product/composition/index.html delete mode 100644 htdocs/product/composition/index.php create mode 100644 htdocs/product/stats/index.html delete mode 100644 htdocs/product/stats/index.php create mode 100644 htdocs/product/stock/class/index.html create mode 100644 htdocs/product/stock/img/index.html create mode 100644 htdocs/product/stock/lib/index.html create mode 100644 htdocs/projet/admin/index.html create mode 100644 htdocs/projet/class/index.html create mode 100644 htdocs/public/cron/index.html create mode 100644 htdocs/public/emailing/index.html create mode 100644 htdocs/resource/class/index.html create mode 100644 htdocs/resource/img/index.html create mode 100644 htdocs/resource/index.html create mode 100644 htdocs/societe/ajax/index.html create mode 100644 htdocs/societe/canvas/company/index.html delete mode 100644 htdocs/societe/canvas/company/index.php create mode 100644 htdocs/societe/canvas/company/tpl/index.html delete mode 100644 htdocs/societe/canvas/company/tpl/index.php create mode 100644 htdocs/societe/canvas/index.html create mode 100644 htdocs/societe/canvas/individual/index.html delete mode 100644 htdocs/societe/canvas/individual/index.php create mode 100644 htdocs/societe/canvas/individual/tpl/index.html delete mode 100644 htdocs/societe/canvas/individual/tpl/index.php create mode 100644 htdocs/societe/checkvat/index.html delete mode 100644 htdocs/societe/checkvat/index.php create mode 100644 htdocs/societe/class/index.html create mode 100644 htdocs/societe/tpl/index.html create mode 100644 htdocs/theme/amarok/ckeditor/index.html create mode 100644 htdocs/theme/amarok/img/index.html create mode 100644 htdocs/theme/amarok/index.html delete mode 100644 htdocs/theme/amarok/index.php create mode 100644 htdocs/theme/amarok/tpl/index.html delete mode 100644 htdocs/theme/amarok/tpl/index.php create mode 100644 htdocs/theme/auguria/ckeditor/index.html create mode 100644 htdocs/theme/auguria/img/index.html create mode 100644 htdocs/theme/auguria/img/menus/index.html create mode 100644 htdocs/theme/auguria/index.html delete mode 100644 htdocs/theme/auguria/index.php create mode 100644 htdocs/theme/auguria/tpl/index.html delete mode 100644 htdocs/theme/auguria/tpl/index.php create mode 100644 htdocs/theme/bureau2crea/ckeditor/index.html create mode 100644 htdocs/theme/bureau2crea/img/bouton/index.html create mode 100644 htdocs/theme/bureau2crea/img/index.html create mode 100644 htdocs/theme/bureau2crea/img/menus/index.html create mode 100644 htdocs/theme/bureau2crea/index.html delete mode 100644 htdocs/theme/bureau2crea/index.php create mode 100644 htdocs/theme/bureau2crea/tpl/index.html delete mode 100644 htdocs/theme/bureau2crea/tpl/index.php create mode 100644 htdocs/theme/cameleo/ckeditor/index.html create mode 100644 htdocs/theme/cameleo/img/bouton/index.html create mode 100644 htdocs/theme/cameleo/img/index.html create mode 100644 htdocs/theme/cameleo/img/menus/index.html create mode 100644 htdocs/theme/cameleo/index.html delete mode 100644 htdocs/theme/cameleo/index.php create mode 100644 htdocs/theme/cameleo/tpl/index.html delete mode 100644 htdocs/theme/cameleo/tpl/index.php create mode 100644 htdocs/theme/common/devices/index.html create mode 100644 htdocs/theme/common/emotes/index.html create mode 100644 htdocs/theme/common/flags/index.html create mode 100644 htdocs/theme/common/index.html create mode 100644 htdocs/theme/common/mime/index.html create mode 100644 htdocs/theme/common/treemenu/index.html create mode 100644 htdocs/theme/common/weather/index.html create mode 100644 htdocs/theme/eldy/ckeditor/index.html create mode 100644 htdocs/theme/eldy/img/index.html create mode 100644 htdocs/theme/eldy/img/menus/index.html create mode 100644 htdocs/theme/eldy/index.html delete mode 100644 htdocs/theme/eldy/index.php create mode 100644 htdocs/theme/eldy/tpl/index.html delete mode 100644 htdocs/theme/eldy/tpl/index.php create mode 100644 htdocs/theme/index.html delete mode 100644 htdocs/theme/index.php create mode 100644 htdocs/user/admin/index.html create mode 100644 htdocs/user/class/index.html create mode 100644 htdocs/webservices/admin/index.html diff --git a/htdocs/accountancy/class/index.html b/htdocs/accountancy/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/accountancy/index.html b/htdocs/accountancy/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/accountancy/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/adherents/canvas/default/index.php b/htdocs/adherents/canvas/default/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/adherents/canvas/default/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/adherents/canvas/default/tpl/index.html b/htdocs/adherents/canvas/default/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/adherents/canvas/default/tpl/index.php b/htdocs/adherents/canvas/default/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/adherents/canvas/default/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/adherents/canvas/index.html b/htdocs/adherents/canvas/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/adherents/canvas/index.php b/htdocs/adherents/canvas/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/adherents/canvas/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/adherents/cartes/index.html b/htdocs/adherents/cartes/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/adherents/cartes/index.php b/htdocs/adherents/cartes/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/adherents/cartes/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/adherents/class/index.html b/htdocs/adherents/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/asterisk/index.html b/htdocs/asterisk/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/asterisk/index.php b/htdocs/asterisk/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/asterisk/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/barcode/index.html b/htdocs/barcode/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/bookmarks/admin/index.html b/htdocs/bookmarks/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/bookmarks/class/index.html b/htdocs/bookmarks/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/bookmarks/index.html b/htdocs/bookmarks/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/bookmarks/index.php b/htdocs/bookmarks/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/bookmarks/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/boutique/admin/index.html b/htdocs/boutique/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/boutique/client/class/index.html b/htdocs/boutique/client/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/boutique/commande/class/index.html b/htdocs/boutique/commande/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/boutique/critiques/class/index.html b/htdocs/boutique/critiques/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/boutique/promotion/class/index.html b/htdocs/boutique/promotion/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/admin/index.html b/htdocs/cashdesk/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/class/index.html b/htdocs/cashdesk/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/class/index.php b/htdocs/cashdesk/class/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/cashdesk/class/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/cashdesk/css/index.html b/htdocs/cashdesk/css/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/img/index.html b/htdocs/cashdesk/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/img/index.php b/htdocs/cashdesk/img/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/cashdesk/img/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/cashdesk/include/index.html b/htdocs/cashdesk/include/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/include/index.php b/htdocs/cashdesk/include/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/cashdesk/include/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/cashdesk/javascript/index.html b/htdocs/cashdesk/javascript/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/javascript/index.php b/htdocs/cashdesk/javascript/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/cashdesk/javascript/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/cashdesk/tpl/index.html b/htdocs/cashdesk/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cashdesk/tpl/index.php b/htdocs/cashdesk/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/cashdesk/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/categories/admin/index.html b/htdocs/categories/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/categories/class/index.html b/htdocs/categories/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/action/class/index.html b/htdocs/comm/action/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/admin/index.html b/htdocs/comm/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/mailing/class/index.html b/htdocs/comm/mailing/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/propal/class/index.html b/htdocs/comm/propal/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/propal/tpl/index.html b/htdocs/comm/propal/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/comm/prospect/class/index.html b/htdocs/comm/prospect/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/commande/class/index.html b/htdocs/commande/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/commande/tpl/index.html b/htdocs/commande/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/bank/class/index.html b/htdocs/compta/bank/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/deplacement/class/index.html b/htdocs/compta/deplacement/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/dons/class/index.html b/htdocs/compta/dons/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/facture/admin/index.html b/htdocs/compta/facture/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/facture/class/index.html b/htdocs/compta/facture/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/facture/index.html b/htdocs/compta/facture/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/compta/facture/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/compta/facture/tpl/index.html b/htdocs/compta/facture/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/journal/index.html b/htdocs/compta/journal/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/localtax/class/index.html b/htdocs/compta/localtax/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/paiement/cheque/class/index.html b/htdocs/compta/paiement/cheque/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/paiement/class/index.html b/htdocs/compta/paiement/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/payment_sc/index.html b/htdocs/compta/payment_sc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/prelevement/class/index.html b/htdocs/compta/prelevement/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/salaries/class/index.html b/htdocs/compta/salaries/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/sociales/class/index.html b/htdocs/compta/sociales/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/compta/tva/class/index.html b/htdocs/compta/tva/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/conf/index.html b/htdocs/conf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/canvas/default/index.html b/htdocs/contact/canvas/default/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/canvas/default/index.php b/htdocs/contact/canvas/default/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/contact/canvas/default/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/contact/canvas/default/tpl/index.html b/htdocs/contact/canvas/default/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/canvas/default/tpl/index.php b/htdocs/contact/canvas/default/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/contact/canvas/default/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/contact/canvas/index.html b/htdocs/contact/canvas/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/canvas/index.php b/htdocs/contact/canvas/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/contact/canvas/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/contact/class/index.html b/htdocs/contact/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/index.html b/htdocs/contact/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/contact/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/contrat/admin/index.html b/htdocs/contrat/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contrat/class/index.html b/htdocs/contrat/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/contrat/tpl/index.html b/htdocs/contrat/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/ajax/index.html b/htdocs/core/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/ajax/index.php b/htdocs/core/ajax/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/ajax/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/boxes/index.html b/htdocs/core/boxes/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/boxes/index.php b/htdocs/core/boxes/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/boxes/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/class/index.html b/htdocs/core/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/class/index.php b/htdocs/core/class/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/class/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/db/index.html b/htdocs/core/db/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/db/index.php b/htdocs/core/db/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/db/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html b/htdocs/core/filemanagerdol/browser/default/images/icons/32/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/browser/default/images/icons/index.html b/htdocs/core/filemanagerdol/browser/default/images/icons/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/browser/default/images/index.html b/htdocs/core/filemanagerdol/browser/default/images/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/browser/default/index.html b/htdocs/core/filemanagerdol/browser/default/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/browser/default/js/index.html b/htdocs/core/filemanagerdol/browser/default/js/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/browser/index.html b/htdocs/core/filemanagerdol/browser/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/connectors/index.html b/htdocs/core/filemanagerdol/connectors/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/connectors/php/index.html b/htdocs/core/filemanagerdol/connectors/php/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/index.html b/htdocs/core/filemanagerdol/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/filemanagerdol/index.php b/htdocs/core/filemanagerdol/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/filemanagerdol/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/index.html b/htdocs/core/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/index.php b/htdocs/core/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/js/index.html b/htdocs/core/js/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/js/index.php b/htdocs/core/js/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/js/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/lib/index.html b/htdocs/core/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/lib/index.php b/htdocs/core/lib/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/lib/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/login/index.html b/htdocs/core/login/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/login/index.php b/htdocs/core/login/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/login/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/menus/index.html b/htdocs/core/menus/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/menus/index.php b/htdocs/core/menus/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/menus/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/menus/standard/index.html b/htdocs/core/menus/standard/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/menus/standard/index.php b/htdocs/core/menus/standard/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/menus/standard/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/modules/action/index.html b/htdocs/core/modules/action/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/barcode/doc/index.html b/htdocs/core/modules/barcode/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/barcode/index.html b/htdocs/core/modules/barcode/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/cheque/index.html b/htdocs/core/modules/cheque/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/cheque/pdf/index.html b/htdocs/core/modules/cheque/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/commande/doc/index.html b/htdocs/core/modules/commande/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/commande/index.html b/htdocs/core/modules/commande/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/contract/doc/index.html b/htdocs/core/modules/contract/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/contract/index.html b/htdocs/core/modules/contract/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/dons/index.html b/htdocs/core/modules/dons/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/expedition/doc/index.html b/htdocs/core/modules/expedition/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/expedition/index.html b/htdocs/core/modules/expedition/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/export/index.html b/htdocs/core/modules/export/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/facture/doc/index.html b/htdocs/core/modules/facture/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/facture/index.html b/htdocs/core/modules/facture/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/fichinter/doc/index.html b/htdocs/core/modules/fichinter/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/fichinter/index.html b/htdocs/core/modules/fichinter/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/import/index.html b/htdocs/core/modules/import/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/index.html b/htdocs/core/modules/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/index.php b/htdocs/core/modules/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/modules/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/modules/livraison/index.html b/htdocs/core/modules/livraison/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/livraison/pdf/index.html b/htdocs/core/modules/livraison/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/mailings/index.html b/htdocs/core/modules/mailings/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/member/doc/index.html b/htdocs/core/modules/member/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/member/index.html b/htdocs/core/modules/member/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/printsheet/doc/index.html b/htdocs/core/modules/printsheet/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/printsheet/index.html b/htdocs/core/modules/printsheet/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/product/index.html b/htdocs/core/modules/product/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/project/index.html b/htdocs/core/modules/project/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/project/pdf/index.html b/htdocs/core/modules/project/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/project/task/index.html b/htdocs/core/modules/project/task/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/project/task/pdf/index.html b/htdocs/core/modules/project/task/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/propale/doc/index.html b/htdocs/core/modules/propale/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/propale/index.html b/htdocs/core/modules/propale/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/rapport/index.html b/htdocs/core/modules/rapport/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/security/generate/index.html b/htdocs/core/modules/security/generate/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/security/index.html b/htdocs/core/modules/security/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/societe/doc/index.html b/htdocs/core/modules/societe/doc/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/societe/index.html b/htdocs/core/modules/societe/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/supplier_invoice/index.html b/htdocs/core/modules/supplier_invoice/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/supplier_invoice/pdf/index.html b/htdocs/core/modules/supplier_invoice/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/supplier_order/index.html b/htdocs/core/modules/supplier_order/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/supplier_order/pdf/index.html b/htdocs/core/modules/supplier_order/pdf/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/modules/syslog/index.html b/htdocs/core/modules/syslog/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/tpl/ajax/index.html b/htdocs/core/tpl/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/tpl/index.html b/htdocs/core/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/tpl/index.php b/htdocs/core/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/core/triggers/index.html b/htdocs/core/triggers/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/core/triggers/index.php b/htdocs/core/triggers/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/core/triggers/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/cron/admin/index.html b/htdocs/cron/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cron/class/index.html b/htdocs/cron/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/cron/index.html b/htdocs/cron/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/ecm/ajax/index.html b/htdocs/ecm/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/ecm/class/index.html b/htdocs/ecm/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/ecm/tpl/index.html b/htdocs/ecm/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/expedition/class/index.html b/htdocs/expedition/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/expedition/tpl/index.html b/htdocs/expedition/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/exports/class/index.html b/htdocs/exports/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/externalsite/admin/index.html b/htdocs/externalsite/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/externalsite/index.html b/htdocs/externalsite/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/externalsite/index.php b/htdocs/externalsite/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/externalsite/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/fichinter/admin/index.html b/htdocs/fichinter/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fichinter/class/index.html b/htdocs/fichinter/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fichinter/index.html b/htdocs/fichinter/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/fichinter/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/fichinter/tpl/index.html b/htdocs/fichinter/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/ajax/index.html b/htdocs/fourn/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/class/index.html b/htdocs/fourn/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/commande/tpl/index.html b/htdocs/fourn/commande/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/facture/index.html b/htdocs/fourn/facture/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/fourn/facture/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/fourn/facture/tpl/index.html b/htdocs/fourn/facture/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/paiement/index.html b/htdocs/fourn/paiement/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/fourn/paiement/index.php b/htdocs/fourn/paiement/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/fourn/paiement/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/ftp/admin/index.html b/htdocs/ftp/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/holiday/admin/index.html b/htdocs/holiday/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/holiday/class/index.html b/htdocs/holiday/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/holiday/img/index.html b/htdocs/holiday/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/imports/class/index.html b/htdocs/imports/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/includes/adodbtime/index.html b/htdocs/includes/adodbtime/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/includes/adodbtime/index.php b/htdocs/includes/adodbtime/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/includes/adodbtime/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/includes/index.html b/htdocs/includes/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/includes/index.php b/htdocs/includes/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/includes/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/install/doctemplates/index.html b/htdocs/install/doctemplates/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/invoices/index.html b/htdocs/install/doctemplates/invoices/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/orders/index.html b/htdocs/install/doctemplates/orders/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/projects/index.html b/htdocs/install/doctemplates/projects/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/proposals/index.html b/htdocs/install/doctemplates/proposals/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/shipment/index.html b/htdocs/install/doctemplates/shipment/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/tasks/index.html b/htdocs/install/doctemplates/tasks/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/doctemplates/thirdparties/index.html b/htdocs/install/doctemplates/thirdparties/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/lib/index.html b/htdocs/install/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mssql/functions/index.html b/htdocs/install/mssql/functions/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mssql/index.html b/htdocs/install/mssql/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mysql/data/index.html b/htdocs/install/mysql/data/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mysql/functions/index.html b/htdocs/install/mysql/functions/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mysql/index.html b/htdocs/install/mysql/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mysql/migration/index.html b/htdocs/install/mysql/migration/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/mysql/tables/index.html b/htdocs/install/mysql/tables/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/pgsql/functions/index.html b/htdocs/install/pgsql/functions/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/install/pgsql/index.html b/htdocs/install/pgsql/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/livraison/class/index.html b/htdocs/livraison/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/livraison/index.html b/htdocs/livraison/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/livraison/index.php b/htdocs/livraison/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/livraison/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/mailmanspip/class/index.html b/htdocs/mailmanspip/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/mailmanspip/index.html b/htdocs/mailmanspip/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/margin/admin/index.html b/htdocs/margin/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/margin/lib/index.html b/htdocs/margin/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/margin/tabs/index.html b/htdocs/margin/tabs/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/opensurvey/class/index.html b/htdocs/opensurvey/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/opensurvey/css/index.html b/htdocs/opensurvey/css/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/opensurvey/img/index.html b/htdocs/opensurvey/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/opensurvey/public/index.html b/htdocs/opensurvey/public/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paybox/admin/index.html b/htdocs/paybox/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paybox/img/index.html b/htdocs/paybox/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paybox/index.html b/htdocs/paybox/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paybox/index.php b/htdocs/paybox/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/paybox/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/paybox/lib/index.html b/htdocs/paybox/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paypal/admin/index.html b/htdocs/paypal/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paypal/img/index.html b/htdocs/paypal/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paypal/index.html b/htdocs/paypal/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/paypal/index.php b/htdocs/paypal/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/paypal/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/paypal/lib/index.html b/htdocs/paypal/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/printipp/admin/index.html b/htdocs/printipp/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/printipp/lib/index.html b/htdocs/printipp/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/admin/index.html b/htdocs/product/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/ajax/index.html b/htdocs/product/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/index.html b/htdocs/product/canvas/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/index.php b/htdocs/product/canvas/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/canvas/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/canvas/product/index.html b/htdocs/product/canvas/product/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/product/index.php b/htdocs/product/canvas/product/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/canvas/product/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/canvas/product/tpl/index.html b/htdocs/product/canvas/product/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/product/tpl/index.php b/htdocs/product/canvas/product/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/canvas/product/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/canvas/service/index.html b/htdocs/product/canvas/service/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/service/index.php b/htdocs/product/canvas/service/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/canvas/service/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/canvas/service/tpl/index.html b/htdocs/product/canvas/service/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/canvas/service/tpl/index.php b/htdocs/product/canvas/service/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/canvas/service/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/class/index.html b/htdocs/product/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/composition/index.html b/htdocs/product/composition/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/composition/index.php b/htdocs/product/composition/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/composition/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/stats/index.html b/htdocs/product/stats/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/stats/index.php b/htdocs/product/stats/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/product/stats/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/product/stock/class/index.html b/htdocs/product/stock/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/stock/img/index.html b/htdocs/product/stock/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/product/stock/lib/index.html b/htdocs/product/stock/lib/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/projet/admin/index.html b/htdocs/projet/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/projet/class/index.html b/htdocs/projet/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/public/cron/index.html b/htdocs/public/cron/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/public/emailing/index.html b/htdocs/public/emailing/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/resource/class/index.html b/htdocs/resource/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/resource/img/index.html b/htdocs/resource/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/resource/index.html b/htdocs/resource/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/ajax/index.html b/htdocs/societe/ajax/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/company/index.html b/htdocs/societe/canvas/company/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/company/index.php b/htdocs/societe/canvas/company/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/societe/canvas/company/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/societe/canvas/company/tpl/index.html b/htdocs/societe/canvas/company/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/company/tpl/index.php b/htdocs/societe/canvas/company/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/societe/canvas/company/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/societe/canvas/index.html b/htdocs/societe/canvas/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/individual/index.html b/htdocs/societe/canvas/individual/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/individual/index.php b/htdocs/societe/canvas/individual/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/societe/canvas/individual/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/societe/canvas/individual/tpl/index.html b/htdocs/societe/canvas/individual/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/canvas/individual/tpl/index.php b/htdocs/societe/canvas/individual/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/societe/canvas/individual/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/societe/checkvat/index.html b/htdocs/societe/checkvat/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/checkvat/index.php b/htdocs/societe/checkvat/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/societe/checkvat/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/societe/class/index.html b/htdocs/societe/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/societe/tpl/index.html b/htdocs/societe/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/amarok/ckeditor/index.html b/htdocs/theme/amarok/ckeditor/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/amarok/img/index.html b/htdocs/theme/amarok/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/amarok/index.html b/htdocs/theme/amarok/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/amarok/index.php b/htdocs/theme/amarok/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/amarok/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/amarok/tpl/index.html b/htdocs/theme/amarok/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/amarok/tpl/index.php b/htdocs/theme/amarok/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/amarok/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/auguria/ckeditor/index.html b/htdocs/theme/auguria/ckeditor/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/auguria/img/index.html b/htdocs/theme/auguria/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/auguria/img/menus/index.html b/htdocs/theme/auguria/img/menus/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/auguria/index.html b/htdocs/theme/auguria/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/auguria/index.php b/htdocs/theme/auguria/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/auguria/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/auguria/tpl/index.html b/htdocs/theme/auguria/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/auguria/tpl/index.php b/htdocs/theme/auguria/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/auguria/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/bureau2crea/ckeditor/index.html b/htdocs/theme/bureau2crea/ckeditor/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/img/bouton/index.html b/htdocs/theme/bureau2crea/img/bouton/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/img/index.html b/htdocs/theme/bureau2crea/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/img/menus/index.html b/htdocs/theme/bureau2crea/img/menus/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/index.html b/htdocs/theme/bureau2crea/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/index.php b/htdocs/theme/bureau2crea/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/bureau2crea/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/bureau2crea/tpl/index.html b/htdocs/theme/bureau2crea/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/bureau2crea/tpl/index.php b/htdocs/theme/bureau2crea/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/bureau2crea/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/cameleo/ckeditor/index.html b/htdocs/theme/cameleo/ckeditor/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/img/bouton/index.html b/htdocs/theme/cameleo/img/bouton/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/img/index.html b/htdocs/theme/cameleo/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/img/menus/index.html b/htdocs/theme/cameleo/img/menus/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/index.html b/htdocs/theme/cameleo/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/index.php b/htdocs/theme/cameleo/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/cameleo/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/cameleo/tpl/index.html b/htdocs/theme/cameleo/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/cameleo/tpl/index.php b/htdocs/theme/cameleo/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/cameleo/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/common/devices/index.html b/htdocs/theme/common/devices/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/emotes/index.html b/htdocs/theme/common/emotes/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/flags/index.html b/htdocs/theme/common/flags/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/index.html b/htdocs/theme/common/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/mime/index.html b/htdocs/theme/common/mime/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/treemenu/index.html b/htdocs/theme/common/treemenu/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/common/weather/index.html b/htdocs/theme/common/weather/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/ckeditor/index.html b/htdocs/theme/eldy/ckeditor/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/img/index.html b/htdocs/theme/eldy/img/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/img/menus/index.html b/htdocs/theme/eldy/img/menus/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/index.html b/htdocs/theme/eldy/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/index.php b/htdocs/theme/eldy/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/eldy/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/eldy/tpl/index.html b/htdocs/theme/eldy/tpl/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/eldy/tpl/index.php b/htdocs/theme/eldy/tpl/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/eldy/tpl/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/theme/index.html b/htdocs/theme/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/theme/index.php b/htdocs/theme/index.php deleted file mode 100644 index 7db0dd9ebf9..00000000000 --- a/htdocs/theme/index.php +++ /dev/null @@ -1 +0,0 @@ -Url not available \ No newline at end of file diff --git a/htdocs/user/admin/index.html b/htdocs/user/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/user/class/index.html b/htdocs/user/class/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/htdocs/webservices/admin/index.html b/htdocs/webservices/admin/index.html new file mode 100644 index 00000000000..e69de29bb2d From 2dd3bacd4f31dfba28f37ef7b3626148e3e8c623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 12 Jul 2014 23:30:01 +0200 Subject: [PATCH 220/502] Removed no longer needed files --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d0f4a919cde..9b639ce64a6 100755 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,4 @@ doxygen_warnings.log *.iml Thumbs.db # Vagrant generated files -.vagrant -/index.html -/phpmyadmin -/xhprof +.vagrant \ No newline at end of file From 1ae4341d57d24d878e4dbd26376762d0f9182c10 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Mon, 14 Jul 2014 16:53:12 +0300 Subject: [PATCH 221/502] Fix Link product --- htdocs/margin/productMargins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 3a53c9570f2..cf03ab5b7e2 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -260,7 +260,7 @@ if ($result) } else { $product_static->type=$objp->fk_product_type; - $product_static->id=$objp->fk_product; + $product_static->id=$objp->rowid; $product_static->ref=$objp->ref; $product_static->libelle=$objp->label; $text=$product_static->getNomUrl(1); From fcc0632beb0918c44e259c82c51ec5aeb4bf6bc7 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Mon, 14 Jul 2014 17:18:31 +0300 Subject: [PATCH 222/502] In list view and label product --- htdocs/margin/productMargins.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index cf03ab5b7e2..a8830f777ec 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -259,13 +259,15 @@ if ($result) print dol_print_date($db->jdate($objp->datef),'day')."
'; $product_static->type=$objp->fk_product_type; $product_static->id=$objp->rowid; $product_static->ref=$objp->ref; $product_static->libelle=$objp->label; $text=$product_static->getNomUrl(1); - $text.= ' - '.$objp->label; - print "".$product_static->getNomUrl(1)."".$product_static->getNomUrl(1)."".price($pv, null, null, null, null, $rounding)."".price($pa, null, null, null, null, $rounding)."
'; print ""; - print_liste_field_titre($langs->trans("Product"),"", "p.ref","&id=".$_GET['id'],"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$_GET['id'],"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AverageUnitPricePMPShort"),"", "ps.pmp","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EstimatedStockValueShort"),"", "","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder); - if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellPriceMin"),"", "p.price","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder); - if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("EstimatedStockValueSellShort"),"", "","&id=".$_GET['id'],"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Product"),"", "p.ref","&id=".$id,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),"", "p.label","&id=".$id,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Units"),"", "ps.reel","&id=".$id,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AverageUnitPricePMPShort"),"", "ps.pmp","&id=".$id,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("EstimatedStockValueShort"),"", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); + if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellPriceMin"),"", "p.price","&id=".$id,"",'align="right"',$sortfield,$sortorder); + if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("EstimatedStockValueSellShort"),"", "","&id=".$id,"",'align="right"',$sortfield,$sortorder); if ($user->rights->stock->mouvement->creer) print ''; if ($user->rights->stock->creer) print ''; print ""; From ad4512cb24de7df7625f43896225c8aa8f63b0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 15 Jul 2014 17:18:41 +0200 Subject: [PATCH 227/502] Avoiding include in case of unexisting file --- htdocs/core/lib/functions.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 78326ee3bb7..eb2cc15de15 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -236,11 +236,15 @@ function dol_getprefix() * * @param string $relpath Relative path to file (Ie: mydir/myfile, ../myfile, ...) * @param string $classname Class name - * @return int false if include fails. + * @return bool */ function dol_include_once($relpath, $classname='') { - global $conf,$langs,$user,$mysoc; // Other global var must be retreived with $GLOBALS['var'] + + if (!file_exists($relpath)) { + dol_syslog('functions::dol_include_once Tried to load unexisting file: '.$relpath, LOG_ERR); + return false; + } if (! empty($classname) && ! class_exists($classname)) { return include dol_buildpath($relpath); From 8a17feb69ba02ecf22c817391bdcf7908b438603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 15 Jul 2014 17:35:12 +0200 Subject: [PATCH 228/502] Deprecated some functions and improved method documentation --- htdocs/core/lib/functions.lib.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b1f11590bdc..81671ab82d3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3631,20 +3631,19 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8') /** - * Replace CRLF in string with a HTML BR tag + * Replace CRLF in string with a HTML BR tag * - * @param string $stringtoencode String to encode - * @param string $nl2brmode 0=Adding br before \n, 1=Replacing \n by br - * @param string $forxml false=Use
, true=Use
- * @return string String encoded + * @param string $stringtoencode String to encode + * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br + * @param bool $forxml false=Use
, true=Use
+ * @return string String encoded */ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false) { if (! $nl2brmode) { - // We use @ to avoid warning on PHP4 that does not support entity encoding from UTF8; - if (version_compare(PHP_VERSION, '5.3.0') < 0) return @nl2br($stringtoencode); - else return @nl2br($stringtoencode,$forxml); + if (version_compare(PHP_VERSION, '5.3.0') < 0) return nl2br($stringtoencode); + else return nl2br($stringtoencode,$forxml); } else { @@ -3744,12 +3743,11 @@ function dol_html_entity_decode($a,$b,$c='UTF-8') * @param string $encoding Encoding * @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities * @return string $ret Encoded string + * @deprecated Since PHP4 support is no longer available, this function does not make sense */ function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false) { - // We use @ to avoid warning on PHP4 that does not support entity decoding to UTF8; - $ret=@htmlentities($string, $flags, $encoding, $double_encode); - return $ret; + return htmlentities($string, $flags, $encoding, $double_encode); } @@ -3780,7 +3778,7 @@ function dol_string_is_good_iso($s) * Return nb of lines of a clear text * * @param string $s String to check - * @param string $maxchar Not yet used + * @param int $maxchar Not yet used * @return int Number of lines */ function dol_nboflines($s,$maxchar=0) @@ -3835,12 +3833,12 @@ function dol_nboflines_bis($text,$maxlinesize=0,$charset='UTF-8') /** * Same function than microtime in PHP 5 but compatible with PHP4 * - * @return float Time (millisecondes) with microsecondes in decimal part + * @return float Time (millisecondes) with microsecondes in decimal part + * @deprecated Dolibarr does not support PHP4, you should use native function */ function dol_microtime_float() { - list($usec, $sec) = explode(" ", microtime()); - return ((float) $usec + (float) $sec); + return microtime(); } /** From 0cb11a537d35a336956e94536f6d011f70512014 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 15 Jul 2014 23:27:11 +0200 Subject: [PATCH 229/502] Fix: IP address of user was lost into paypal confirm email --- htdocs/paybox/lib/paybox.lib.php | 23 ----------------------- htdocs/paypal/lib/paypal.lib.php | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index f56367c9a36..09bacc3764f 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -183,27 +183,6 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG) // Formulaire pour module Paybox print '
'."\n"; - // For Paybox V1 (IBS_xxx) - /* - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - */ - // For Paybox V2 (PBX_xxx) print ''."\n"; print ''."\n"; @@ -228,8 +207,6 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG) print ''."\n"; - // Formulaire pour module Paybox v2 (PBX_xxx) - print "\n"; print ''."\n"; } - - if ($mesg) print $mesg; - /* * Barre d'action */ @@ -1438,8 +1431,6 @@ if ($step == 5 && $datatoimport) } print ''; } - - if ($mesg) print $mesg; } @@ -1679,8 +1670,6 @@ if ($step == 6 && $datatoimport) print $langs->trans("FileWasImported",$importid).'
'; print $langs->trans("YouCanUseImportIdToFindRecord",$importid).'
'; print ''; - - if ($mesg) print $mesg; } diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 7eefafb9c8c..30e02591190 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -67,7 +67,7 @@ if ($action == 'setvalue' && $user->admin) if (! $error) { $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; + setEventMessage($langs->trans("SetupSaved")); } else { @@ -227,8 +227,6 @@ if (! empty($conf->adherent->enabled)) print "
"; print info_admin($langs->trans("YouCanAddTagOnUrl")); -dol_htmloutput_mesg($mesg); - $db->close(); dol_fiche_end(); llxFooter(); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 527615cc7c4..037bb2b1f8b 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -43,7 +43,7 @@ $rowid=GETPOST('rowid','int'); $action=GETPOST('action', 'alpha'); $socid=GETPOST('socid', 'int'); $backtopage=GETPOST('backtopage','alpha'); -$error=0; $mesg = ''; +$error=0; // If socid provided by ajax company selector if (! empty($_REQUEST['search_fourn_id'])) @@ -92,7 +92,7 @@ if ($action == 'remove_pf') { $result=$product->remove_product_fournisseur_price($rowid); $action = ''; - $mesg = '
'.$langs->trans("PriceRemoved").'.
'; + setEventMessage($langs->trans("PriceRemoved")); } } } @@ -112,27 +112,27 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) if ($tva_tx == '') { $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors'); } if (empty($quantity)) { $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors'); } if (empty($ref_fourn)) { $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors'); } if ($id_fourn <= 0) { $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors'); } if ($_POST["price"] < 0 || $_POST["price"] == '') { $error++; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'
'; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors'); } $product = new ProductFournisseur($db); @@ -140,7 +140,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) if ($result <= 0) { $error++; - $mesg=$product->error; + setEventMessage($product->error, 'errors'); } if (! $error) @@ -157,12 +157,12 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) $product->fetch($product->product_id_already_linked); $productLink = $product->getNomUrl(1,'supplier'); - $mesg='
'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'
'; + setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors'); } else if ($ret < 0) { $error++; - $mesg='
'.$product->error.'
'; + setEventMessage($product->error, 'errors'); } } @@ -177,7 +177,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) if ($ret < 0) { $error++; - $mesg='
'.$product->error.'
'; + setEventMessage($product->error, 'errors'); } } @@ -264,10 +264,6 @@ if ($id || $ref) print "\n"; - - dol_htmloutput_mesg($mesg); - - // Form to add or update a price if (($action == 'add_price' || $action == 'updateprice' ) && ($user->rights->produit->creer || $user->rights->service->creer)) { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index f5db524ed27..9c0597ec0f6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -94,15 +94,16 @@ if ($action == 'update_price' && ! $_POST ["cancel"] && ($user->rights->produit- if ($object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq) > 0) { $action = ''; - $mesg = '
' . $langs->trans("RecordSaved") . '
'; + setEventMessage($langs->trans("RecordSaved")); } else { $action = 'edit_price'; - $mesg = '
' . $object->error . '
'; + setEventMessage($object->error, 'errors'); } } else if ($action == 'delete' && $user->rights->produit->supprimer) { $result = $object->log_price_delete($user, $_GET ["lineid"]); - if ($result < 0) - $mesg = '
' . $object->error . '
'; + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } } /** @@ -136,11 +137,11 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu if (empty($quantity)) { $error ++; - $mesg = '
' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")) . '
'; + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), 'errors'); } if (empty($newprice)) { $error ++; - $mesg = '
' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")) . '
'; + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), 'errors'); } if (! $error) { // Calcul du prix HT et du prix unitaire @@ -547,10 +548,6 @@ print "
  
\n"; print "\n"; -if (! empty($mesg)) { - dol_htmloutput_mesg($mesg); -} - /* ************************************************************************** */ /* */ /* Barre d'action */ diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 874b082ceae..86e930d8cf1 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -43,8 +43,6 @@ $id = GETPOST("id",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="DESC"; -$mesg = ''; - // Security check $result=restrictedArea($user,'stock'); @@ -80,10 +78,10 @@ if ($action == 'add' && $user->rights->stock->creer) } $action = 'create'; - $mesg='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } else { - $mesg='
'.$langs->trans("ErrorWarehouseRefRequired").'
'; + setEventMessage($langs->trans("ErrorWarehouseRefRequired"), 'errors'); $action="create"; // Force retour sur page creation } } @@ -101,7 +99,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right } else { - $mesg='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); $action=''; } } @@ -124,18 +122,17 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) if ( $object->update($id, $user) > 0) { $action = ''; - //$mesg = '
Fiche mise a jour
'; } else { $action = 'edit'; - $mesg = '
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } else { $action = 'edit'; - $mesg = '
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } @@ -167,8 +164,6 @@ if ($action == 'create') print ''; print ''."\n"; - dol_htmloutput_mesg($mesg); - print ''; // Ref @@ -219,8 +214,6 @@ else $id=GETPOST("id",'int'); if ($id) { - dol_htmloutput_mesg($mesg); - $object = new Entrepot($db); $result = $object->fetch($id); if ($result < 0) @@ -496,7 +489,7 @@ else */ if (($action == 'edit' || $action == 're-edit') && 1) { - print_fiche_titre($langs->trans("WarehouseEdit"), $mesg); + $langs->trans("WarehouseEdit"); print ''; print ''; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 3a5827904f2..5251f6bc750 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -45,7 +45,6 @@ $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); $subaction = GETPOST('subaction','alpha'); $group = GETPOST("group","int",3); -$message=''; // Define value to know what current user can do on users $canadduser=(! empty($user->admin) || $user->rights->user->user->creer); @@ -110,6 +109,8 @@ if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) } if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) { + $error = 0; + if ($id <> $user->id) { $object->fetch($id); @@ -119,11 +120,12 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) $nb = $object->getNbOfUsers("active"); if ($nb >= $conf->file->main_limit_users) { - $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; + $error++; + setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); } } - if (! $message) + if (! $error) { $object->setstatus(1); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); @@ -142,7 +144,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) if ($result < 0) { $langs->load("errors"); - $message='
'.$langs->trans("ErrorUserCannotBeDelete").'
'; + setEventMessage($langs->trans("ErrorUserCannotBeDelete"), 'errors'); } else { @@ -155,14 +157,18 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) // Action ajout user if ($action == 'add' && $canadduser) { + $error = 0; + if (! $_POST["lastname"]) { - $message='
'.$langs->trans("NameNotDefined").'
'; + $error++; + setEventMessage($langs->trans("NameNotDefined"), 'errors'); $action="create"; // Go back to create page } if (! $_POST["login"]) { - $message='
'.$langs->trans("LoginNotDefined").'
'; + $error++; + setEventMessage($langs->trans("LoginNotDefined"), 'errors'); $action="create"; // Go back to create page } @@ -171,13 +177,13 @@ if ($action == 'add' && $canadduser) $nb = $object->getNbOfUsers("active"); if ($nb >= $conf->file->main_limit_users) { - $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; + $error++; + setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors'); $action="create"; // Go back to create page } } - if (! $message) - { + if (!$error) { $object->lastname = GETPOST("lastname",'alpha'); $object->firstname = GETPOST("firstname",'alpha'); $object->login = GETPOST("login",'alpha'); @@ -266,7 +272,7 @@ if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) } else { - $message.=$object->error; + setEventMessage($object->error, 'errors'); } } } @@ -281,13 +287,13 @@ if ($action == 'update' && ! $_POST["cancel"]) if (! $_POST["lastname"]) { - $message='
'.$langs->trans("NameNotDefined").'
'; + setEventMessage($langs->trans("NameNotDefined"), 'errors'); $action="edit"; // Go back to create page $error++; } if (! $_POST["login"]) { - $message='
'.$langs->trans("LoginNotDefined").'
'; + setEventMessage($langs->trans("LoginNotDefined"), 'errors'); $action="edit"; // Go back to create page $error++; } @@ -304,7 +310,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $result=$tmpuser->fetch(0, GETPOST("login")); if ($result > 0) { - $message='
'.$langs->trans("ErrorLoginAlreadyExists").'
'; + setEventMessage($langs->trans("ErrorLoginAlreadyExists"), 'errors'); $action="edit"; // Go back to create page $error++; } @@ -367,11 +373,11 @@ if ($action == 'update' && ! $_POST["cancel"]) if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - $message.='
'.$langs->trans("ErrorLoginAlreadyExists",$object->login).'
'; + setEventMessage($langs->trans("ErrorLoginAlreadyExists",$object->login), 'errors'); } else { - $message.='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } @@ -395,12 +401,12 @@ if ($action == 'update' && ! $_POST["cancel"]) $sql.= " SET fk_socpeople=NULL, fk_societe=NULL"; $sql.= " WHERE rowid=".$object->id; } + dol_syslog("fiche::update", LOG_DEBUG); $resql=$db->query($sql); - dol_syslog("fiche::update", LOG_DEBUG); if (! $resql) { $error++; - $message.='
'.$db->lasterror().'
'; + setEventMessage($db->lasterror(), 'errors'); } } @@ -427,7 +433,7 @@ if ($action == 'update' && ! $_POST["cancel"]) if (! $result > 0) { - $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; + setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); } else { @@ -445,7 +451,7 @@ if ($action == 'update' && ! $_POST["cancel"]) if (! $error && ! count($object->errors)) { - $message.='
'.$langs->trans("UserModified").'
'; + setEventMessage($langs->trans("UserModified")); $db->commit(); $login=$_SESSION["dol_login"]; @@ -469,7 +475,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $ret=$object->setPassword($user,$_POST["password"]); if ($ret < 0) { - $message.='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } } @@ -484,7 +490,7 @@ if ((($action == 'confirm_password' && $confirm == 'yes') if ($newpassword < 0) { // Echec - $message = '
'.$langs->trans("ErrorFailedToSetNewPassword").'
'; + setEventMessage($langs->trans("ErrorFailedToSetNewPassword"), 'errors'); } else { @@ -493,18 +499,16 @@ if ((($action == 'confirm_password' && $confirm == 'yes') { if ($object->send_password($user,$newpassword) > 0) { - $message = '
'.$langs->trans("PasswordChangedAndSentTo",$object->email).'
'; - //$message.=$newpassword; + setEventMessage($langs->trans("PasswordChangedAndSentTo",$object->email)); } else { - $message = '
'.$langs->trans("PasswordChangedTo",$newpassword).'
'; - $message.= '
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } else { - $message = '
'.$langs->trans("PasswordChangedTo",$newpassword).'
'; + setEventMessage($langs->trans("PasswordChangedTo",$newpassword), 'errors'); } } } @@ -562,7 +566,7 @@ if ($action == 'adduserldap') } else { - $message='
'.$ldap->error.'
'; + setEventMessage($ldap->error, 'errors'); } } @@ -590,8 +594,6 @@ if (($action == 'create') || ($action == 'adduserldap')) print "
"; print "
"; - dol_htmloutput_mesg($message); - if (! empty($conf->ldap->enabled) && (isset($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr')) { /* @@ -648,12 +650,12 @@ if (($action == 'create') || ($action == 'adduserldap')) } else { - $message='
'.$ldap->error.'
'; + setEventMessage($ldap->error, 'errors'); } } else { - $message='
'.$ldap->error.'
'; + setEventMessage($ldap->error, 'errors'); } // Si la liste des users est rempli, on affiche la liste deroulante @@ -977,7 +979,7 @@ else $entries = $ldap->fetch($object->login,$userSearchFilter); if (! $entries) { - $message .= $ldap->error; + setEventMessage($ldap->error, 'errors'); } $passDoNotExpire = 0; @@ -1056,8 +1058,6 @@ else print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1); } - dol_htmloutput_mesg($message); - /* * Fiche en mode visu */ diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 625195bfa68..f97ef35ae6e 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -48,7 +48,6 @@ $id=GETPOST('id', 'int'); $action=GETPOST('action', 'alpha'); $confirm=GETPOST('confirm', 'alpha'); $userid=GETPOST('user', 'int'); -$message=''; // Security check $result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user'); @@ -76,7 +75,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") else { $langs->load("errors"); - $message = '
'.$langs->trans('ErrorForbidden').'
'; + setEventMessage($langs->trans('ErrorForbidden'), 'errors'); } } @@ -87,14 +86,10 @@ if ($action == 'add') { if ($caneditperms) { - if (! $_POST["nom"]) - { - $message='
'.$langs->trans("NameNotDefined").'
'; + if (! $_POST["nom"]) { + setEventMessage($langs->trans("NameNotDefined"), 'errors'); $action="create"; // Go back to create page - } - - if (! $message) - { + } else { $object->nom = trim($_POST["nom"]); $object->note = trim($_POST["note"]); @@ -117,7 +112,7 @@ if ($action == 'add') $db->rollback(); $langs->load("errors"); - $message='
'.$langs->trans("ErrorGroupAlreadyExists",$object->nom).'
'; + setEventMessage($langs->trans("ErrorGroupAlreadyExists",$object->nom), 'errors'); $action="create"; // Go back to create page } } @@ -125,7 +120,7 @@ if ($action == 'add') else { $langs->load("errors"); - $message = '
'.$langs->trans('ErrorForbidden').'
'; + setEventMessage($langs->trans('ErrorForbidden'), 'errors'); } } @@ -151,14 +146,14 @@ if ($action == 'adduser' || $action =='removeuser') } else { - $message.=$edituser->error; + setEventMessage($edituser->error, 'errors'); } } } else { $langs->load("errors"); - $message = '
'.$langs->trans('ErrorForbidden').'
'; + setEventMessage($langs->trans('ErrorForbidden'), 'errors'); } } @@ -183,19 +178,19 @@ if ($action == 'update') if ($ret >= 0 && ! count($object->errors)) { - $message.='
'.$langs->trans("GroupModified").'
'; + setEventMessage($langs->trans("GroupModified")); $db->commit(); } else { - $message.='
'.$object->error.'
'; + setEventMessage($object->error); $db->rollback(); } } else { $langs->load("errors"); - $message = '
'.$langs->trans('ErrorForbidden').'
'; + setEventMessage($langs->trans('ErrorForbidden')); } } @@ -214,8 +209,6 @@ if ($action == 'create') { print_fiche_titre($langs->trans("NewGroup")); - if ($message) { print $message."
"; } - print dol_set_focus('#nom'); print ''; @@ -340,9 +333,6 @@ else print "\n"; print "
\n"; - - dol_htmloutput_mesg($message); - /* * Liste des utilisateurs dans le groupe */ diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index cde5e764af5..c3e147620c2 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -56,8 +56,6 @@ $fgroup->getrights(); if ($action == 'dolibarr2ldap') { - $message=""; - $db->begin(); $ldap=new Ldap(); @@ -71,12 +69,12 @@ if ($action == 'dolibarr2ldap') if ($result >= 0) { - $message.='
'.$langs->trans("GroupSynchronized").'
'; + setEventMessage($langs->trans("GroupSynchronized")); $db->commit(); } else { - $message.='
'.$ldap->error.'
'; + setEventMessage($ldap->error); $db->rollback(); } } @@ -135,10 +133,6 @@ print "
\n"; print ''; - -dol_htmloutput_mesg($message); - - /* * Barre d'actions */ diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index ebf776e64aa..87a0dec31e2 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -52,8 +52,6 @@ $fuser->getrights(); if ($_GET["action"] == 'dolibarr2ldap') { - $message=""; - $db->begin(); $ldap=new Ldap(); @@ -67,12 +65,12 @@ if ($_GET["action"] == 'dolibarr2ldap') if ($result >= 0) { - $message.='
'.$langs->trans("UserSynchronized").'
'; + setEventMessage($langs->trans("UserSynchronized")); $db->commit(); } else { - $message.='
'.$ldap->error.'
'; + setEventMessage($ldap->error, 'errors'); $db->rollback(); } } @@ -152,10 +150,6 @@ print '
'; print ''; - -dol_htmloutput_mesg($message); - - /* * Barre d'actions */ From ac824728bc8e172d062c7afacb838e190a4a4d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 20 Jul 2014 01:09:43 +0200 Subject: [PATCH 263/502] Migrated old error notifications to the """new""" system --- htdocs/adherents/card_subscriptions.php | 4 +- htdocs/adherents/fiche.php | 95 +++++++++++++------------ htdocs/adherents/fiche_subscription.php | 2 - htdocs/adherents/type.php | 2 - htdocs/admin/fiscalyear_card.php | 16 ++--- htdocs/admin/ldap_users.php | 2 +- htdocs/admin/limits.php | 8 +-- htdocs/admin/mails.php | 10 ++- htdocs/admin/menus/index.php | 2 +- htdocs/admin/system/index.php | 9 ++- htdocs/admin/tools/update.php | 6 +- htdocs/bookmarks/fiche.php | 26 ++++--- htdocs/bookmarks/liste.php | 4 +- htdocs/categories/traduction.php | 8 +-- htdocs/categories/viewcat.php | 5 +- htdocs/comm/action/fiche.php | 17 ++--- htdocs/comm/remx.php | 16 ++--- htdocs/commande/contact.php | 5 +- htdocs/commande/fiche.php | 50 ++++++------- htdocs/commande/orderstoinvoice.php | 22 +++--- htdocs/compta/bank/annuel.php | 2 +- htdocs/compta/bank/bankid_fr.php | 4 +- htdocs/compta/bank/fiche.php | 6 +- htdocs/compta/bank/graph.php | 5 +- htdocs/compta/bank/ligne.php | 10 ++- htdocs/compta/bank/rappro.php | 6 +- htdocs/compta/bank/treso.php | 8 --- htdocs/compta/facture.php | 50 +++++++------ 28 files changed, 178 insertions(+), 222 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index e436fd5f694..fa7d59f040e 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -129,7 +129,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id) { $error++; - $mesg='
'.$langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly").'
'; + setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); } } @@ -165,7 +165,7 @@ if ($action == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST('socid','int')); $error++; - $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; + setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); } } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index e57e2b9eb1c..49eabe52d43 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -81,8 +81,6 @@ if (! empty($canvas)) // Security check $result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas); -$errmsg=''; $errmsgs=array(); - if ($rowid > 0) { // Load member @@ -128,7 +126,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights if ($userid != $user->id && $userid != $object->user_id) { $error++; - $mesg='
'.$langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly").'
'; + setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors'); } } @@ -164,7 +162,7 @@ if ($action == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch($socid); $error++; - $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; + setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors'); } } @@ -190,12 +188,12 @@ if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user if ($result < 0) { $langs->load("errors"); - $errmsg=$langs->trans($nuser->error); + setEventMessage($langs->trans($nuser->error), 'errors'); } } else { - $errmsg=$object->error; + setEventMessage($object->error, 'errors'); } } @@ -211,13 +209,13 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights if ($result < 0) { $langs->load("errors"); - $errmsg=$langs->trans($company->error); - $errmsgs=$company->errors; + setEventMessage($langs->trans($company->error), 'errors'); + setEventMessage($company->errors, 'errors'); } } else { - $errmsg=$object->error; + setEventMessage($object->error, 'errors'); } } @@ -231,7 +229,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes') $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $langs->load("mails"); - $mesg=$langs->trans("MailSuccessfulySent", $from, $object->email); + setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email)); } } @@ -252,12 +250,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); } // Create new object @@ -343,7 +341,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']); if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0) { - $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; + setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors'); } else { @@ -359,7 +357,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) } else { - $errmsgs[] = "ErrorBadImageFormat"; + setEventMessage("ErrorBadImageFormat", 'errors'); } } else @@ -387,8 +385,11 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) } else { - if ($object->error) $errmsg=$object->error; - else $errmsgs=$object->errors; + if ($object->error) { + setEventMessage($object->error, 'errors'); + } else { + setEventMessage($object->errors, 'errors'); + } $action=''; } } @@ -472,14 +473,14 @@ if ($action == 'add' && $user->rights->adherent->creer) // Check parameters if (empty($morphy) || $morphy == "-1") { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature")), 'errors'); } // Test si le login existe deja if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($login)) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Login"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Login")), 'errors'); } else { $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'"; @@ -490,32 +491,32 @@ if ($action == 'add' && $user->rights->adherent->creer) if ($num) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorLoginAlreadyExists",$login)."
\n"; + setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors'); } } if (empty($pass)) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Password")), 'errors'); } } if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); } if (! ($typeid > 0)) { // Keep () before ! $error++; - $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))."
\n"; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); } if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadEMail",$email)."
\n"; + setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors'); } $public=0; if (isset($public)) $public=1; @@ -536,8 +537,11 @@ if ($action == 'add' && $user->rights->adherent->creer) { $db->rollback(); - if ($object->error) $errmsg=$object->error; - else $errmsgs=$object->errors; + if ($object->error) { + setEventMessage($object->error, 'errors'); + } else { + setEventMessage($object->errors, 'errors'); + } $action = 'create'; } @@ -589,15 +593,18 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == if ($result < 0) { $error++; - $errmsg.=$object->error; + setEventMessage($object->error, 'errors'); } } } else { $error++; - if ($object->error) $errmsg=$object->error; - else $errmsgs=$object->errors; + if ($object->error) { + setEventMessage($object->error, 'errors'); + } else { + setEventMessage($object->errors, 'errors'); + } } if (! $error) @@ -613,6 +620,8 @@ if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == if ($user->rights->adherent->supprimer && $action == 'confirm_resign') { + $error = 0; + if ($confirm == 'yes') { $adht = new AdherentType($db); @@ -628,17 +637,23 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_resign') } if ($result < 0) { - $errmsg.=$object->error; + $error++; + setEventMessage($object->error, 'errors'); } } else { - if ($object->error) $errmsg=$object->error; - else $errmsgs=$object->errors; + $error++; + + if ($object->error) { + setEventMessage($object->error, 'errors'); + } else { + setEventMessage($object->errors, 'errors'); + } $action=''; } } - if (! empty($backtopage) && ! $errmsg) + if (! empty($backtopage) && ! $error) { header("Location: ".$backtopage); exit; @@ -652,7 +667,7 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $conf { if (!$mailmanspip->del_to_spip($object)) { - $errmsg.= $langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error."
\n"; + setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors'); } } } @@ -663,7 +678,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm { if (!$mailmanspip->add_to_spip($object)) { - $errmsg.= $langs->trans('AddIntoSpipError').': '.$mailmanspip->error."
\n"; + setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors'); } } } @@ -725,9 +740,6 @@ else print_fiche_titre($langs->trans("NewMember")); - dol_htmloutput_mesg($errmsg,$errmsgs,'error'); - dol_htmloutput_mesg($mesg,$mesgs); - if ($conf->use_javascript_ajax) { print "\n".' - -
+ + + +
This page is a sample of page using tables. To make test with
- css (edit page to change)
- jmobile (edit page to enable/disable)
- dataTables
- tablednd
-
-Example 0a : Table with div+div+div containg a select that should be overflowed and truncated
+


Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form
+ +
@@ -55,7 +76,9 @@ Example 0a : Table with div+div+div containg a select that should be overflowed
-Example 0b: Table with div+form+div containg a select that should be overflowed and truncated
+ +


Example 0b: Table with div+form+div containg a select that should be overflowed and truncated => Use this to align text or form
+
@@ -66,7 +89,9 @@ Example 0b: Table with div+form+div containg a select that should be overflowed
-Example 0c: Table with table+tr+td containg a select that should be overflowed and truncated
+ +


Example 0c: Table with table+tr+td containg a select that should be overflowed and truncated => Use this to align text or form
+ '."\n"; $var=!$var; -print ''."\n"; +print ''."\n"; $var=!$var; print ''."\n"; $var=!$var; diff --git a/htdocs/core/class/MobileDetect.class.php b/htdocs/core/class/MobileDetect.class.php new file mode 100644 index 00000000000..1f1795f51ea --- /dev/null +++ b/htdocs/core/class/MobileDetect.class.php @@ -0,0 +1,1248 @@ +, Nick Ilyin + * Original author: Victor Stanciu + * + * @license Code and contributions have 'MIT License' + * More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt + * + * @link Homepage: http://mobiledetect.net + * GitHub Repo: https://github.com/serbanghita/Mobile-Detect + * Google Code: http://code.google.com/p/php-mobile-detect/ + * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md + * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples + * + * @version 2.8.3 + */ + +class MobileDetect +{ + /** + * Mobile detection type. + * + * @deprecated since version 2.6.9 + */ + const DETECTION_TYPE_MOBILE = 'mobile'; + + /** + * Extended detection type. + * + * @deprecated since version 2.6.9 + */ + const DETECTION_TYPE_EXTENDED = 'extended'; + + /** + * A frequently used regular expression to extract version #s. + * + * @deprecated since version 2.6.9 + */ + const VER = '([\w._\+]+)'; + + /** + * Top-level device. + */ + const MOBILE_GRADE_A = 'A'; + + /** + * Mid-level device. + */ + const MOBILE_GRADE_B = 'B'; + + /** + * Low-level device. + */ + const MOBILE_GRADE_C = 'C'; + + /** + * Stores the version number of the current release. + */ + const VERSION = '2.8.3'; + + /** + * A type for the version() method indicating a string return value. + */ + const VERSION_TYPE_STRING = 'text'; + + /** + * A type for the version() method indicating a float return value. + */ + const VERSION_TYPE_FLOAT = 'float'; + + /** + * The User-Agent HTTP header is stored in here. + * @var string + */ + protected $userAgent = null; + + /** + * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE. + * @var array + */ + protected $httpHeaders = array(); + + /** + * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED. + * + * @deprecated since version 2.6.9 + * + * @var string + */ + protected $detectionType = self::DETECTION_TYPE_MOBILE; + + /** + * HTTP headers that trigger the 'isMobile' detection + * to be true. + * + * @var array + */ + protected static $mobileHeaders = array( + + 'HTTP_ACCEPT' => array('matches' => array( + // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ + 'application/x-obml2d', + // BlackBerry devices. + 'application/vnd.rim.html', + 'text/vnd.wap.wml', + 'application/vnd.wap.xhtml+xml' + )), + 'HTTP_X_WAP_PROFILE' => null, + 'HTTP_X_WAP_CLIENTID' => null, + 'HTTP_WAP_CONNECTION' => null, + 'HTTP_PROFILE' => null, + // Reported by Opera on Nokia devices (eg. C3). + 'HTTP_X_OPERAMINI_PHONE_UA' => null, + 'HTTP_X_NOKIA_GATEWAY_ID' => null, + 'HTTP_X_ORANGE_ID' => null, + 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null, + 'HTTP_X_HUAWEI_USERID' => null, + // Reported by Windows Smartphones. + 'HTTP_UA_OS' => null, + // Reported by Verizon, Vodafone proxy system. + 'HTTP_X_MOBILE_GATEWAY' => null, + // Seend this on HTC Sensation. @ref: SensationXE_Beats_Z715e. + 'HTTP_X_ATT_DEVICEID' => null, + // Seen this on a HTC. + 'HTTP_UA_CPU' => array('matches' => array('ARM')), + ); + + /** + * List of mobile devices (phones). + * + * @var array + */ + protected static $phoneDevices = array( + 'iPhone' => '\biPhone.*(Mobile|PhoneGap)|\biPod', // |\biTunes + 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+', + 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m', + 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile', + // @todo: Is 'Dell Streak' a tablet or a phone? ;) + 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b', + 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925', + 'Samsung' => 'Samsung|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E', + 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802)', + 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i', + 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', + // @ref: http://www.micromaxinfo.com/mobiles/smartphones + // Added because the codes might conflict with Acer Tablets. + 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', + 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; @todo - complete the regex. + 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) + // @ref: http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) + // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android. + 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790', + // @ref: http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones. + 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250', + 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)', + // Added simvalley mobile just for fun. They have some interesting devices. + // @ref: http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html + 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b', + // @Tapatalk is a mobile app; @ref: http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039 + 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser' + ); + + /** + * List of tablet devices. + * + * @var array + */ + protected static $tabletDevices = array( + 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic. + 'NexusTablet' => 'Android.*Nexus[\s]+(7|10)|^.*Android.*Nexus(?:(?!Mobile).)*$', + 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-I9205|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705C|SM-T535|SM-T331', // SCH-P709|SCH-P729|SM-T2558 - Samsung Mega - treat them like a regular phone. + // @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/ + 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE)\b', + // Only the Surface tablets with Windows RT are considered mobile. + // @ref: http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx + 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;', + // @ref: http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT + 'HPTablet' => 'HP Slate 7|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8', + // @note: watch out for PadFone, see #132 + 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|TX201LA', + 'BlackBerryTablet' => 'PlayBook|RIM Tablet', + 'HTCtablet' => 'HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200', + 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', + 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2', + // @ref: http://www.acer.ro/ac/ro/RO/content/drivers + // @ref: http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer) + // @ref: http://us.acer.com/ac/en/US/content/group/tablets + // @note: Can conflict with Micromax and Motorola phones codes. + 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-830)\b|W3-810|\bA3-A10\b', + // @ref: http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/ + // @ref: http://us.toshiba.com/tablets/tablet-finder + // @ref: http://www.toshiba.co.jp/regza/tablet/ + 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO', + // @ref: http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html + // @ref: http://www.lg.com/us/tablets + 'LGTablet' => '\bL-06C|LG-V900|LG-V500|LG-V909|LG-V500|LG-V510|LG-VK810\b', + 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b', + // Prestigio Tablets http://www.prestigio.com/support + 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD', + // @ref: http://support.lenovo.com/en_GB/downloads/default.page?# + 'LenovoTablet' => 'IdeaTab|ThinkPad([ ]+)?Tablet|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A1000|A2107|A2109|A1107|B6000|B8000|B8080-F)', + // @ref: http://www.yarvik.com/en/matrix/tablets/ + 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b', + 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', + 'ArnovaTablet' => 'AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT', + // http://www.intenso.de/kategorie_en.php?kategorie=33 + // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate + 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab', + // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/ + 'IRUTablet' => 'M702pro', + 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b', + // @ref: http://www.e-boda.ro/tablete-pc.html + 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)', + // @ref: http://www.allview.ro/produse/droseries/lista-tablete-pc/ + 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)', + // @reference: http://wiki.archosfans.com/index.php?title=Main_Page + 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|ARCHOS 101G10|Archos 101 Neon', + // @ref: http://www.ainol.com/plugin.php?identifier=ainol&module=product + 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark', + // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER + // @ref: Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser + // @ref: http://www.sony.jp/support/tablet/ + 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551', + // @ref: db + http://www.cube-tablet.com/buy-products.html + 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT', + // @ref: http://www.cobyusa.com/?p=pcat&pcat_id=3001 + 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010', + // @ref: http://www.match.net.cn/products.asp + 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733', + // @ref: http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) + // @ref: http://www.imp3.net/14/show.php?itemid=20454 + 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', + // @ref: http://www.rock-chips.com/index.php?do=prod&pid=2 + 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', + // @ref: http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ + 'FlyTablet' => 'IQ310|Fly Vision', + // @ref: http://www.bqreaders.com/gb/tablets-prices-sale.html + 'bqTablet' => 'bq.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant)|Maxwell.*Lite|Maxwell.*Plus', + // @ref: http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 + // @ref: http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) + 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim', + // Nec or Medias Tab + 'NecTablet' => '\bN-06D|\bN-08D', + // Pantech Tablets: http://www.pantechusa.com/phones/ + 'PantechTablet' => 'Pantech.*P4100', + // Broncho Tablets: http://www.broncho.cn/ (hard to find) + 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)', + // @ref: http://versusuk.com/support.html + 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b', + // @ref: http://www.zync.in/index.php/our-products/tablet-phablets + 'ZyncTablet' => 'z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900', + // @ref: http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ + 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA', + // @ref: https://www.nabitablet.com/ + 'NabiTablet' => 'Android.*\bNabi', + 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build', + // French Danew Tablets http://www.danew.com/produits-tablette.php + 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b', + // Texet Tablets and Readers http://www.texet.ru/tablet/ + 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE', + // @note: Avoid detecting 'PLAYSTATION 3' as mobile. + 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', + // @ref: http://www.trekstor.de/surftabs.html + 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A', + // @ref: http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets + 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b', + // @ref: http://www.advandigital.com/index.php?link=content-product&jns=JP001 + // @Note: because of the short codenames we have to include whitespaces to reduce the possible conflicts. + 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ', + // @ref: http://www.danytech.com/category/tablet-pc + 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1', + // @ref: http://www.galapad.net/product.html + 'GalapadTablet' => 'Android.*\bG1\b', + // @ref: http://www.micromaxinfo.com/tablet/funbook + 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b', + // http://www.karbonnmobiles.com/products_tablet.php + 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b', + // @ref: http://www.myallfine.com/Products.asp + 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide', + // @ref: http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= + 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b', + // @ref: http://www.yonesnav.com/products/products.php + 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026', + // @ref: http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 + // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html) + 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503', + // @ref: http://www.gloryunion.cn/products.asp + // @ref: http://www.allwinnertech.com/en/apply/mobile.html + // @ref: http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB) + // @todo: Softwiner tablets? + // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions. + 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G + // @ref: http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118 + 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10', + // @ref: http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/ + // @todo: add more tests. + 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)', + // @ref: http://hclmetablet.com/India/index.php + 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync', + // @ref: http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html + 'DPSTablet' => 'DPS Dream 9|DPS Dual 7', + // @ref: http://www.visture.com/index.asp + 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10', + // @ref: http://www.mijncresta.nl/tablet + 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989', + // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309 + 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b', + // Concorde tab + 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan', + // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/ + 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042', + // Modecom Tablets - http://www.modecom.eu/tablets/portal/ + 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003', + // Vonino Tablets - http://www.vonino.eu/tablets + 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b', + // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0 + 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1', + // Storex Tablets - http://storex.fr/espace_client/support.html + // @note: no need to add all the tablet codes since they are guided by the first regex. + 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab', + // Generic Vodafone tablets. + 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10', + // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb + // Aka: http://www.essentielb.fr/ + 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2', + // Ross & Moor - http://ross-moor.ru/ + 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711', + // i-mobile http://product.i-mobilephone.com/Mobile_Device + 'iMobileTablet' => 'i-mobile i-note', + // @ref: http://www.tolino.de/de/vergleichen/ + 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine', + // AudioSonic - a Kmart brand + // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72¤tPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1 + 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b', + // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/ + // @todo: add them gradually to avoid conflicts. + 'AMPETablet' => 'Android.* A78 ', + // Skk Mobile - http://skkmobile.com.ph/product_tablets.php + 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)', + // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1 + 'TecnoTablet' => 'TECNO P9', + // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3 + 'JXDTablet' => 'Android.*\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b', + // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/ + 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)', + // http://www.intracon.eu/tablet + 'FX2Tablet' => 'FX2 PAD7|FX2 PAD10', + // http://www.xoro.de/produkte/ + // @note: Might be the same brand with 'Simply tablets' + 'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151', + // http://www1.viewsonic.com/products/computing/tablets/ + 'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a', + // http://www.odys.de/web/internet-tablet_en.html + 'OdysTablet' => 'LOOX|XENO10|ODYS Space', + // http://www.captiva-power.de/products.html#tablets-en + 'CaptivaTablet' => 'CAPTIVA PAD', + // IconBIT - http://www.iconbit.com/products/tablets/ + 'IconbitTablet' => 'NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S', + // @ref: http://www.tesco.com/direct/hudl/ + 'Hudl' => 'Hudl HT7S3', + // @ref: http://www.telstra.com.au/home-phone/thub-2/ + 'TelstraTablet' => 'T-Hub2', + 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4', + ); + + /** + * List of mobile Operating Systems. + * + * @var array + */ + protected static $operatingSystems = array( + 'AndroidOS' => 'Android', + 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os', + 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', + 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', + // @reference: http://en.wikipedia.org/wiki/Windows_Mobile + 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', + // @reference: http://en.wikipedia.org/wiki/Windows_Phone + // http://wifeng.cn/?r=blog&a=view&id=106 + // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx + 'WindowsPhoneOS' => 'Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7', + 'iOS' => '\biPhone.*Mobile|\biPod|\biPad', + // http://en.wikipedia.org/wiki/MeeGo + // @todo: research MeeGo in UAs + 'MeeGoOS' => 'MeeGo', + // http://en.wikipedia.org/wiki/Maemo + // @todo: research Maemo in UAs + 'MaemoOS' => 'Maemo', + 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135 + 'webOS' => 'webOS|hpwOS', + 'badaOS' => '\bBada\b', + 'BREWOS' => 'BREW', + ); + + /** + * List of mobile User Agents. + * + * @var array + */ + protected static $browsers = array( + // @reference: https://developers.google.com/chrome/mobile/docs/user-agent + 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', + 'Dolfin' => '\bDolfin\b', + 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+', + 'Skyfire' => 'Skyfire', + 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+ + 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile', + 'Bolt' => 'bolt', + 'TeaShark' => 'teashark', + 'Blazer' => 'Blazer', + // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 + 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile', + // @ref: http://en.wikipedia.org/wiki/Midori_(web_browser) + //'Midori' => 'midori', + 'Tizen' => 'Tizen', + 'UCBrowser' => 'UC.*Browser|UCWEB', + // @ref: https://github.com/serbanghita/Mobile-Detect/issues/7 + 'DiigoBrowser' => 'DiigoBrowser', + // http://www.puffinbrowser.com/index.php + 'Puffin' => 'Puffin', + // @ref: http://mercury-browser.com/index.html + 'Mercury' => '\bMercury\b', + // @reference: http://en.wikipedia.org/wiki/Minimo + // http://en.wikipedia.org/wiki/Vision_Mobile_Browser + 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger' + ); + + /** + * Utilities. + * + * @var array + */ + protected static $utilities = array( + // Experimental. When a mobile device wants to switch to 'Desktop Mode'. + // @ref: http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/ + // @ref: https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011 + 'DesktopMode' => 'WPDesktop', + 'TV' => 'SonyDTV|HbbTV', // experimental + 'WebKit' => '(webkit)[ /]([\w.]+)', + 'Bot' => 'Googlebot|DoCoMo|YandexBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|facebookexternalhit', + 'MobileBot' => 'Googlebot-Mobile|DoCoMo|YahooSeeker/M1A1-R2D2', + // @todo: Include JXD consoles. + 'Console' => '\b(Nintendo|Nintendo WiiU|PLAYSTATION|Xbox)\b', + 'Watch' => 'SM-V700', + ); + + /** + * All possible HTTP headers that represent the + * User-Agent string. + * + * @var array + */ + protected static $uaHttpHeaders = array( + // The default User-Agent string. + 'HTTP_USER_AGENT', + // Header can occur on devices using Opera Mini. + 'HTTP_X_OPERAMINI_PHONE_UA', + // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ + 'HTTP_X_DEVICE_USER_AGENT', + 'HTTP_X_ORIGINAL_USER_AGENT', + 'HTTP_X_SKYFIRE_PHONE', + 'HTTP_X_BOLT_PHONE_UA', + 'HTTP_DEVICE_STOCK_UA', + 'HTTP_X_UCBROWSER_DEVICE_UA' + ); + + /** + * The individual segments that could exist in a User-Agent string. VER refers to the regular + * expression defined in the constant self::VER. + * + * @var array + */ + protected static $properties = array( + + // Build + 'Mobile' => 'Mobile/[VER]', + 'Build' => 'Build/[VER]', + 'Version' => 'Version/[VER]', + 'VendorID' => 'VendorID/[VER]', + + // Devices + 'iPad' => 'iPad.*CPU[a-z ]+[VER]', + 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', + 'iPod' => 'iPod.*CPU[a-z ]+[VER]', + //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), + 'Kindle' => 'Kindle/[VER]', + + // Browser + 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'), + 'Coast' => array('Coast/[VER]'), + 'Dolfin' => 'Dolfin/[VER]', + // @reference: https://developer.mozilla.org/en-US/docs/User_Agent_Strings_Reference + 'Firefox' => 'Firefox/[VER]', + 'Fennec' => 'Fennec/[VER]', + // @reference: http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx + 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];'), + // http://en.wikipedia.org/wiki/NetFront + 'NetFront' => 'NetFront/[VER]', + 'NokiaBrowser' => 'NokiaBrowser/[VER]', + 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ), + 'Opera Mini' => 'Opera Mini/[VER]', + 'Opera Mobi' => 'Version/[VER]', + 'UC Browser' => 'UC Browser[VER]', + 'MQQBrowser' => 'MQQBrowser/[VER]', + 'MicroMessenger' => 'MicroMessenger/[VER]', + // @note: Safari 7534.48.3 is actually Version 5.1. + // @note: On BlackBerry the Version is overwriten by the OS. + 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ), + 'Skyfire' => 'Skyfire/[VER]', + 'Tizen' => 'Tizen/[VER]', + 'Webkit' => 'webkit[ /][VER]', + + // Engine + 'Gecko' => 'Gecko/[VER]', + 'Trident' => 'Trident/[VER]', + 'Presto' => 'Presto/[VER]', + + // OS + 'iOS' => ' \bOS\b [VER] ', + 'Android' => 'Android [VER]', + 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'), + 'BREW' => 'BREW [VER]', + 'Java' => 'Java/[VER]', + // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx + // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases + 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'), + 'Windows Phone' => 'Windows Phone [VER]', + 'Windows CE' => 'Windows CE/[VER]', + // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd + 'Windows NT' => 'Windows NT [VER]', + 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), + 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), + ); + + /** + * Construct an instance of this class. + * + * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored. + * If left empty, will use the global _SERVER['HTTP_*'] vars instead. + * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT + * from the $headers array instead. + */ + public function __construct( + array $headers = null, + $userAgent = null + ){ + $this->setHttpHeaders($headers); + $this->setUserAgent($userAgent); + } + + /** + * Get the current script version. + * This is useful for the demo.php file, + * so people can check on what version they are testing + * for mobile devices. + * + * @return string The version number in semantic version format. + */ + public static function getScriptVersion() + { + return self::VERSION; + } + + /** + * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. + * + * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract + * the headers. The default null is left for backwards compatibilty. + */ + public function setHttpHeaders($httpHeaders = null) + { + //use global _SERVER if $httpHeaders aren't defined + if (!is_array($httpHeaders) || !count($httpHeaders)) { + $httpHeaders = $_SERVER; + } + + //clear existing headers + $this->httpHeaders = array(); + + //Only save HTTP headers. In PHP land, that means only _SERVER vars that + //start with HTTP_. + foreach ($httpHeaders as $key => $value) { + if (substr($key,0,5) == 'HTTP_') { + $this->httpHeaders[$key] = $value; + } + } + } + + /** + * Retrieves the HTTP headers. + * + * @return array + */ + public function getHttpHeaders() + { + return $this->httpHeaders; + } + + /** + * Retrieves a particular header. If it doesn't exist, no exception/error is caused. + * Simply null is returned. + * + * @param string $header The name of the header to retrieve. Can be HTTP compliant such as + * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the + * all-caps, HTTP_ prefixed, underscore seperated awesomeness. + * + * @return string|null The value of the header. + */ + public function getHttpHeader($header) + { + //are we using PHP-flavored headers? + if (strpos($header, '_') === false) { + $header = str_replace('-', '_', $header); + $header = strtoupper($header); + } + + //test the alternate, too + $altHeader = 'HTTP_' . $header; + + //Test both the regular and the HTTP_ prefix + if (isset($this->httpHeaders[$header])) { + return $this->httpHeaders[$header]; + } elseif (isset($this->httpHeaders[$altHeader])) { + return $this->httpHeaders[$altHeader]; + } + + return null; + } + + public function getMobileHeaders() + { + return self::$mobileHeaders; + } + + /** + * Get all possible HTTP headers that + * can contain the User-Agent string. + * + * @return array List of HTTP headers. + */ + public function getUaHttpHeaders() + { + return self::$uaHttpHeaders; + } + + /** + * Set the User-Agent to be used. + * + * @param string $userAgent The user agent string to set. + * + * @return string|null + */ + public function setUserAgent($userAgent = null) + { + if (!empty($userAgent)) { + return $this->userAgent = $userAgent; + } else { + + $this->userAgent = null; + + foreach($this->getUaHttpHeaders() as $altHeader){ + if(!empty($this->httpHeaders[$altHeader])){ // @todo: should use getHttpHeader(), but it would be slow. (Serban) + $this->userAgent .= $this->httpHeaders[$altHeader] . " "; + } + } + + return $this->userAgent = (!empty($this->userAgent) ? trim($this->userAgent) : null); + + } + } + + /** + * Retrieve the User-Agent. + * + * @return string|null The user agent if it's set. + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or + * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. + * + * @deprecated since version 2.6.9 + * + * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default + * parameter is null which will default to self::DETECTION_TYPE_MOBILE. + */ + public function setDetectionType($type = null) + { + if ($type === null) { + $type = self::DETECTION_TYPE_MOBILE; + } + + if ($type != self::DETECTION_TYPE_MOBILE && $type != self::DETECTION_TYPE_EXTENDED) { + return; + } + + $this->detectionType = $type; + } + + /** + * Retrieve the list of known phone devices. + * + * @return array List of phone devices. + */ + public static function getPhoneDevices() + { + return self::$phoneDevices; + } + + /** + * Retrieve the list of known tablet devices. + * + * @return array List of tablet devices. + */ + public static function getTabletDevices() + { + return self::$tabletDevices; + } + + /** + * Alias for getBrowsers() method. + * + * @return array List of user agents. + */ + public static function getUserAgents() + { + return self::getBrowsers(); + } + + /** + * Retrieve the list of known browsers. Specifically, the user agents. + * + * @return array List of browsers / user agents. + */ + public static function getBrowsers() + { + return self::$browsers; + } + + /** + * Retrieve the list of known utilities. + * + * @return array List of utilities. + */ + public static function getUtilities() + { + return self::$utilities; + } + + /** + * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). + * + * @deprecated since version 2.6.9 + * + * @return array All the rules (but not extended). + */ + public static function getMobileDetectionRules() + { + static $rules; + + if (!$rules) { + $rules = array_merge( + self::$phoneDevices, + self::$tabletDevices, + self::$operatingSystems, + self::$browsers + ); + } + + return $rules; + + } + + /** + * Method gets the mobile detection rules + utilities. + * The reason this is separate is because utilities rules + * don't necessary imply mobile. This method is used inside + * the new $detect->is('stuff') method. + * + * @deprecated since version 2.6.9 + * + * @return array All the rules + extended. + */ + public function getMobileDetectionRulesExtended() + { + static $rules; + + if (!$rules) { + // Merge all rules together. + $rules = array_merge( + self::$phoneDevices, + self::$tabletDevices, + self::$operatingSystems, + self::$browsers, + self::$utilities + ); + } + + return $rules; + } + + /** + * Retrieve the current set of rules. + * + * @deprecated since version 2.6.9 + * + * @return array + */ + public function getRules() + { + if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) { + return self::getMobileDetectionRulesExtended(); + } else { + return self::getMobileDetectionRules(); + } + } + + /** + * Retrieve the list of mobile operating systems. + * + * @return array The list of mobile operating systems. + */ + public static function getOperatingSystems() + { + return self::$operatingSystems; + } + + /** + * Check the HTTP headers for signs of mobile. + * This is the fastest mobile check possible; it's used + * inside isMobile() method. + * + * @return bool + */ + public function checkHttpHeadersForMobile() + { + + foreach($this->getMobileHeaders() as $mobileHeader => $matchType){ + if( isset($this->httpHeaders[$mobileHeader]) ){ + if( is_array($matchType['matches']) ){ + foreach($matchType['matches'] as $_match){ + if( strpos($this->httpHeaders[$mobileHeader], $_match) !== false ){ + return true; + } + } + return false; + } else { + return true; + } + } + } + + return false; + + } + + /** + * Magic overloading method. + * + * @method boolean is[...]() + * @param string $name + * @param array $arguments + * @return mixed + * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' + */ + public function __call($name, $arguments) + { + //make sure the name starts with 'is', otherwise + if (substr($name, 0, 2) != 'is') { + throw new BadMethodCallException("No such method exists: $name"); + } + + $this->setDetectionType(self::DETECTION_TYPE_MOBILE); + + $key = substr($name, 2); + + return $this->matchUAAgainstKey($key); + } + + /** + * Find a detection rule that matches the current User-agent. + * + * @param null $userAgent deprecated + * @return boolean + */ + protected function matchDetectionRulesAgainstUA($userAgent = null) + { + // Begin general search. + foreach ($this->getRules() as $_regex) { + if (empty($_regex)) { + continue; + } + if ($this->match($_regex, $userAgent)) { + return true; + } + } + + return false; + } + + /** + * Search for a certain key in the rules array. + * If the key is found the try to match the corresponding + * regex agains the User-Agent. + * + * @param string $key + * @param null $userAgent deprecated + * @return mixed + */ + protected function matchUAAgainstKey($key, $userAgent = null) + { + // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. + $key = strtolower($key); + + //change the keys to lower case + $_rules = array_change_key_case($this->getRules()); + + if (array_key_exists($key, $_rules)) { + if (empty($_rules[$key])) { + return null; + } + + return $this->match($_rules[$key], $userAgent); + } + + return false; + } + + /** + * Check if the device is mobile. + * Returns true if any type of mobile device detected, including special ones + * @param null $userAgent deprecated + * @param null $httpHeaders deprecated + * @return bool + */ + public function isMobile($userAgent = null, $httpHeaders = null) + { + + if ($httpHeaders) { + $this->setHttpHeaders($httpHeaders); + } + + if ($userAgent) { + $this->setUserAgent($userAgent); + } + + $this->setDetectionType(self::DETECTION_TYPE_MOBILE); + + if ($this->checkHttpHeadersForMobile()) { + return true; + } else { + return $this->matchDetectionRulesAgainstUA(); + } + + } + + /** + * Check if the device is a tablet. + * Return true if any type of tablet device is detected. + * + * @param string $userAgent deprecated + * @param array $httpHeaders deprecated + * @return bool + */ + public function isTablet($userAgent = null, $httpHeaders = null) + { + $this->setDetectionType(self::DETECTION_TYPE_MOBILE); + + foreach (self::$tabletDevices as $_regex) { + if ($this->match($_regex, $userAgent)) { + return true; + } + } + + return false; + } + + /** + * This method checks for a certain property in the + * userAgent. + * @todo: The httpHeaders part is not yet used. + * + * @param string $key + * @param string $userAgent deprecated + * @param string $httpHeaders deprecated + * @return bool|int|null + */ + public function is($key, $userAgent = null, $httpHeaders = null) + { + // Set the UA and HTTP headers only if needed (eg. batch mode). + if ($httpHeaders) { + $this->setHttpHeaders($httpHeaders); + } + + if ($userAgent) { + $this->setUserAgent($userAgent); + } + + $this->setDetectionType(self::DETECTION_TYPE_EXTENDED); + + return $this->matchUAAgainstKey($key); + } + + /** + * Some detection rules are relative (not standard), + * because of the diversity of devices, vendors and + * their conventions in representing the User-Agent or + * the HTTP headers. + * + * This method will be used to check custom regexes against + * the User-Agent string. + * + * @param $regex + * @param string $userAgent + * @return bool + * + * @todo: search in the HTTP headers too. + */ + public function match($regex, $userAgent = null) + { + // Escape the special character which is the delimiter. + $regex = str_replace('/', '\/', $regex); + + return (bool) preg_match('/'.$regex.'/is', (!empty($userAgent) ? $userAgent : $this->userAgent)); + } + + /** + * Get the properties array. + * + * @return array + */ + public static function getProperties() + { + return self::$properties; + } + + /** + * Prepare the version number. + * + * @todo Remove the error supression from str_replace() call. + * + * @param string $ver The string version, like "2.6.21.2152"; + * + * @return float + */ + public function prepareVersionNo($ver) + { + $ver = str_replace(array('_', ' ', '/'), '.', $ver); + $arrVer = explode('.', $ver, 2); + + if (isset($arrVer[1])) { + $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. + } + + return (float) implode('.', $arrVer); + } + + /** + * Check the version of the given property in the User-Agent. + * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) + * + * @param string $propertyName The name of the property. See self::getProperties() array + * keys for all possible properties. + * @param string $type Either self::VERSION_TYPE_STRING to get a string value or + * self::VERSION_TYPE_FLOAT indicating a float value. This parameter + * is optional and defaults to self::VERSION_TYPE_STRING. Passing an + * invalid parameter will default to the this type as well. + * + * @return string|float The version of the property we are trying to extract. + */ + public function version($propertyName, $type = self::VERSION_TYPE_STRING) + { + if (empty($propertyName)) { + return false; + } + + //set the $type to the default if we don't recognize the type + if ($type != self::VERSION_TYPE_STRING && $type != self::VERSION_TYPE_FLOAT) { + $type = self::VERSION_TYPE_STRING; + } + + $properties = self::getProperties(); + + // Check if the property exists in the properties array. + if (array_key_exists($propertyName, $properties)) { + + // Prepare the pattern to be matched. + // Make sure we always deal with an array (string is converted). + $properties[$propertyName] = (array) $properties[$propertyName]; + + foreach ($properties[$propertyName] as $propertyMatchString) { + + $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); + + // Escape the special character which is the delimiter. + $propertyPattern = str_replace('/', '\/', $propertyPattern); + + // Identify and extract the version. + preg_match('/'.$propertyPattern.'/is', $this->userAgent, $match); + + if (!empty($match[1])) { + $version = ( $type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1] ); + + return $version; + } + + } + + } + + return false; + } + + /** + * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. + * + * @return string One of the self::MOBILE_GRADE_* constants. + */ + public function mobileGrade() + { + $isMobile = $this->isMobile(); + + if ( + // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1) + $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)>=4.3 || + $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)>=3.1 || + $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)>=3.1 || + + // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) + // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM + // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices + // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 + ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) || + + // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800 + $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT)>=7.0 || + + // Blackberry 7 - Tested on BlackBerry Torch 9810 + // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670 + $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=6.0 || + // Blackberry Playbook (1.0-2.0) - Tested on PlayBook + $this->match('Playbook.*Tablet') || + + // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0) + ( $this->version('webOS', self::VERSION_TYPE_FLOAT)>=1.4 && $this->match('Palm|Pre|Pixi') ) || + // Palm WebOS 3.0 - Tested on HP TouchPad + $this->match('hp.*TouchPad') || + + // Firefox Mobile (12 Beta) - Tested on Android 2.3 device + ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=12 ) || + + // Chrome for Android - Tested on Android 4.0, 4.1 device + ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=4.0 ) || + + // Skyfire 4.1 - Tested on Android 2.3 device + ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT)>=4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) || + + // Opera Mobile 11.5-12: Tested on Android 2.3 + ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>11 && $this->is('AndroidOS') ) || + + // Meego 1.2 - Tested on Nokia 950 and N9 + $this->is('MeeGoOS') || + + // Tizen (pre-release) - Tested on early hardware + $this->is('Tizen') || + + // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser + // @todo: more tests here! + $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT)>=2.0 || + + // UC Browser - Tested on Android 2.3 device + ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 ) || + + // Kindle 3 and Fire - Tested on the built-in WebKit browser for each + ( $this->match('Kindle Fire') || + $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT)>=3.0 ) || + + // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet + $this->is('AndroidOS') && $this->is('NookTablet') || + + // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7 + $this->version('Chrome', self::VERSION_TYPE_FLOAT)>=11 && !$isMobile || + + // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7 + $this->version('Safari', self::VERSION_TYPE_FLOAT)>=5.0 && !$isMobile || + + // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7 + $this->version('Firefox', self::VERSION_TYPE_FLOAT)>=4.0 && !$isMobile || + + // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 + $this->version('MSIE', self::VERSION_TYPE_FLOAT)>=7.0 && !$isMobile || + + // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 + // @reference: http://my.opera.com/community/openweb/idopera/ + $this->version('Opera', self::VERSION_TYPE_FLOAT)>=10 && !$isMobile + + ){ + return self::MOBILE_GRADE_A; + } + + if ( + $this->isIOS() && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 || + $this->isIOS() && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<3.1 || + $this->isIOS() && $this->version('iPod', self::VERSION_TYPE_FLOAT)<3.1 || + + // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 + $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)>=5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 || + + //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 + ( $this->version('Opera Mini', self::VERSION_TYPE_FLOAT)>=5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT)<=6.5 && + ($this->version('Android', self::VERSION_TYPE_FLOAT)>=2.3 || $this->is('iOS')) ) || + + // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) + $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || + + // @todo: report this (tested on Nokia N71) + $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT)>=11 && $this->is('SymbianOS') + ){ + return self::MOBILE_GRADE_B; + } + + if ( + // Blackberry 4.x - Tested on the Curve 8330 + $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<5.0 || + // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) + $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT)<=5.2 + + ){ + return self::MOBILE_GRADE_C; + } + + //All older smartphone platforms and featurephones - Any device that doesn't support media queries + //will receive the basic, C grade experience. + return self::MOBILE_GRADE_C; + } +} diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3ee4206258a..caa812a82a6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -120,11 +120,11 @@ function getEntity($element=false, $shared=false) /** * Return information about user browser * - * @return array Array of information ('browsername'=>,'browseros'=>,'phone'=>,'browserversion'=>) + * @return array Array of information ('browsername'=>,'browseros'=>,'browserversion'=>,'layout'=>(classic|phone|tablet)) */ function getBrowserInfo() { - $name='unknown'; $version=''; $os='unknown'; $phone=''; + $name='unknown'; $version=''; $os='unknown'; $phone=''; $tablet=''; // If phone/smartphone, we set phone os name. if (preg_match('/android/i',$_SERVER["HTTP_USER_AGENT"])) { $os=$phone='android'; } @@ -156,7 +156,12 @@ function getBrowserInfo() $firefox=0; if (in_array($name,array('firefox','iceweasel'))) $firefox=1; - return array('browsername'=>$name, 'browserversion'=>$version, 'browseros'=>$os, 'phone'=>$phone, 'browserfirefox'=>$firefox); + include_once DOL_DOCUMENT_ROOT.'/core/class/MobileDetect.class.php'; + $detectmobile=new MobileDetect(); + $phone=$detectmobile->isMobile(); + $tablet=$detectmobile->isTablet(); + + return array('browsername'=>$name, 'browserversion'=>$version, 'browseros'=>$os, 'browserfirefox'=>$firefox, 'layout'=> ($tablet?'tablet':($phone?'phone':'classic')), 'phone'=>$phone, 'tablet'=>$tablet); } /** diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1be7d8a9a7a..72c156c8f3e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -209,10 +209,12 @@ register_shutdown_function('dol_shutdown'); if (isset($_SERVER["HTTP_USER_AGENT"])) { $tmp=getBrowserInfo(); - $conf->browser->phone=$tmp['phone']; $conf->browser->name=$tmp['browsername']; $conf->browser->os=$tmp['browseros']; $conf->browser->version=$tmp['browserversion']; + $conf->browser->layout=$tmp['layout']; + $conf->browser->phone=$tmp['phone']; // deprecated, use layout + $conf->browser->tablet=$tmp['tablet']; // deprecated, use layout } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 043718d4222..e7967a1d5fb 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -460,25 +460,25 @@ div.fichecenter { clear: both; /* This is to have div fichecenter that are true rectangles */ } div.fichethirdleft { - dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?> - dol_optimize_smallscreen)) { print "width: 35%;\n"; } ?> - dol_optimize_smallscreen)) { print "padding-bottom: 6px;\n"; } ?> + browser->layout != 'phone') { print "float: ".$left.";\n"; } ?> + browser->layout != 'phone') { print "width: 35%;\n"; } ?> + browser->layout == 'phone') { print "padding-bottom: 6px;\n"; } ?> } div.fichetwothirdright { - dol_optimize_smallscreen)) { print "float: ".$right.";\n"; } ?> - dol_optimize_smallscreen)) { print "width: 65%;\n"; } ?> - dol_optimize_smallscreen)) { print "padding-bottom: 6px\n"; } ?> + browser->layout != 'phone') { print "float: ".$right.";\n"; } ?> + browser->layout != 'phone') { print "width: 65%;\n"; } ?> + browser->layout == 'phone') { print "padding-bottom: 6px\n"; } ?> } div.fichehalfleft { - dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?> - dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> + browser->layout != 'phone') { print "float: ".$left.";\n"; } ?> + browser->layout != 'phone') { print "width: 50%;\n"; } ?> } div.fichehalfright { - dol_optimize_smallscreen)) { print "float: ".$right.";\n"; } ?> - dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?> + browser->layout != 'phone') { print "float: ".$right.";\n"; } ?> + browser->layout != 'phone') { print "width: 50%;\n"; } ?> } div.ficheaddleft { - dol_optimize_smallscreen)) { print "padding-".$left.": 16px;\n"; } + browser->layout != 'phone') { print "padding-".$left.": 16px;\n"; } else print "margin-top: 10px;\n"; ?> } .containercenter { From 9e91baca36047954314e011328f94d12e1551b9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Jul 2014 23:23:29 +0200 Subject: [PATCH 326/502] Fix: Log must be done before query. --- htdocs/core/db/mssql.class.php | 4 ++-- htdocs/core/db/mysql.class.php | 6 +++--- htdocs/core/db/mysqli.class.php | 7 ++++--- htdocs/core/db/pgsql.class.php | 4 ++-- htdocs/core/db/sqlite.class.php | 6 +++--- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index d0b454168df..39b9afdb75b 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -349,6 +349,8 @@ class DoliDBMssql extends DoliDB //print ""; + dol_syslog('sql='.$query, LOG_DEBUG); + if (! $this->database_name) { // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) @@ -359,8 +361,6 @@ class DoliDBMssql extends DoliDB $ret = mssql_query($query, $this->db); } - dol_syslog('sql='.$query, LOG_DEBUG); - if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index bfa2d39b093..8f852aba3ec 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -252,6 +252,8 @@ class DoliDBMysql extends DoliDB { $query = trim($query); + dol_syslog('sql='.$query, LOG_DEBUG); + if (! $this->database_name) { // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) @@ -263,8 +265,6 @@ class DoliDBMysql extends DoliDB $ret = mysql_query($query, $this->db); } - dol_syslog('sql='.$query, LOG_DEBUG); - if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset @@ -829,7 +829,7 @@ class DoliDBMysql extends DoliDB $resql=$this->query($sql); if (! $resql) { - if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') { return -1; } diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index da16c1a7971..d44e37b7591 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -255,6 +255,9 @@ class DoliDBMysqli extends DoliDB function query($query,$usesavepoint=0,$type='auto') { $query = trim($query); + + dol_syslog('sql='.$query, LOG_DEBUG); + if (! $this->database_name) { // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) @@ -265,8 +268,6 @@ class DoliDBMysqli extends DoliDB $ret = mysqli_query($this->db,$query); } - dol_syslog('sql='.$query, LOG_DEBUG); - if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset @@ -833,7 +834,7 @@ class DoliDBMysqli extends DoliDB $resql=$this->query($sql); if (! $resql) { - if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') + if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS') { return -1; } diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index f6759e087c8..61de279e24c 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -491,10 +491,10 @@ class DoliDBPgsql extends DoliDB @pg_query($this->db, 'SAVEPOINT mysavepoint'); } - $ret = @pg_query($this->db, $query); - dol_syslog('sql='.$query, LOG_DEBUG); + $ret = @pg_query($this->db, $query); + //print $query; if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) // Si requete utilisateur, on la sauvegarde ainsi que son resultset { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 34ee2a41b6d..924f489fc4d 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -389,7 +389,9 @@ class DoliDBSqlite extends DoliDB $query=$this->convertSQLFromMysql($query,$type); //print "After convertSQLFromMysql:\n".$query."
\n"; - // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) + dol_syslog('sql='.$query, LOG_DEBUG); + + // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) try { //$ret = $this->db->exec($query); $ret = $this->db->query($query); // $ret is a PDO object @@ -399,8 +401,6 @@ class DoliDBSqlite extends DoliDB $this->error=$e->getMessage(); } - dol_syslog('sql='.$query, LOG_DEBUG); - if (! preg_match("/^COMMIT/i",$query) && ! preg_match("/^ROLLBACK/i",$query)) { // Si requete utilisateur, on la sauvegarde ainsi que son resultset From 25d18f225fb61b8903162016aa72226a927e8b5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Jul 2014 23:51:58 +0200 Subject: [PATCH 327/502] Fix: Restore compatibility with old modules. --- htdocs/core/lib/admin.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index cb338ff53f1..899de9a5ec1 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -887,7 +887,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql { while (($file = readdir($handle))!==false) { - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') { if (is_dir($dirroot . '/' . $file . '/core/modules/')) { @@ -898,7 +898,6 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql closedir($handle); } } - //var_dump($modulesdir); foreach ($modulesdir as $dir) { @@ -959,7 +958,8 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql // Complete arrays //&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond - //$objMod + if (empty($objMod->dictionaries) && ! empty($objMod->dictionnaries)) $objMod->dictionaries=$objMod->dictionnaries; // For backward compatibility + if (! empty($objMod->dictionaries)) { //var_dump($objMod->dictionaries['tabname']); From 355ec7fd276dcab5461ccf8a43323bc1e395729c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Jul 2014 23:52:42 +0200 Subject: [PATCH 328/502] Fix: Avoid pgsql error of duplicate record making rollback. --- htdocs/core/modules/DolibarrModules.class.php | 85 +++++++++++-------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 1cbf5f08009..1657efa6e46 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -852,6 +852,7 @@ abstract class DolibarrModules dol_syslog(get_class($this)."::insert_permissions", LOG_DEBUG); $resql=$this->db->query($sql_del); + if ($resql) { $obj=$this->db->fetch_object($resql); @@ -870,45 +871,57 @@ abstract class DolibarrModules if (empty($r_type)) $r_type='w'; - if (dol_strlen($r_perms) ) + // Search if perm already present + $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."rights_def"; + $sql.= " WHERE id = ".$r_id." AND entity = ".$entity; + $resqlselect=$this->db->query($sql); + + $obj = $this->db->fetch_object($resqlselect); + if ($obj->nb == 0) { - if (dol_strlen($r_subperms) ) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; - $sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)"; - $sql.= " VALUES "; - $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')"; - } - else - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; - $sql.= " (id, entity, libelle, module, type, bydefault, perms)"; - $sql.= " VALUES "; - $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')"; - } - } - else - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; - $sql .= " (id, entity, libelle, module, type, bydefault)"; - $sql .= " VALUES "; - $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")"; + if (dol_strlen($r_perms) ) + { + if (dol_strlen($r_subperms) ) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; + $sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)"; + $sql.= " VALUES "; + $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."','".$r_subperms."')"; + } + else + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def"; + $sql.= " (id, entity, libelle, module, type, bydefault, perms)"; + $sql.= " VALUES "; + $sql.= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.",'".$r_perms."')"; + } + } + else + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def "; + $sql .= " (id, entity, libelle, module, type, bydefault)"; + $sql .= " VALUES "; + $sql .= "(".$r_id.",".$entity.",'".$this->db->escape($r_desc)."','".$r_modul."','".$r_type."',".$r_def.")"; + } + + $resqlinsert=$this->db->query($sql,1); + + if (! $resqlinsert) + { + if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS") + { + $this->error=$this->db->lasterror(); + $err++; + break; + } + else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); + + } + + $this->db->free($resqlinsert); } - dol_syslog(get_class($this)."::insert_permissions", LOG_DEBUG); - $resqlinsert=$this->db->query($sql,1); - if (! $resqlinsert) - { - if ($this->db->errno() != "DB_ERROR_RECORD_ALREADY_EXISTS") - { - $this->error=$this->db->lasterror(); - $err++; - break; - } - else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); - - } - $this->db->free($resqlinsert); + $this->db->free($resqlselect); // If we want to init permissions on admin users if ($reinitadminperms) From b31bf68376e282bc04050295c2307437cc95858a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 00:47:27 +0200 Subject: [PATCH 329/502] New: Start to work on data check for dictionnary tables. --- htdocs/admin/dict.php | 31 ++++++++++++++++++++++++++++++- htdocs/core/lib/admin.lib.php | 4 +++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 788483196e4..654d8cf10ba 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -364,8 +364,37 @@ $tabhelp[24] = array(); $tabhelp[25] = array(); $tabhelp[26] = array(); +// List of check for fields (NOT USED YET) +$tabfieldcheck=array(); +$tabfieldcheck[1] = array(); +$tabfieldcheck[2] = array(); +$tabfieldcheck[3] = array(); +$tabfieldcheck[4] = array(); +$tabfieldcheck[5] = array(); +$tabfieldcheck[6] = array(); +$tabfieldcheck[7] = array(); +$tabfieldcheck[8] = array(); +$tabfieldcheck[9] = array(); +$tabfieldcheck[10] = array(); +$tabfieldcheck[11] = array(); +$tabfieldcheck[12] = array(); +$tabfieldcheck[13] = array(); +$tabfieldcheck[14] = array(); +$tabfieldcheck[15] = array(); +$tabfieldcheck[16] = array(); +$tabfieldcheck[17] = array(); +$tabfieldcheck[18] = array(); +$tabfieldcheck[19] = array(); +$tabfieldcheck[20] = array(); +$tabfieldcheck[21] = array(); +$tabfieldcheck[22] = array(); +$tabfieldcheck[23] = array(); +$tabfieldcheck[24] = array(); +$tabfieldcheck[25] = array(); +$tabfieldcheck[26] = array(); + // Complete all arrays with entries found into modules -complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp); +complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); // Define elementList and sourceList (used for dictionary "type of contacts") diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 899de9a5ec1..b6f2b02567a 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -862,9 +862,10 @@ function unActivateModule($value, $requiredby=1) * @param array &$tabrowid Tabrowid * @param array &$tabcond Tabcond * @param array &$tabhelp Tabhelp + * @param array &$tabfieldcheck Tabfieldcheck * @return int 1 */ -function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp) +function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp,&$tabfieldcheck) { global $db, $modules, $conf, $langs; @@ -977,6 +978,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val; foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val; foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val; + foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val; //foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val; //$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']); From 0228cd9db7576dbb33fa69cf49c72b169e5920d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9onard?= Date: Mon, 28 Jul 2014 02:45:58 +0200 Subject: [PATCH 330/502] Fix translations in e-mail forms --- htdocs/comm/propal.php | 16 ++++++++-------- htdocs/commande/fiche.php | 17 +++++++++-------- htdocs/compta/facture.php | 17 +++++++++-------- htdocs/core/class/html.formmail.class.php | 1 + htdocs/expedition/fiche.php | 15 ++++++++------- htdocs/fichinter/fiche.php | 15 ++++++++------- htdocs/fourn/commande/fiche.php | 15 ++++++++------- htdocs/fourn/facture/fiche.php | 15 ++++++++------- 8 files changed, 59 insertions(+), 52 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 010c623cafb..5174568f5ae 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2270,15 +2270,15 @@ if ($action == 'create') { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } // Build document if it not exists if (! $file || ! is_readable($file)) { - - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $result = propale_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $result); @@ -2307,9 +2307,9 @@ if ($action == 'create') { $formmail->withtocc = $liste; $formmail->withtoccc = (! empty($conf->global->MAIN_EMAIL_USECCC) ? $conf->global->MAIN_EMAIL_USECCC : false); if (empty($object->ref_client)) { - $formmail->withtopic = $langs->trans('SendPropalRef', '__PROPREF__'); + $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $langs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)'); } $formmail->withfile = 2; $formmail->withbody = 1; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 52cc27a42ef..3cebef8567c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2411,14 +2411,15 @@ if ($action == 'create' && $user->rights->commande->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $result = commande_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $result); @@ -2447,9 +2448,9 @@ if ($action == 'create' && $user->rights->commande->creer) { $formmail->withtocc = $liste; $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; if (empty($object->ref_client)) { - $formmail->withtopic = $langs->trans('SendOrderRef', '__ORDERREF__'); + $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $langs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)'); } $formmail->withfile = 2; $formmail->withbody = 1; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f9200f6f984..4693f4ee1fa 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3672,14 +3672,15 @@ if ($action == 'create') if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('bills'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - - if (! empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - $result = facture_pdf_create($db, $object, GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db, $result); @@ -3709,9 +3710,9 @@ if ($action == 'create') $formmail->withtocc = $liste; // List suggested for CC $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; if (empty($object->ref_client)) { - $formmail->withtopic = $langs->transnoentities($topicmail, '__FACREF__'); + $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $langs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)'); } $formmail->withfile = 2; $formmail->withbody = 1; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 75f6e80c111..fd1d90b1aef 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -564,6 +564,7 @@ class FormMail if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); + $outputlangs->load('other'); } diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index c2a2036c25f..406ba0ebc5d 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -1590,15 +1590,16 @@ else if ($id || $ref) if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('sendings'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=expedition_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { @@ -1626,7 +1627,7 @@ else if ($id || $ref) $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendShippingRef','__SHIPPINGREF__'); + $formmail->withtopic=$outputlangs->trans('SendShippingRef','__SHIPPINGREF__'); $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 637591d0606..d459b20767b 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1645,15 +1645,16 @@ else if ($id > 0 || ! empty($ref)) if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('interventions'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=fichinter_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { @@ -1681,7 +1682,7 @@ else if ($id > 0 || ! empty($ref)) $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__'); + $formmail->withtopic=$outputlangs->trans('SendInterventionRef','__FICHINTERREF__'); $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index b576a10b1bb..e536c81f21c 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1998,15 +1998,16 @@ elseif (! empty($object->id)) if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('commercial'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=supplier_order_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { @@ -2035,7 +2036,7 @@ elseif (! empty($object->id)) $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + $formmail->withtopic=$outputlangs->trans('SendOrderRef','__ORDERREF__'); $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 277d38c3d70..9c862bc5791 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -2264,15 +2264,16 @@ else if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if (!empty($newlang)) + { + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($newlang); + $outputlangs->load('bills'); + } + // Build document if it not exists if (! $file || ! is_readable($file)) { - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - $result=supplier_invoice_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { @@ -2300,7 +2301,7 @@ else $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendBillRef','__FACREF__'); + $formmail->withtopic=$outputlangs->trans('SendBillRef','__FACREF__'); $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; From 36c5b2d69cb6f3ce608711d1b6ff004e5bbc0272 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Mon, 28 Jul 2014 14:04:55 +0200 Subject: [PATCH 331/502] Update html.form.class.php By example, avoid to have html code in customer name --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 25f708e8c37..8cb0a344e43 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4093,7 +4093,7 @@ class Form $ret.='
@@ -80,8 +105,9 @@ Example 0c: Table with table+tr+td containg a select that should be overflowed a -
-Example 1 : Table using tags: div.tagtable+div.tagtr+div or div.tagtable+div.tagtr+div.tagtd
+


Example 1 : Table using tags: div.tagtable+div.tagtr+div or div.tagtable+div.tagtr+div.tagtd => Use this for tables that are edited forms

+ +
+


Example 2 : Table using tags: table/thead/tbody/tr/td + dataTable => Use this for long result tables
-Example 2 : Table using tags: table/thead/tbody/tr/td + dataTable
- - +
@@ -249,12 +304,9 @@ $('xxxth').replaceWith(
snake
-

+


Example 3 : Standard table => Use this if you need the drag and drop for lines
- -
-Example 3 : Standard table

+ + + \ No newline at end of file diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 36c2fd81689..8e2ed1da79e 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2296,6 +2296,11 @@ div.ecmjqft { { text-decoration: underline !important; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled, .paginate_button_disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none; +} /* ============================================================================== */ diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 66cb23f2451..83e8a14efda 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -384,7 +384,6 @@ div.tmenu { border-left: 0px; padding: 0px; margin: 5px 0px 10px 0px; - font-size: 13px; background-image : url(); background-repeat: no-repeat; background-color: #996644; @@ -408,7 +407,7 @@ div.mainmenu { /* Do not load menu img if hidden to save bandwidth */ - +'name of class for div') @@ -784,6 +783,7 @@ div.blockvmenusearch div.menu_titre { #blockvmenusearch form { clear: both; + margin-bottom: 14px; } div.blockvmenubookmarks @@ -2482,6 +2482,11 @@ div.ecmjqft { { text-decoration: underline !important; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled, .paginate_button_disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none; +} /* ============================================================================== */ diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 9031ea72895..72d67b1c491 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -859,6 +859,7 @@ div.blockvmenusearch div.menu_titre { #blockvmenusearch form { clear: both; + margin-bottom: 14px; } div.blockvmenubookmarks @@ -2376,7 +2377,11 @@ div.ecmjqft { { text-decoration: underline !important; } - +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled, .paginate_button_disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none; +} /* ============================================================================== */ /* JMobile */ diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ccb72fa2f25..043718d4222 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1645,11 +1645,10 @@ table.noborder, table.formdoc, div.noborder { border-bottom-style: solid; margin: 0px 0px 2px 0px; - /*padding: 1px 2px 1px 2px;*/ - -moz-box-shadow: 3px 3px 4px #DDD; - -webkit-box-shadow: 3px 3px 4px #DDD; - box-shadow: 3px 3px 4px #DDD; + -moz-box-shadow: 2px 2px 4px #DDD; + -webkit-box-shadow: 2px 2px 4px #DDD; + box-shadow: 2px 2px 4px #DDD; -moz-border-radius: 0.2em; -webkit-border-radius: 0.2em; @@ -2703,6 +2702,12 @@ div.dolEventError h1, div.dolEventError h2 { /* Disable this. It breaks wrapping of boxes .ui-corner-all { white-space: nowrap; } */ +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled, .paginate_button_disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none; +} + /* ============================================================================== */ /* JMobile */ From bf9313dd87d4ee887c13bea1c3c152c85cdb16a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Jul 2014 20:56:26 +0200 Subject: [PATCH 325/502] getBrowserInfo can return type of layout (classic/phone/tablet) --- ChangeLog | 1 + htdocs/admin/system/browser.php | 2 +- htdocs/core/class/MobileDetect.class.php | 1248 ++++++++++++++++++++++ htdocs/core/lib/functions.lib.php | 11 +- htdocs/main.inc.php | 4 +- htdocs/theme/eldy/style.css.php | 22 +- 6 files changed, 1272 insertions(+), 16 deletions(-) create mode 100644 htdocs/core/class/MobileDetect.class.php diff --git a/ChangeLog b/ChangeLog index ce5f819bb6b..08e75ecb34b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,6 +51,7 @@ For translators: - Update language files. For developers: +- New: getBrowserInfo can return type of layout (classic/phone/tablet) - New: Add hook "searchAgendaFrom". - New: Add trigger DON_UPDATE, DON_DELETE - New: Add country iso code on 3 chars into table of countries. diff --git a/htdocs/admin/system/browser.php b/htdocs/admin/system/browser.php index 2a97cf8e8eb..58601c6e998 100644 --- a/htdocs/admin/system/browser.php +++ b/htdocs/admin/system/browser.php @@ -59,7 +59,7 @@ print '
'.$langs->trans("BrowserOS").''.$langs->trans("Version").''.$tmp['browserversion'].'
'.$langs->trans("Smartphone").' ?'.$tmp['phone'].'
'.$langs->trans("Layout").' (phone/tablet/classic)'.$tmp['layout'].'
'.$langs->trans("IPAddress").''.$_SERVER['REMOTE_ADDR'].'
'; diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index cb4ae42ff13..e6333526c7f 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -59,19 +59,19 @@ $langs->load("cron"); $key = GETPOST('securitykey','alpha'); if (empty($key)) { - echo 'securitykey is require'; + echo 'Securitykey is required. Check setup of cron jobs module.'; exit; } if($key != $conf->global->CRON_KEY) { - echo 'securitykey is wrong'; + echo 'Securitykey is wrong.'; exit; } // Check the key, avoid that a stranger starts cron $userlogin = GETPOST('userlogin','alpha'); if (empty($userlogin)) { - echo 'userlogin is require'; + echo 'Userlogin is required.'; exit; } require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -175,7 +175,7 @@ if (is_array($object->lines) && (count($object->lines)>0)) } else { - echo "No active jobs found"; + echo "Result: No active jobs found."; } $db->close(); From 1f936ef5842ccf88efd485a4175b5a155ed117c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 21:43:06 +0200 Subject: [PATCH 337/502] Better text to describe reason of option --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4eab3b64008..4c29f5e2fe9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -47,7 +47,7 @@ DictionarySetup=Dictionary setup Dictionary=Dictionaries ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record ErrorCodeCantContainZero=Code can't contain value 0 -DisableJavascript=Disable JavaScript and Ajax functions +DisableJavascript=Disable JavaScript and Ajax functions (Recommended for blind person or text browsers) ConfirmAjax=Use Ajax confirmation popups UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectCompany=Use autocompletion fields to choose third parties instead of using a list box. From 09af3e1efe30f099cfec425666f5e01ee12a1389 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 28 Jul 2014 23:22:50 +0200 Subject: [PATCH 338/502] New: Add PYME (base) accountancy spanish plan --- htdocs/install/mysql/data/llx_accounting.sql | 789 +++++++++++++++++++ 1 file changed, 789 insertions(+) diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 72e3de906ea..81ba988cc7e 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -1406,3 +1406,792 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1355, 'PCMN-BASE', 'FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1356, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6', '', 'Charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1357, 'PCMN-BASE', 'PROD', 'XXXXXX', '7', '', 'Produits', '1'); + +-- +-- Descriptif des plans comptables ES PCG08-PYME +-- + +INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (4, 'PCG08-PYME', '4', 'The PYME accountancy spanish plan', '1'); + +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4001,'PCG08-PYME','FINANCIACION', 'XXXXXX', '1', '', 'Financiación básica', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4002,'PCG08-PYME','ACTIVO', 'XXXXXX', '2', '', 'Activo no corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '', 'Existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS Y GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); + +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4010, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '101', '4008', 'Fondo social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4011, 'PCG08-PYME','FINANCIACION', 'CAPITAL', '102', '4008', 'Capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4012, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '103', '4008', 'Socios por desembolsos no exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4013, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1030', '4012', 'Socios por desembolsos no exigidos capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4014, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1034', '4012', 'Socios por desembolsos no exigidos capital pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4015, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '104', '4008', 'Socios por aportaciones no dineradas pendientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4016, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1040', '4015', 'Socios por aportaciones no dineradas pendientes capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4017, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1044', '4015', 'Socios por aportaciones no dineradas pendientes capital pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4018, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '108', '4008', 'Acciones o participaciones propias en situaciones especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4019, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '109', '4008', 'Acciones o participaciones propias para reducción de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4020, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '11', '4001', 'Reservas y otros instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4021, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '110', '4020', 'Prima de emisión o asunción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4022, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '111', '4020', 'Otros instrumentos de patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4023, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1110', '4022', 'Patrimonio neto por emisión de instrumentos financieros compuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4024, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1111', '4022', 'Resto de instrumentos de patrimoio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4025, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '112', '4020', 'Reserva legal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4026, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '113', '4020', 'Reservas voluntarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4027, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '114', '4020', 'Reservas especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4028, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1140', '4027', 'Reservas para acciones o participaciones de la sociedad dominante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4029, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1141', '4027', 'Reservas estatutarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4030, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1142', '4027', 'Reservas por capital amortizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4031, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1143', '4027', 'Reservas por fondo de comercio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4032, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1144', '4028', 'Reservas por acciones propias aceptadas en garantía', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4033, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '115', '4020', 'Reservas por pérdidas y ganancias actuariales y otros ajustes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4034, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '118', '4020', 'Aportaciones de socios o propietarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4035, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '119', '4020', 'Diferencias por ajuste del capital a euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4036, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '12', '4001', 'Resultados pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4037, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '120', '4036', 'Remanente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4038, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '121', '4036', 'Resultados negativos de ejercicios anteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4039, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '129', '4036', 'Resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4040, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '13', '4001', 'Subvenciones, donaciones y ajustes por cambio de valor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4041, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '130', '4040', 'Subvenciones oficiales de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4042, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '131', '4040', 'Donaciones y legados de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4043, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '132', '4040', 'Otras subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4044, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '133', '4040', 'Ajustes por valoración en activos financieros disponibles para la venta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4045, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '134', '4040', 'Operaciones de cobertura', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4046, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1340', '4045', 'Cobertura de flujos de efectivo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4047, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1341', '4045', 'Cobertura de una inversión neta en un negocio extranjero', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4048, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '135', '4040', 'Diferencias de conversión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4049, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '136', '4040', 'Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4050, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '137', '4040', 'Ingresos fiscales a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4051, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1370', '4050', 'Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4052, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1371', '4050', 'Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4053, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '14', '4001', 'Provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4054, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '141', '4053', 'Provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4055, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '142', '4053', 'Provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4056, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '143', '4053', 'Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4057, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '145', '4053', 'Provisión para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4058, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '15', '4001', 'Deudas a largo plazo con características especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4059, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '150', '4058', 'Acciones o participaciones a largo plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4060, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '153', '4058', 'Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4061, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1533', '4060', 'Desembolsos no exigidos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4062, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1534', '4060', 'Desembolsos no exigidos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4063, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1535', '4060', 'Desembolsos no exigidos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4064, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1536', '4060', 'Otros desembolsos no exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4065, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '154', '4058', 'Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4066, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1543', '4065', 'Aportaciones no dinerarias pendientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4067, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1544', '4065', 'Aportaciones no dinerarias pendientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4068, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1545', '4065', 'Aportaciones no dinerarias pendientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4069, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1546', '4065', 'Otras aportaciones no dinerarias pendientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4070, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '16', '4001', 'Deudas a largo plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4071, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '160', '4070', 'Deudas a largo plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4072, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1603', '4071', 'Deudas a largo plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4073, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1604', '4071', 'Deudas a largo plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4074, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1605', '4071', 'Deudas a largo plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4075, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '161', '4070', 'Proveedores de inmovilizado a largo plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4076, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1613', '4075', 'Proveedores de inmovilizado a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4077, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1614', '4075', 'Proveedores de inmovilizado a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4078, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1615', '4075', 'Proveedores de inmovilizado a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4079, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '162', '4070', 'Acreedores por arrendamiento financiero a largo plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4080, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1623', '4079', 'Acreedores por arrendamiento financiero a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4081, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1624', '4080', 'Acreedores por arrendamiento financiero a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4082, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1625', '4080', 'Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4083, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '163', '4070', 'Otras deudas a largo plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4084, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1633', '4083', 'Otras deudas a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4085, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1634', '4083', 'Otras deudas a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4086, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1635', '4083', 'Otras deudas a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4087, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '17', '4001', 'Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4088, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '170', '4087', 'Deudas a largo plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4089, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '171', '4087', 'Deudas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4090, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '172', '4087', 'Deudas a largo plazo transformables en suvbenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4091, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '173', '4087', 'Proveedores de inmovilizado a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4092, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '174', '4087', 'Acreedores por arrendamiento financiero a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4093, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '175', '4087', 'Efectos a pagar a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4094, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '176', '4087', 'Pasivos por derivados financieros a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4095, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '177', '4087', 'Obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4096, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '179', '4087', 'Deudas representadas en otros valores negociables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4097, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '18', '4001', 'Pasivos por fianzas garantias y otros conceptos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4098, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '180', '4097', 'Fianzas recibidas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4099, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '181', '4097', 'Anticipos recibidos por ventas o prestaciones de servicios a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4100, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '185', '4097', 'Depositos recibidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4101, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '19', '4001', 'Situaciones transitorias de financiación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4102, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '190', '4101', 'Acciones o participaciones emitidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4103, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '192', '4101', 'Suscriptores de acciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4104, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '194', '4101', 'Capital emitido pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4105, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '195', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4106, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '197', '4101', 'Suscriptores de acciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4107, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '199', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4108, 'PCG08-PYME','ACTIVO', 'XXXXXX', '20', '4002', 'Inmovilizaciones intangibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4109, 'PCG08-PYME','ACTIVO', 'XXXXXX', '200', '4108', 'Investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4110, 'PCG08-PYME','ACTIVO', 'XXXXXX', '201', '4108', 'Desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4111, 'PCG08-PYME','ACTIVO', 'XXXXXX', '202', '4108', 'Concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4112, 'PCG08-PYME','ACTIVO', 'XXXXXX', '203', '4108', 'Propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4113, 'PCG08-PYME','ACTIVO', 'XXXXXX', '205', '4108', 'Derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4114, 'PCG08-PYME','ACTIVO', 'XXXXXX', '206', '4108', 'Aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4115, 'PCG08-PYME','ACTIVO', 'XXXXXX', '209', '4108', 'Anticipos para inmovilizaciones intangibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4116, 'PCG08-PYME','ACTIVO', 'XXXXXX', '21', '4002', 'Inmovilizaciones materiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4117, 'PCG08-PYME','ACTIVO', 'XXXXXX', '210', '4116', 'Terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4118, 'PCG08-PYME','ACTIVO', 'XXXXXX', '211', '4116', 'Construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4119, 'PCG08-PYME','ACTIVO', 'XXXXXX', '212', '4116', 'Instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4120, 'PCG08-PYME','ACTIVO', 'XXXXXX', '213', '4116', 'Maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4121, 'PCG08-PYME','ACTIVO', 'XXXXXX', '214', '4116', 'Utillaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4122, 'PCG08-PYME','ACTIVO', 'XXXXXX', '215', '4116', 'Otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4123, 'PCG08-PYME','ACTIVO', 'XXXXXX', '216', '4116', 'Mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4124, 'PCG08-PYME','ACTIVO', 'XXXXXX', '217', '4116', 'Equipos para procesos de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4125, 'PCG08-PYME','ACTIVO', 'XXXXXX', '218', '4116', 'Elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4126, 'PCG08-PYME','ACTIVO', 'XXXXXX', '219', '4116', 'Otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4127, 'PCG08-PYME','ACTIVO', 'XXXXXX', '22', '4002', 'Inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4128, 'PCG08-PYME','ACTIVO', 'XXXXXX', '220', '4127', 'Inversiones en terreons y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4129, 'PCG08-PYME','ACTIVO', 'XXXXXX', '221', '4127', 'Inversiones en construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4130, 'PCG08-PYME','ACTIVO', 'XXXXXX', '23', '4002', 'Inmovilizaciones materiales en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4131, 'PCG08-PYME','ACTIVO', 'XXXXXX', '230', '4130', 'Adaptación de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4132, 'PCG08-PYME','ACTIVO', 'XXXXXX', '231', '4130', 'Construcciones en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4133, 'PCG08-PYME','ACTIVO', 'XXXXXX', '232', '4130', 'Instalaciones técnicas en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4134, 'PCG08-PYME','ACTIVO', 'XXXXXX', '233', '4130', 'Maquinaria en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4135, 'PCG08-PYME','ACTIVO', 'XXXXXX', '237', '4130', 'Equipos para procesos de información en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4136, 'PCG08-PYME','ACTIVO', 'XXXXXX', '239', '4130', 'Anticipos para inmovilizaciones materiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4137, 'PCG08-PYME','ACTIVO', 'XXXXXX', '24', '4002', 'Inversiones financieras a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4138, 'PCG08-PYME','ACTIVO', 'XXXXXX', '240', '4137', 'Participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4139, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2403', '4138', 'Participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4140, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2404', '4138', 'Participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4141, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2405', '4138', 'Participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4142, 'PCG08-PYME','ACTIVO', 'XXXXXX', '241', '4137', 'Valores representativos de deuda a largo plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4143, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2413', '4142', 'Valores representativos de deuda a largo plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4144, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2414', '4142', 'Valores representativos de deuda a largo plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4145, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2415', '4142', 'Valores representativos de deuda a largo plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4146, 'PCG08-PYME','ACTIVO', 'XXXXXX', '242', '4137', 'Créditos a largo plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4147, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2423', '4146', 'Créditos a largo plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4148, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2424', '4146', 'Créditos a largo plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4149, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2425', '4146', 'Créditos a largo plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4150, 'PCG08-PYME','ACTIVO', 'XXXXXX', '249', '4137', 'Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4151, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2493', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4152, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2494', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4153, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2495', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4154, 'PCG08-PYME','ACTIVO', 'XXXXXX', '25', '4002', 'Otras inversiones financieras a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4155, 'PCG08-PYME','ACTIVO', 'XXXXXX', '250', '4154', 'Inversiones financieras a largo plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4156, 'PCG08-PYME','ACTIVO', 'XXXXXX', '251', '4154', 'Valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4157, 'PCG08-PYME','ACTIVO', 'XXXXXX', '252', '4154', 'Créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4158, 'PCG08-PYME','ACTIVO', 'XXXXXX', '253', '4154', 'Créditos a largo plazo por enajenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4159, 'PCG08-PYME','ACTIVO', 'XXXXXX', '254', '4154', 'Créditos a largo plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4160, 'PCG08-PYME','ACTIVO', 'XXXXXX', '255', '4154', 'Activos por derivados financieros a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4161, 'PCG08-PYME','ACTIVO', 'XXXXXX', '258', '4154', 'Imposiciones a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4162, 'PCG08-PYME','ACTIVO', 'XXXXXX', '259', '4154', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4163, 'PCG08-PYME','ACTIVO', 'XXXXXX', '26', '4002', 'Fianzas y depósitos constituidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4164, 'PCG08-PYME','ACTIVO', 'XXXXXX', '260', '4163', 'Fianzas constituidas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4165, 'PCG08-PYME','ACTIVO', 'XXXXXX', '261', '4163', 'Depósitos constituidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4166, 'PCG08-PYME','ACTIVO', 'XXXXXX', '28', '4002', 'Amortización acumulada del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4167, 'PCG08-PYME','ACTIVO', 'XXXXXX', '280', '4166', 'Amortización acumulado del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4168, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2800', '4167', 'Amortización acumulada de investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4169, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2801', '4167', 'Amortización acumulada de desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4170, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2802', '4167', 'Amortización acumulada de concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4171, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2803', '4167', 'Amortización acumulada de propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4172, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2805', '4167', 'Amortización acumulada de derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4173, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2806', '4167', 'Amortización acumulada de aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4174, 'PCG08-PYME','ACTIVO', 'XXXXXX', '281', '4166', 'Amortización acumulado del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4175, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2811', '4174', 'Amortización acumulada de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4176, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2812', '4174', 'Amortización acumulada de instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4177, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2813', '4174', 'Amortización acumulada de maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4178, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2814', '4174', 'Amortización acumulada de utillaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4179, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2815', '4174', 'Amortización acumulada de otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4180, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2816', '4174', 'Amortización acumulada de mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4181, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2817', '4174', 'Amortización acumulada de equipos para proceso de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4182, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2818', '4174', 'Amortización acumulada de elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4183, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2819', '4175', 'Amortización acumulada de otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4184, 'PCG08-PYME','ACTIVO', 'XXXXXX', '282', '4166', 'Amortización acumulada de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4185, 'PCG08-PYME','ACTIVO', 'XXXXXX', '29', '4002', 'Deterioro de valor de activos no corrientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4186, 'PCG08-PYME','ACTIVO', 'XXXXXX', '290', '4185', 'Deterioro de valor del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4187, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2900', '4186', 'Deterioro de valor de investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4188, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2901', '4186', 'Deterioro de valor de desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4189, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2902', '4186', 'Deterioro de valor de concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4190, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2903', '4186', 'Deterioro de valor de propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4191, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2905', '4186', 'Deterioro de valor de derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4192, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2906', '4186', 'Deterioro de valor de aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4193, 'PCG08-PYME','ACTIVO', 'XXXXXX', '291', '4185', 'Deterioro de valor del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4194, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2910', '4193', 'Deterioro de valor de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4195, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2911', '4193', 'Deterioro de valor de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4196, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2912', '4193', 'Deterioro de valor de instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4197, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2913', '4193', 'Deterioro de valor de maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4198, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2914', '4193', 'Deterioro de valor de utillajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4199, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2915', '4194', 'Deterioro de valor de otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4200, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2916', '4194', 'Deterioro de valor de mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4201, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2917', '4194', 'Deterioro de valor de equipos para proceso de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4202, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2918', '4194', 'Deterioro de valor de elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4203, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2919', '4194', 'Deterioro de valor de otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4204, 'PCG08-PYME','ACTIVO', 'XXXXXX', '292', '4185', 'Deterioro de valor de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4205, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2920', '4204', 'Deterioro de valor de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4206, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2921', '4204', 'Deterioro de valor de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4207, 'PCG08-PYME','ACTIVO', 'XXXXXX', '293', '4185', 'Deterioro de valor de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4208, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2933', '4207', 'Deterioro de valor de participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4209, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2934', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4210, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2935', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4211, 'PCG08-PYME','ACTIVO', 'XXXXXX', '294', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4212, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2943', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4213, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2944', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4214, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2945', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4215, 'PCG08-PYME','ACTIVO', 'XXXXXX', '295', '4185', 'Deterioro de valor de créditos a largo plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4216, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2953', '4215', 'Deterioro de valor de créditos a largo plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4217, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2954', '4215', 'Deterioro de valor de créditos a largo plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4218, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2955', '4215', 'Deterioro de valor de créditos a largo plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4219, 'PCG08-PYME','ACTIVO', 'XXXXXX', '296', '4185', 'Deterioro de valor de participaciones en el patrimonio netoa largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4220, 'PCG08-PYME','ACTIVO', 'XXXXXX', '297', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4221, 'PCG08-PYME','ACTIVO', 'XXXXXX', '298', '4185', 'Deterioro de valor de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4222, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '30', '4003', 'Comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4223, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '300', '4222', 'Mercaderías A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4224, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '301', '4222', 'Mercaderías B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4225, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '31', '4003', 'Materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4226, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '310', '4225', 'Materias primas A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4227, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '311', '4225', 'Materias primas B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4228, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '32', '4003', 'Otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4229, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '320', '4228', 'Elementos y conjuntos incorporables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4230, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '321', '4228', 'Combustibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4231, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '322', '4228', 'Repuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4232, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '325', '4228', 'Materiales diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4233, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '326', '4228', 'Embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4234, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '327', '4228', 'Envases', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4235, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '328', '4229', 'Material de oficina', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4236, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '33', '4003', 'Productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4237, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '330', '4236', 'Productos en curos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4238, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '331', '4236', 'Productos en curso B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4239, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '34', '4003', 'Productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4240, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '340', '4239', 'Productos semiterminados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4241, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '341', '4239', 'Productos semiterminados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4242, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '35', '4003', 'Productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4243, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '350', '4242', 'Productos terminados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4244, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '351', '4242', 'Productos terminados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4245, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '36', '4003', 'Subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4246, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '360', '4245', 'Subproductos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4247, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '361', '4245', 'Subproductos B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4248, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '365', '4245', 'Residuos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4249, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '366', '4245', 'Residuos B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4250, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '368', '4245', 'Materiales recuperados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4251, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '369', '4245', 'Materiales recuperados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4252, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '39', '4003', 'Deterioro de valor de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4253, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '390', '4252', 'Deterioro de valor de las mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4254, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '391', '4252', 'Deterioro de valor de las materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4255, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '392', '4252', 'Deterioro de valor de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4256, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '393', '4252', 'Deterioro de valor de los productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4257, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '394', '4252', 'Deterioro de valor de los productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4258, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '395', '4252', 'Deterioro de valor de los productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4259, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501,'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); From 2783ec7dc86988e8730eb3adf2136cfe70eb0cbe Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 29 Jul 2014 00:00:34 +0200 Subject: [PATCH 339/502] New: Add PYME (base) accountancy spanish plan --- .../install/mysql/migration/3.6.0-3.7.0.sql | 790 ++++++++++++++++++ 1 file changed, 790 insertions(+) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index b4d36e82a80..a86b55baa3d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -126,3 +126,793 @@ ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref; ALTER TABLE llx_adherents MODIFY COLUMN societe VARCHAR(60); +-- +-- Descriptif des plans comptables ES PCG08-PYME +-- + +INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (4, 'PCG08-PYME', '4', 'The PYME accountancy spanish plan', '1'); + +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4001,'PCG08-PYME','FINANCIACION', 'XXXXXX', '1', '', 'Financiación básica', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4002,'PCG08-PYME','ACTIVO', 'XXXXXX', '2', '', 'Activo no corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '', 'Existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS Y GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); + +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4010, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '101', '4008', 'Fondo social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4011, 'PCG08-PYME','FINANCIACION', 'CAPITAL', '102', '4008', 'Capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4012, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '103', '4008', 'Socios por desembolsos no exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4013, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1030', '4012', 'Socios por desembolsos no exigidos capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4014, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1034', '4012', 'Socios por desembolsos no exigidos capital pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4015, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '104', '4008', 'Socios por aportaciones no dineradas pendientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4016, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1040', '4015', 'Socios por aportaciones no dineradas pendientes capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4017, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1044', '4015', 'Socios por aportaciones no dineradas pendientes capital pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4018, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '108', '4008', 'Acciones o participaciones propias en situaciones especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4019, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '109', '4008', 'Acciones o participaciones propias para reducción de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4020, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '11', '4001', 'Reservas y otros instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4021, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '110', '4020', 'Prima de emisión o asunción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4022, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '111', '4020', 'Otros instrumentos de patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4023, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1110', '4022', 'Patrimonio neto por emisión de instrumentos financieros compuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4024, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1111', '4022', 'Resto de instrumentos de patrimoio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4025, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '112', '4020', 'Reserva legal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4026, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '113', '4020', 'Reservas voluntarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4027, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '114', '4020', 'Reservas especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4028, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1140', '4027', 'Reservas para acciones o participaciones de la sociedad dominante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4029, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1141', '4027', 'Reservas estatutarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4030, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1142', '4027', 'Reservas por capital amortizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4031, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1143', '4027', 'Reservas por fondo de comercio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4032, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1144', '4028', 'Reservas por acciones propias aceptadas en garantía', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4033, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '115', '4020', 'Reservas por pérdidas y ganancias actuariales y otros ajustes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4034, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '118', '4020', 'Aportaciones de socios o propietarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4035, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '119', '4020', 'Diferencias por ajuste del capital a euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4036, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '12', '4001', 'Resultados pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4037, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '120', '4036', 'Remanente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4038, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '121', '4036', 'Resultados negativos de ejercicios anteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4039, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '129', '4036', 'Resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4040, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '13', '4001', 'Subvenciones, donaciones y ajustes por cambio de valor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4041, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '130', '4040', 'Subvenciones oficiales de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4042, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '131', '4040', 'Donaciones y legados de capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4043, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '132', '4040', 'Otras subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4044, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '133', '4040', 'Ajustes por valoración en activos financieros disponibles para la venta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4045, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '134', '4040', 'Operaciones de cobertura', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4046, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1340', '4045', 'Cobertura de flujos de efectivo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4047, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1341', '4045', 'Cobertura de una inversión neta en un negocio extranjero', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4048, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '135', '4040', 'Diferencias de conversión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4049, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '136', '4040', 'Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4050, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '137', '4040', 'Ingresos fiscales a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4051, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1370', '4050', 'Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4052, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1371', '4050', 'Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4053, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '14', '4001', 'Provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4054, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '141', '4053', 'Provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4055, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '142', '4053', 'Provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4056, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '143', '4053', 'Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4057, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '145', '4053', 'Provisión para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4058, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '15', '4001', 'Deudas a largo plazo con características especiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4059, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '150', '4058', 'Acciones o participaciones a largo plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4060, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '153', '4058', 'Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4061, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1533', '4060', 'Desembolsos no exigidos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4062, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1534', '4060', 'Desembolsos no exigidos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4063, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1535', '4060', 'Desembolsos no exigidos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4064, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1536', '4060', 'Otros desembolsos no exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4065, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '154', '4058', 'Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4066, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1543', '4065', 'Aportaciones no dinerarias pendientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4067, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1544', '4065', 'Aportaciones no dinerarias pendientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4068, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1545', '4065', 'Aportaciones no dinerarias pendientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4069, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1546', '4065', 'Otras aportaciones no dinerarias pendientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4070, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '16', '4001', 'Deudas a largo plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4071, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '160', '4070', 'Deudas a largo plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4072, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1603', '4071', 'Deudas a largo plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4073, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1604', '4071', 'Deudas a largo plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4074, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1605', '4071', 'Deudas a largo plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4075, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '161', '4070', 'Proveedores de inmovilizado a largo plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4076, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1613', '4075', 'Proveedores de inmovilizado a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4077, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1614', '4075', 'Proveedores de inmovilizado a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4078, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1615', '4075', 'Proveedores de inmovilizado a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4079, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '162', '4070', 'Acreedores por arrendamiento financiero a largo plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4080, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1623', '4079', 'Acreedores por arrendamiento financiero a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4081, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1624', '4080', 'Acreedores por arrendamiento financiero a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4082, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1625', '4080', 'Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4083, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '163', '4070', 'Otras deudas a largo plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4084, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1633', '4083', 'Otras deudas a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4085, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1634', '4083', 'Otras deudas a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4086, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1635', '4083', 'Otras deudas a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4087, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '17', '4001', 'Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4088, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '170', '4087', 'Deudas a largo plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4089, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '171', '4087', 'Deudas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4090, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '172', '4087', 'Deudas a largo plazo transformables en suvbenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4091, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '173', '4087', 'Proveedores de inmovilizado a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4092, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '174', '4087', 'Acreedores por arrendamiento financiero a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4093, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '175', '4087', 'Efectos a pagar a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4094, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '176', '4087', 'Pasivos por derivados financieros a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4095, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '177', '4087', 'Obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4096, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '179', '4087', 'Deudas representadas en otros valores negociables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4097, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '18', '4001', 'Pasivos por fianzas garantias y otros conceptos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4098, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '180', '4097', 'Fianzas recibidas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4099, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '181', '4097', 'Anticipos recibidos por ventas o prestaciones de servicios a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4100, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '185', '4097', 'Depositos recibidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4101, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '19', '4001', 'Situaciones transitorias de financiación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4102, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '190', '4101', 'Acciones o participaciones emitidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4103, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '192', '4101', 'Suscriptores de acciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4104, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '194', '4101', 'Capital emitido pendiente de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4105, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '195', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4106, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '197', '4101', 'Suscriptores de acciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4107, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '199', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4108, 'PCG08-PYME','ACTIVO', 'XXXXXX', '20', '4002', 'Inmovilizaciones intangibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4109, 'PCG08-PYME','ACTIVO', 'XXXXXX', '200', '4108', 'Investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4110, 'PCG08-PYME','ACTIVO', 'XXXXXX', '201', '4108', 'Desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4111, 'PCG08-PYME','ACTIVO', 'XXXXXX', '202', '4108', 'Concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4112, 'PCG08-PYME','ACTIVO', 'XXXXXX', '203', '4108', 'Propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4113, 'PCG08-PYME','ACTIVO', 'XXXXXX', '205', '4108', 'Derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4114, 'PCG08-PYME','ACTIVO', 'XXXXXX', '206', '4108', 'Aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4115, 'PCG08-PYME','ACTIVO', 'XXXXXX', '209', '4108', 'Anticipos para inmovilizaciones intangibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4116, 'PCG08-PYME','ACTIVO', 'XXXXXX', '21', '4002', 'Inmovilizaciones materiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4117, 'PCG08-PYME','ACTIVO', 'XXXXXX', '210', '4116', 'Terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4118, 'PCG08-PYME','ACTIVO', 'XXXXXX', '211', '4116', 'Construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4119, 'PCG08-PYME','ACTIVO', 'XXXXXX', '212', '4116', 'Instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4120, 'PCG08-PYME','ACTIVO', 'XXXXXX', '213', '4116', 'Maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4121, 'PCG08-PYME','ACTIVO', 'XXXXXX', '214', '4116', 'Utillaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4122, 'PCG08-PYME','ACTIVO', 'XXXXXX', '215', '4116', 'Otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4123, 'PCG08-PYME','ACTIVO', 'XXXXXX', '216', '4116', 'Mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4124, 'PCG08-PYME','ACTIVO', 'XXXXXX', '217', '4116', 'Equipos para procesos de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4125, 'PCG08-PYME','ACTIVO', 'XXXXXX', '218', '4116', 'Elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4126, 'PCG08-PYME','ACTIVO', 'XXXXXX', '219', '4116', 'Otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4127, 'PCG08-PYME','ACTIVO', 'XXXXXX', '22', '4002', 'Inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4128, 'PCG08-PYME','ACTIVO', 'XXXXXX', '220', '4127', 'Inversiones en terreons y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4129, 'PCG08-PYME','ACTIVO', 'XXXXXX', '221', '4127', 'Inversiones en construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4130, 'PCG08-PYME','ACTIVO', 'XXXXXX', '23', '4002', 'Inmovilizaciones materiales en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4131, 'PCG08-PYME','ACTIVO', 'XXXXXX', '230', '4130', 'Adaptación de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4132, 'PCG08-PYME','ACTIVO', 'XXXXXX', '231', '4130', 'Construcciones en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4133, 'PCG08-PYME','ACTIVO', 'XXXXXX', '232', '4130', 'Instalaciones técnicas en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4134, 'PCG08-PYME','ACTIVO', 'XXXXXX', '233', '4130', 'Maquinaria en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4135, 'PCG08-PYME','ACTIVO', 'XXXXXX', '237', '4130', 'Equipos para procesos de información en montaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4136, 'PCG08-PYME','ACTIVO', 'XXXXXX', '239', '4130', 'Anticipos para inmovilizaciones materiales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4137, 'PCG08-PYME','ACTIVO', 'XXXXXX', '24', '4002', 'Inversiones financieras a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4138, 'PCG08-PYME','ACTIVO', 'XXXXXX', '240', '4137', 'Participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4139, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2403', '4138', 'Participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4140, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2404', '4138', 'Participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4141, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2405', '4138', 'Participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4142, 'PCG08-PYME','ACTIVO', 'XXXXXX', '241', '4137', 'Valores representativos de deuda a largo plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4143, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2413', '4142', 'Valores representativos de deuda a largo plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4144, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2414', '4142', 'Valores representativos de deuda a largo plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4145, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2415', '4142', 'Valores representativos de deuda a largo plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4146, 'PCG08-PYME','ACTIVO', 'XXXXXX', '242', '4137', 'Créditos a largo plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4147, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2423', '4146', 'Créditos a largo plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4148, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2424', '4146', 'Créditos a largo plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4149, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2425', '4146', 'Créditos a largo plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4150, 'PCG08-PYME','ACTIVO', 'XXXXXX', '249', '4137', 'Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4151, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2493', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4152, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2494', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4153, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2495', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4154, 'PCG08-PYME','ACTIVO', 'XXXXXX', '25', '4002', 'Otras inversiones financieras a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4155, 'PCG08-PYME','ACTIVO', 'XXXXXX', '250', '4154', 'Inversiones financieras a largo plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4156, 'PCG08-PYME','ACTIVO', 'XXXXXX', '251', '4154', 'Valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4157, 'PCG08-PYME','ACTIVO', 'XXXXXX', '252', '4154', 'Créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4158, 'PCG08-PYME','ACTIVO', 'XXXXXX', '253', '4154', 'Créditos a largo plazo por enajenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4159, 'PCG08-PYME','ACTIVO', 'XXXXXX', '254', '4154', 'Créditos a largo plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4160, 'PCG08-PYME','ACTIVO', 'XXXXXX', '255', '4154', 'Activos por derivados financieros a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4161, 'PCG08-PYME','ACTIVO', 'XXXXXX', '258', '4154', 'Imposiciones a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4162, 'PCG08-PYME','ACTIVO', 'XXXXXX', '259', '4154', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4163, 'PCG08-PYME','ACTIVO', 'XXXXXX', '26', '4002', 'Fianzas y depósitos constituidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4164, 'PCG08-PYME','ACTIVO', 'XXXXXX', '260', '4163', 'Fianzas constituidas a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4165, 'PCG08-PYME','ACTIVO', 'XXXXXX', '261', '4163', 'Depósitos constituidos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4166, 'PCG08-PYME','ACTIVO', 'XXXXXX', '28', '4002', 'Amortización acumulada del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4167, 'PCG08-PYME','ACTIVO', 'XXXXXX', '280', '4166', 'Amortización acumulado del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4168, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2800', '4167', 'Amortización acumulada de investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4169, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2801', '4167', 'Amortización acumulada de desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4170, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2802', '4167', 'Amortización acumulada de concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4171, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2803', '4167', 'Amortización acumulada de propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4172, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2805', '4167', 'Amortización acumulada de derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4173, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2806', '4167', 'Amortización acumulada de aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4174, 'PCG08-PYME','ACTIVO', 'XXXXXX', '281', '4166', 'Amortización acumulado del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4175, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2811', '4174', 'Amortización acumulada de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4176, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2812', '4174', 'Amortización acumulada de instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4177, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2813', '4174', 'Amortización acumulada de maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4178, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2814', '4174', 'Amortización acumulada de utillaje', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4179, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2815', '4174', 'Amortización acumulada de otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4180, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2816', '4174', 'Amortización acumulada de mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4181, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2817', '4174', 'Amortización acumulada de equipos para proceso de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4182, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2818', '4174', 'Amortización acumulada de elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4183, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2819', '4175', 'Amortización acumulada de otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4184, 'PCG08-PYME','ACTIVO', 'XXXXXX', '282', '4166', 'Amortización acumulada de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4185, 'PCG08-PYME','ACTIVO', 'XXXXXX', '29', '4002', 'Deterioro de valor de activos no corrientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4186, 'PCG08-PYME','ACTIVO', 'XXXXXX', '290', '4185', 'Deterioro de valor del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4187, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2900', '4186', 'Deterioro de valor de investigación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4188, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2901', '4186', 'Deterioro de valor de desarrollo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4189, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2902', '4186', 'Deterioro de valor de concesiones administrativas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4190, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2903', '4186', 'Deterioro de valor de propiedad industrial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4191, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2905', '4186', 'Deterioro de valor de derechos de transpaso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4192, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2906', '4186', 'Deterioro de valor de aplicaciones informáticas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4193, 'PCG08-PYME','ACTIVO', 'XXXXXX', '291', '4185', 'Deterioro de valor del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4194, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2910', '4193', 'Deterioro de valor de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4195, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2911', '4193', 'Deterioro de valor de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4196, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2912', '4193', 'Deterioro de valor de instalaciones técnicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4197, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2913', '4193', 'Deterioro de valor de maquinaria', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4198, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2914', '4193', 'Deterioro de valor de utillajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4199, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2915', '4194', 'Deterioro de valor de otras instalaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4200, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2916', '4194', 'Deterioro de valor de mobiliario', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4201, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2917', '4194', 'Deterioro de valor de equipos para proceso de información', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4202, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2918', '4194', 'Deterioro de valor de elementos de transporte', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4203, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2919', '4194', 'Deterioro de valor de otro inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4204, 'PCG08-PYME','ACTIVO', 'XXXXXX', '292', '4185', 'Deterioro de valor de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4205, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2920', '4204', 'Deterioro de valor de terrenos y bienes naturales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4206, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2921', '4204', 'Deterioro de valor de construcciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4207, 'PCG08-PYME','ACTIVO', 'XXXXXX', '293', '4185', 'Deterioro de valor de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4208, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2933', '4207', 'Deterioro de valor de participaciones a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4209, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2934', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4210, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2935', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4211, 'PCG08-PYME','ACTIVO', 'XXXXXX', '294', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4212, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2943', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4213, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2944', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4214, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2945', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4215, 'PCG08-PYME','ACTIVO', 'XXXXXX', '295', '4185', 'Deterioro de valor de créditos a largo plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4216, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2953', '4215', 'Deterioro de valor de créditos a largo plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4217, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2954', '4215', 'Deterioro de valor de créditos a largo plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4218, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2955', '4215', 'Deterioro de valor de créditos a largo plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4219, 'PCG08-PYME','ACTIVO', 'XXXXXX', '296', '4185', 'Deterioro de valor de participaciones en el patrimonio netoa largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4220, 'PCG08-PYME','ACTIVO', 'XXXXXX', '297', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4221, 'PCG08-PYME','ACTIVO', 'XXXXXX', '298', '4185', 'Deterioro de valor de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4222, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '30', '4003', 'Comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4223, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '300', '4222', 'Mercaderías A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4224, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '301', '4222', 'Mercaderías B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4225, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '31', '4003', 'Materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4226, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '310', '4225', 'Materias primas A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4227, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '311', '4225', 'Materias primas B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4228, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '32', '4003', 'Otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4229, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '320', '4228', 'Elementos y conjuntos incorporables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4230, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '321', '4228', 'Combustibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4231, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '322', '4228', 'Repuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4232, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '325', '4228', 'Materiales diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4233, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '326', '4228', 'Embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4234, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '327', '4228', 'Envases', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4235, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '328', '4229', 'Material de oficina', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4236, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '33', '4003', 'Productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4237, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '330', '4236', 'Productos en curos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4238, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '331', '4236', 'Productos en curso B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4239, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '34', '4003', 'Productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4240, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '340', '4239', 'Productos semiterminados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4241, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '341', '4239', 'Productos semiterminados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4242, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '35', '4003', 'Productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4243, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '350', '4242', 'Productos terminados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4244, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '351', '4242', 'Productos terminados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4245, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '36', '4003', 'Subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4246, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '360', '4245', 'Subproductos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4247, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '361', '4245', 'Subproductos B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4248, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '365', '4245', 'Residuos A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4249, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '366', '4245', 'Residuos B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4250, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '368', '4245', 'Materiales recuperados A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4251, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '369', '4245', 'Materiales recuperados B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4252, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '39', '4003', 'Deterioro de valor de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4253, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '390', '4252', 'Deterioro de valor de las mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4254, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '391', '4252', 'Deterioro de valor de las materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4255, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '392', '4252', 'Deterioro de valor de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4256, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '393', '4252', 'Deterioro de valor de los productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4257, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '394', '4252', 'Deterioro de valor de los productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4258, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '395', '4252', 'Deterioro de valor de los productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4259, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501,'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); + + From dcb507fd376ea9ed801432fe735ff0807aebf65e Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 29 Jul 2014 06:55:28 +0200 Subject: [PATCH 340/502] Presentation invoice page --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4693f4ee1fa..320acf570b6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2915,7 +2915,7 @@ if ($action == 'create') if ($object->type == Facture::TYPE_CREDIT_NOTE) $sign = - 1; - $nbrows = 8; + $nbrows = 9; $nbcols = 2; if (! empty($conf->projet->enabled)) $nbrows ++; From c80d1285e34bc8adb69065b1c4984fd3967a16bf Mon Sep 17 00:00:00 2001 From: icfr Date: Tue, 29 Jul 2014 07:11:25 +0200 Subject: [PATCH 341/502] order task on pdf --- htdocs/fichinter/class/fichinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7a792dbc4ad..ba13a4aa73a 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -958,7 +958,7 @@ class Fichinter extends CommonObject { $sql = 'SELECT rowid, description, duree, date, rang'; $sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet'; - $sql.= ' WHERE fk_fichinter = '.$this->id; + $sql.=' WHERE fk_fichinter = '.$this->id .' ORDER BY rang ASC' ; dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql=$this->db->query($sql); From 6bff4dde774da7ff3b788ebd700789422c463f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 29 Jul 2014 11:15:32 +0200 Subject: [PATCH 342/502] Fix categories creation --- htdocs/categories/class/categorie.class.php | 2 +- htdocs/categories/fiche.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a526ca221df..c93428885dd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -137,7 +137,7 @@ class Categorie extends CommonObject * -3 : categorie invalide * -4 : category already exists */ - function create($user='') + function create($user) { global $conf,$langs,$hookmanager; $langs->load('categories'); diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 66370022c20..9a41d1b389a 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -138,7 +138,7 @@ if ($action == 'add' && $user->rights->categorie->creer) // Create category in database if (! $error) { - $result = $object->create(); + $result = $object->create($user); if ($result > 0) { $action = 'confirmed'; From 0b31bfc067ff00c66149bf4f13c547c4e7810b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 29 Jul 2014 11:23:13 +0200 Subject: [PATCH 343/502] Updated Vagrant Puphpet box --- dev/vagrant/dolibarrdev/Vagrantfile | 57 ++++- .../dolibarrdev/puphpet/.gitattributes | 7 +- dev/vagrant/dolibarrdev/puphpet/config.yaml | 16 +- .../dolibarrdev/puphpet/puppet/manifest.pp | 204 +++++++++-------- .../puphpet/puppet/modules/epel/Gemfile | 15 ++ .../puphpet/puppet/modules/epel/LICENSE | 13 ++ .../puphpet/puppet/modules/epel/Modulefile | 8 + .../puphpet/puppet/modules/epel/README.md | 90 ++++++++ .../puphpet/puppet/modules/epel/Rakefile | 17 ++ .../modules/epel/files/RPM-GPG-KEY-EPEL-5 | 30 +++ .../modules/epel/files/RPM-GPG-KEY-EPEL-6 | 29 +++ .../modules/epel/files/RPM-GPG-KEY-EPEL-7 | 29 +++ .../modules/epel/lib/facter/os_maj_version.rb | 11 + .../puppet/modules/epel/manifests/init.pp | 135 ++++++++++++ .../puppet/modules/epel/manifests/params.pp | 45 ++++ .../modules/epel/manifests/rpm_gpg_key.pp | 28 +++ .../puphpet/puppet/modules/epel/metadata.json | 45 ++++ .../modules/epel/spec/classes/epel_spec.rb | 80 +++++++ .../modules/epel/spec/classes/shared_base.rb | 36 +++ .../epel/spec/classes/shared_debuginfo.rb | 36 +++ .../epel/spec/classes/shared_gpgkey.rb | 37 ++++ .../epel/spec/classes/shared_source.rb | 36 +++ .../epel/spec/classes/shared_testing.rb | 36 +++ .../spec/classes/shared_testing_debuginfo.rb | 36 +++ .../spec/classes/shared_testing_source.rb | 36 +++ .../epel/spec/defines/rpm_gpg_key_spec.rb | 57 +++++ .../puppet/modules/epel/spec/spec_helper.rb | 8 + .../modules/epel/spec/spec_helper_system.rb | 23 ++ .../modules/epel/spec/system/basic_spec.rb | 36 +++ .../modules/epel/spec/system/usage_spec.rb | 60 +++++ .../spec/unit/facter/os_maj_version_spec.rb | 21 ++ .../puphpet/puppet/modules/epel/tests/init.pp | 3 + .../puppet/modules/erlang/.fixtures.yml | 7 + .../puppet/modules/erlang/.nodeset.yml | 35 +++ .../puphpet/puppet/modules/erlang/.rspec | 1 + .../puphpet/puppet/modules/erlang/.travis.yml | 23 ++ .../puphpet/puppet/modules/erlang/Gemfile | 15 ++ .../puppet/modules/erlang/Gemfile.lock | 94 ++++++++ .../puphpet/puppet/modules/erlang/LICENSE | 207 ++++++++++++++++++ .../puphpet/puppet/modules/erlang/Modulefile | 10 + .../puphpet/puppet/modules/erlang/README.md | 28 +++ .../puphpet/puppet/modules/erlang/Rakefile | 35 +++ .../puppet/modules/erlang/manifests/init.pp | 45 ++++ .../puppet/modules/erlang/manifests/params.pp | 29 +++ .../modules/erlang/manifests/repo/apt.pp | 41 ++++ .../modules/erlang/manifests/repo/yum.pp | 30 +++ .../erlang/spec/classes/erlang_spec.rb | 138 ++++++++++++ .../puppet/modules/erlang/spec/spec_helper.rb | 1 + .../modules/erlang/spec/spec_helper_system.rb | 17 ++ .../modules/erlang/spec/system/erlang_spec.rb | 25 +++ .../puppet/parser/functions/hash_key_true.rb | 6 +- .../lib/puppet/parser/functions/value_true.rb | 45 ++++ .../puppet/modules/puphpet/manifests/hhvm.pp | 6 +- .../modules/puphpet/manifests/params.pp | 7 +- .../modules/puphpet/manifests/php/pear.pp | 8 +- .../modules/puphpet/manifests/php/pecl.pp | 26 ++- .../modules/puphpet/manifests/supervisord.pp | 18 ++ .../puphpet/puppet/modules/rabbitmq/README.md | 49 ++++- .../files/plugins/amqp_client-2.3.1.ez | Bin 151912 -> 151907 bytes .../rabbitmq_exchange/rabbitmqadmin.rb | 4 +- .../rabbitmq_plugin/rabbitmqplugins.rb | 16 +- .../provider/rabbitmq_user/rabbitmqctl.rb | 29 ++- .../rabbitmq/lib/puppet/type/rabbitmq_user.rb | 4 + .../modules/rabbitmq/manifests/config.pp | 4 + .../puppet/modules/rabbitmq/manifests/init.pp | 9 +- .../modules/rabbitmq/manifests/management.pp | 6 + .../modules/rabbitmq/manifests/params.pp | 2 + .../modules/rabbitmq/manifests/policy.pp | 15 ++ .../modules/rabbitmq/manifests/server.pp | 2 +- .../rabbitmq/spec/classes/rabbitmq_spec.rb | 57 ++++- .../rabbitmq_user/rabbitmqctl_spec.rb | 86 ++++++++ .../rabbitmq/templates/rabbitmq.config.erb | 7 +- .../puphpet/puppet/modules/sqlite/Modulefile | 13 ++ .../puphpet/puppet/modules/sqlite/README.md | 32 +++ .../puppet/modules/sqlite/manifests/db.pp | 44 ++++ .../puppet/modules/sqlite/manifests/init.pp | 16 ++ .../puppet/modules/sqlite/metadata.json | 12 + .../puppet/modules/sqlite/spec/spec.opts | 6 + .../puppet/modules/sqlite/spec/spec_helper.rb | 18 ++ .../puppet/modules/sqlite/tests/init.pp | 1 + .../coverage/assets/0.8.0/colorbox/border.png | Bin 163 -> 162 bytes .../assets/0.8.0/colorbox/controls.png | Bin 2033 -> 2032 bytes .../0.8.0/colorbox/loading_background.png | Bin 166 -> 165 bytes .../coverage/assets/0.8.0/favicon_green.png | Bin 1009 -> 1008 bytes .../coverage/assets/0.8.0/favicon_red.png | Bin 1009 -> 1008 bytes .../coverage/assets/0.8.0/favicon_yellow.png | Bin 1009 -> 1008 bytes .../facter/coverage/assets/0.8.0/magnify.png | Bin 1301 -> 1300 bytes .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 180 -> 179 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 178 -> 177 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 120 -> 119 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 105 -> 104 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 111 -> 110 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 110 -> 109 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 119 -> 118 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 101 -> 100 bytes .../images/ui-icons_222222_256x240.png | Bin 4369 -> 4367 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 4369 -> 4367 bytes .../images/ui-icons_454545_256x240.png | Bin 4369 -> 4367 bytes .../images/ui-icons_888888_256x240.png | Bin 4369 -> 4367 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 4369 -> 4367 bytes .../puppet/modules/supervisord/Changelog | 6 + .../puppet/modules/supervisord/Modulefile | 2 +- .../modules/supervisord/manifests/init.pp | 2 + .../modules/supervisord/manifests/install.pp | 2 +- .../modules/supervisord/manifests/params.pp | 43 ++-- .../modules/supervisord/manifests/pip.pp | 4 +- .../modules/supervisord/manifests/reload.pp | 8 +- .../supervisord/manifests/supervisorctl.pp | 4 +- .../templates/init/Debian/init.erb | 6 +- .../templates/init/RedHat/init.erb | 13 +- .../puphpet/shell/execute-files.sh | 7 +- .../puphpet/shell/hostsupdater-notice.txt | 4 + .../puphpet/shell/important-notices.sh | 10 +- .../puphpet/shell/initial-setup.sh | 134 ++++-------- .../puphpet/shell/install-puppet.sh | 35 +++ .../dolibarrdev/puphpet/shell/install-ruby.sh | 43 ++++ .../dolibarrdev/puphpet/shell/os-detect.sh | 58 ++--- dev/vagrant/dolibarrdev/puphpet/shell/r10k.sh | 23 -- .../puphpet/shell/update-puppet.sh | 43 ---- 119 files changed, 2723 insertions(+), 373 deletions(-) create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5 create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6 create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7 create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb create mode 100644 dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp create mode 100644 dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt create mode 100644 dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh create mode 100644 dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh delete mode 100644 dev/vagrant/dolibarrdev/puphpet/shell/r10k.sh delete mode 100644 dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh diff --git a/dev/vagrant/dolibarrdev/Vagrantfile b/dev/vagrant/dolibarrdev/Vagrantfile index 89c2c75a5b7..a0bcc88ced6 100644 --- a/dev/vagrant/dolibarrdev/Vagrantfile +++ b/dev/vagrant/dolibarrdev/Vagrantfile @@ -23,6 +23,47 @@ Vagrant.configure("2") do |config| end end + if Vagrant.has_plugin?('vagrant-hostsupdater') + hosts = Array.new() + + if !configValues['apache']['install'].nil? && + configValues['apache']['install'].to_i == 1 && + configValues['apache']['vhosts'].is_a?(Hash) + configValues['apache']['vhosts'].each do |i, vhost| + hosts.push(vhost['servername']) + + if vhost['serveraliases'].is_a?(Array) + vhost['serveraliases'].each do |vhost_alias| + hosts.push(vhost_alias) + end + end + end + elsif !configValues['nginx']['install'].nil? && + configValues['nginx']['install'].to_i == 1 && + configValues['nginx']['vhosts'].is_a?(Hash) + configValues['nginx']['vhosts'].each do |i, vhost| + hosts.push(vhost['server_name']) + + if vhost['server_aliases'].is_a?(Array) + vhost['server_aliases'].each do |x, vhost_alias| + hosts.push(vhost_alias) + end + end + end + end + + if hosts.any? + contents = File.open("#{dir}/puphpet/shell/hostsupdater-notice.txt", 'r'){ |file| file.read } + puts "\n\033[34m#{contents}\033[0m\n" + + if config.vm.hostname.to_s.strip.length == 0 + config.vm.hostname = 'puphpet-dev-machine' + end + + config.hostsupdater.aliases = hosts + end + end + data['vm']['synced_folder'].each do |i, folder| if folder['source'] != '' && folder['target'] != '' if folder['sync_type'] == 'nfs' @@ -53,6 +94,9 @@ Vagrant.configure("2") do |config| if key == "memory" next end + if key == "cpus" + next + end if key == "natdnshostresolver1" value = value ? "on" : "off" @@ -62,6 +106,7 @@ Vagrant.configure("2") do |config| end virtualbox.customize ["modifyvm", :id, "--memory", "#{data['vm']['memory']}"] + virtualbox.customize ["modifyvm", :id, "--cpus", "#{data['vm']['cpus']}"] if data['vm']['hostname'].to_s.strip.length != 0 virtualbox.customize ["modifyvm", :id, "--name", config.vm.hostname] @@ -77,11 +122,15 @@ Vagrant.configure("2") do |config| if key == "memsize" next end + if key == "cpus" + next + end v.vmx["#{key}"] = "#{value}" end v.vmx["memsize"] = "#{data['vm']['memory']}" + v.vmx["numvcpus"] = "#{data['vm']['cpus']}" if data['vm']['hostname'].to_s.strip.length != 0 v.vmx["displayName"] = config.vm.hostname @@ -97,11 +146,15 @@ Vagrant.configure("2") do |config| if key == "memsize" next end + if key == "cpus" + next + end v.customize ["set", :id, "--#{key}", "#{value}"] end v.memory = "#{data['vm']['memory']}" + v.cpus = "#{data['vm']['cpus']}" if data['vm']['hostname'].to_s.strip.length != 0 v.name = config.vm.hostname @@ -119,7 +172,8 @@ Vagrant.configure("2") do |config| kg.path = "puphpet/shell/ssh-keygen.sh" kg.args = "#{ssh_username}" end - config.vm.provision :shell, :path => "puphpet/shell/update-puppet.sh" + config.vm.provision :shell, :path => "puphpet/shell/install-ruby.sh" + config.vm.provision :shell, :path => "puphpet/shell/install-puppet.sh" config.vm.provision :puppet do |puppet| puppet.facter = { @@ -183,3 +237,4 @@ Vagrant.configure("2") do |config| end + diff --git a/dev/vagrant/dolibarrdev/puphpet/.gitattributes b/dev/vagrant/dolibarrdev/puphpet/.gitattributes index 93f9975f88e..5bb817f8e45 100644 --- a/dev/vagrant/dolibarrdev/puphpet/.gitattributes +++ b/dev/vagrant/dolibarrdev/puphpet/.gitattributes @@ -2,9 +2,4 @@ * text=auto # Force the following filetypes to have unix eols, so Windows does not break them -*.pp text eol=lf -*.sh text eol=lf -*.yaml text eol=lf -Puppetfile text eol=lf -.bash_aliases text eol=lf -.vimrc text eol=lf +*.* text eol=lf diff --git a/dev/vagrant/dolibarrdev/puphpet/config.yaml b/dev/vagrant/dolibarrdev/puphpet/config.yaml index c9c8440c87d..e88a3e13003 100644 --- a/dev/vagrant/dolibarrdev/puphpet/config.yaml +++ b/dev/vagrant/dolibarrdev/puphpet/config.yaml @@ -5,6 +5,7 @@ vagrantfile-local: box_url: puphpet/debian75-x64 hostname: null memory: '512' + cpus: '1' chosen_provider: virtualbox network: private_network: 192.168.42.101 @@ -29,7 +30,7 @@ vagrantfile-local: - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml' - '--parser future' synced_folder: - jopH6005bn96: + w6GqzzS2a7lu: source: ../../../ target: /var/www/dolibarr sync_type: default @@ -63,8 +64,7 @@ mailcatcher: smtp_port: 1025 http_ip: 0.0.0.0 http_port: '1080' - mailcatcher_path: /usr/local/bin - log_path: /var/log/mailcatcher/mailcatcher.log + mailcatcher_path: /usr/local/rvm/wrappers/default firewall: install: '1' rules: null @@ -81,7 +81,7 @@ apache: - php - rewrite vhosts: - b2tOrs1TMtoF: + syTi8VestVdG: servername: dev.dolibarr.org docroot: /var/www/dolibarr/htdocs port: '80' @@ -98,8 +98,12 @@ apache: mod_spdy: 0 nginx: install: 0 + settings: + default_vhost: 1 + proxy_buffer_size: 128k + proxy_buffers: '4 256k' vhosts: - 0dU5luf5AnIe: + kZiLLcLAIVAF: server_name: awesome.dev server_aliases: - www.awesome.dev @@ -154,7 +158,7 @@ mysql: root_password: root adminer: 0 databases: - V6H3W2FVB7Yq: + HHTBm64g1siG: grant: - ALTER - CREATE diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp index 6f560f8735f..ea27564f8c9 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp @@ -197,8 +197,8 @@ if is_array($server_values['packages']) and count($server_values['packages']) > } define add_dotdeb ($release){ - apt::source { $name: - location => 'http://packages.dotdeb.org', + apt::source { "${name}-repo.puphpet": + location => 'http://repo.puphpet.com/dotdeb/', release => $release, repos => 'all', required_packages => 'debian-keyring debian-archive-keyring', @@ -270,7 +270,7 @@ if hash_key_equals($mailcatcher_values, 'install', 1) { create_resources('class', { 'mailcatcher' => $mailcatcher_values['settings'] }) - if ! defined(Firewall["100 tcp/${mailcatcher_values['settings']['smtp_port']},${mailcatcher_values['settings']['http_port']}"]) { + if ! defined(Firewall["100 tcp/${mailcatcher_values['settings']['smtp_port']}, ${mailcatcher_values['settings']['http_port']}"]) { firewall { "100 tcp/${mailcatcher_values['settings']['smtp_port']}, ${mailcatcher_values['settings']['http_port']}": port => [$mailcatcher_values['settings']['smtp_port'], $mailcatcher_values['settings']['http_port']], proto => tcp, @@ -290,25 +290,28 @@ if hash_key_equals($mailcatcher_values, 'install', 1) { } } - $supervisord_mailcatcher_options = sort(join_keys_to_values({ + $mailcatcher_path = $mailcatcher_values['settings']['mailcatcher_path'] + + $mailcatcher_options = sort(join_keys_to_values({ ' --smtp-ip' => $mailcatcher_values['settings']['smtp_ip'], ' --smtp-port' => $mailcatcher_values['settings']['smtp_port'], ' --http-ip' => $mailcatcher_values['settings']['http_ip'], ' --http-port' => $mailcatcher_values['settings']['http_port'] }, ' ')) - $supervisord_mailcatcher_cmd = "mailcatcher ${supervisord_mailcatcher_options} -f >> ${mailcatcher_values['settings']['log']}" - supervisord::program { 'mailcatcher': - command => $supervisord_mailcatcher_cmd, + command => "${mailcatcher_path}/mailcatcher ${mailcatcher_options} -f", priority => '100', user => 'mailcatcher', autostart => true, autorestart => 'true', environment => { - 'PATH' => "/bin:/sbin:/usr/bin:/usr/sbin:${mailcatcher_values['settings']['path']}" + 'PATH' => "/bin:/sbin:/usr/bin:/usr/sbin:${mailcatcher_path}" }, - require => Package['mailcatcher'] + require => [ + Class['mailcatcher::config'], + File['/var/log/mailcatcher'] + ], } } @@ -318,10 +321,6 @@ if $firewall_values == undef { $firewall_values = hiera('firewall', false) } -resources { 'firewall': - purge => true -} - Firewall { before => Class['my_fw::post'], require => Class['my_fw::pre'], @@ -389,16 +388,15 @@ if hash_key_equals($apache_values, 'install', 1) { include puphpet::params include apache::params - $webroot_location = $puphpet::params::apache_webroot_location + $webroot_location = $puphpet::params::apache_webroot_location + $apache_provider_types = ['virtualbox', 'vmware_fusion', 'vmware_desktop', 'parallels'] exec { "exec mkdir -p ${webroot_location}": command => "mkdir -p ${webroot_location}", creates => $webroot_location, } - if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) - and ! defined(File[$webroot_location]) - { + if (downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$webroot_location]) { file { $webroot_location: ensure => directory, mode => 0775, @@ -407,11 +405,7 @@ if hash_key_equals($apache_values, 'install', 1) { Group['www-data'] ] } - } - - if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) - and ! defined(File[$webroot_location]) - { + } elsif ! (downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$webroot_location]) { file { $webroot_location: ensure => directory, group => 'www-data', @@ -441,8 +435,8 @@ if hash_key_equals($apache_values, 'install', 1) { } if $::operatingsystem == 'ubuntu' - and hash_key_equals($php_values, 'install', 1) - and hash_key_equals($php_values, 'version', 55) + and hash_key_equals($php_values, 'install', 1) + and hash_key_equals($php_values, 'version', 55) { $apache_version = '2.4' } else { @@ -496,7 +490,7 @@ if hash_key_equals($apache_values, 'install', 1) { creates => $vhost['docroot'], } - if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) + if (downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$vhost['docroot']]) { file { $vhost['docroot']: @@ -504,9 +498,7 @@ if hash_key_equals($apache_values, 'install', 1) { mode => 0765, require => Exec["exec mkdir -p ${vhost['docroot']} @ key ${key}"] } - } - - if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) + } elsif !(downcase($::provisioner_type) in $apache_provider_types) and ! defined(File[$vhost['docroot']]) { file { $vhost['docroot']: @@ -523,10 +515,10 @@ if hash_key_equals($apache_values, 'install', 1) { create_resources(apache::vhost, { "${key}" => merge($vhost, { 'custom_fragment' => template('puphpet/apache/custom_fragment.erb'), 'ssl' => 'ssl' in $vhost and str2bool($vhost['ssl']) ? { true => true, default => false }, - 'ssl_cert' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_cert'], default => undef }, - 'ssl_key' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_key'], default => undef }, - 'ssl_chain' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_chain'], default => undef }, - 'ssl_certs_dir' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_certs_dir'], default => undef } + 'ssl_cert' => hash_key_true($vhost, 'ssl_cert') ? { true => $vhost['ssl_cert'], default => undef }, + 'ssl_key' => hash_key_true($vhost, 'ssl_key') ? { true => $vhost['ssl_key'], default => undef }, + 'ssl_chain' => hash_key_true($vhost, 'ssl_chain') ? { true => $vhost['ssl_chain'], default => undef }, + 'ssl_certs_dir' => hash_key_true($vhost, 'ssl_certs_dir') ? { true => $vhost['ssl_certs_dir'], default => undef } }) }) @@ -585,33 +577,25 @@ if hash_key_equals($nginx_values, 'install', 1) { } } - $webroot_location = $puphpet::params::nginx_webroot_location + $webroot_location = $puphpet::params::nginx_webroot_location + $nginx_provider_types = ['virtualbox', 'vmware_fusion', 'vmware_desktop', 'parallels'] exec { "exec mkdir -p ${webroot_location}": command => "mkdir -p ${webroot_location}", creates => $webroot_location, } - if (downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) - and ! defined(File[$webroot_location]) - { + if (downcase($::provisioner_type) in $nginx_provider_types) and ! defined(File[$webroot_location]) { file { $webroot_location: ensure => directory, mode => 0775, - require => [ - Exec["exec mkdir -p ${webroot_location}"], - Group['www-data'] - ] + require => Exec["exec mkdir -p ${webroot_location}"], } - } - - if !(downcase($::provisioner_type) in ['virtualbox', 'vmware_fusion']) - and ! defined(File[$webroot_location]) - { + } elsif ! (downcase($::provisioner_type) in $nginx_provider_types) and ! defined(File[$webroot_location]) { file { $webroot_location: ensure => directory, - group => 'www-data', mode => 0775, + group => 'www-data', require => [ Exec["exec mkdir -p ${webroot_location}"], Group['www-data'] @@ -633,12 +617,10 @@ if hash_key_equals($nginx_values, 'install', 1) { if hash_key_equals($php_values, 'install', 1) { $php5_fpm_sock = '/var/run/php5-fpm.sock' - if $php_values['version'] == undef { - $fastcgi_pass = null - } elsif $php_values['version'] == '53' { - $fastcgi_pass = '127.0.0.1:9000' - } else { - $fastcgi_pass = "unix:${php5_fpm_sock}" + $fastcgi_pass = $php_values['version'] ? { + '53' => '127.0.0.1:9000', + undef => null, + default => "unix:${php5_fpm_sock}" } if $::osfamily == 'redhat' and $fastcgi_pass == "unix:${php5_fpm_sock}" { @@ -648,7 +630,7 @@ if hash_key_equals($nginx_values, 'install', 1) { require => Package['nginx'], } - exec { "listen = 127.0.0.1:9000 => listen = ${php5_fpm_sock}": + exec { "'listen = 127.0.0.1:9000' => 'listen = ${php5_fpm_sock}'": command => "perl -p -i -e 's#listen = 127.0.0.1:9000#listen = ${php5_fpm_sock}#gi' /etc/php-fpm.d/www.conf", unless => "grep -c 'listen = 127.0.0.1:9000' '${php5_fpm_sock}'", notify => [ @@ -658,25 +640,51 @@ if hash_key_equals($nginx_values, 'install', 1) { require => Exec["create ${php5_fpm_sock} file"] } - set_php5_fpm_sock_group_and_user { 'php_rhel': + set_nginx_php5_fpm_sock_group_and_user { 'php_rhel': require => Exec["create ${php5_fpm_sock} file"], } } else { - set_php5_fpm_sock_group_and_user { 'php': + set_nginx_php5_fpm_sock_group_and_user { 'php': require => Package['nginx'], subscribe => Service['php5-fpm'], } } } elsif hash_key_equals($hhvm_values, 'install', 1) { - $fastcgi_pass = '127.0.0.1:9000' + $fastcgi_pass = '127.0.0.1:9000' } else { - $fastcgi_pass = '' + $fastcgi_pass = null } class { 'nginx': } - if count($nginx_values['vhosts']) > 0 { - each( $nginx_values['vhosts'] ) |$key, $vhost| { + if hash_key_equals($nginx_values['settings'], 'default_vhost', 1) { + $nginx_vhosts = merge($nginx_values['vhosts'], { + 'default' => { + 'server_name' => '_', + 'server_aliases' => [], + 'www_root' => '/var/www/html', + 'listen_port' => 80, + 'index_files' => ['index', 'index.html', 'index.htm', 'index.php'], + 'envvars' => [], + 'ssl' => '0', + 'ssl_cert' => '', + 'ssl_key' => '', + }, + }) + + if ! defined(File[$puphpet::params::nginx_default_conf_location]) { + file { $puphpet::params::nginx_default_conf_location: + ensure => absent, + require => Package['nginx'], + notify => Class['nginx::service'], + } + } + } else { + $nginx_vhosts = $nginx_values['vhosts'] + } + + if count($nginx_vhosts) > 0 { + each( $nginx_vhosts ) |$key, $vhost| { exec { "exec mkdir -p ${vhost['www_root']} @ key ${key}": command => "mkdir -p ${vhost['www_root']}", creates => $vhost['www_root'], @@ -698,7 +706,7 @@ if hash_key_equals($nginx_values, 'install', 1) { } } - create_resources(nginx_vhost, $nginx_values['vhosts']) + create_resources(nginx_vhost, $nginx_vhosts) } if ! defined(Firewall['100 tcp/443']) { @@ -746,41 +754,12 @@ define nginx_vhost ( $fastcgi_param_parts = [] } - if $ssl == 0 or $ssl == false or $ssl == '' { - $ssl_set = false - } else { - $ssl_set = true - } - - if $ssl_cert == 0 or $ssl_cert == false or $ssl_cert == '' { - $ssl_cert_set = $puphpet::params::ssl_cert_location - } else { - $ssl_cert_set = $ssl_cert - } - - if $ssl_key == 0 or $ssl_key == false or $ssl_key == '' { - $ssl_key_set = $puphpet::params::ssl_key_location - } else { - $ssl_key_set = $ssl_key - } - - if $ssl_port == 0 or $ssl_port == false or $ssl_port == '' { - $ssl_port_set = '443' - } else { - $ssl_port_set = $ssl_port - } - - if $rewrite_to_https == 0 or $rewrite_to_https == false or $rewrite_to_https == '' { - $rewrite_to_https_set = false - } else { - $rewrite_to_https_set = true - } - - if $spdy == off or $spdy == 0 or $spdy == false or $spdy == '' { - $spdy_set = off - } else { - $spdy_set = on - } + $ssl_set = value_true($ssl) ? { true => true, default => false, } + $ssl_cert_set = value_true($ssl_cert) ? { true => $ssl_cert, default => $puphpet::params::ssl_cert_location, } + $ssl_key_set = value_true($ssl_key) ? { true => $ssl_key, default => $puphpet::params::ssl_key_location, } + $ssl_port_set = value_true($ssl_port) ? { true => $ssl_port, default => '443', } + $rewrite_to_https_set = value_true($rewrite_to_https) ? { true => true, default => false, } + $spdy_set = value_true($spdy) ? { true => on, default => off, } nginx::resource::vhost { $server_name: server_name => $merged_server_name, @@ -801,6 +780,19 @@ define nginx_vhost ( $fastcgi_param = concat($fastcgi_param_parts, $envvars) + $fastcgi_pass_hash = fastcgi_pass ? { + null => {}, + '' => {}, + default => {'fastcgi_pass' => $fastcgi_pass}, + } + + $location_cfg_append = merge({ + 'fastcgi_split_path_info' => '^(.+\.php)(/.+)$', + 'fastcgi_param' => $fastcgi_param, + 'fastcgi_index' => 'index.php', + 'include' => 'fastcgi_params' + }, $fastcgi_pass_hash) + nginx::resource::location { "${server_name}-php": ensure => present, vhost => $server_name, @@ -809,20 +801,17 @@ define nginx_vhost ( try_files => ['$uri', '$uri/', "/${try_files}?\$args"], ssl => $ssl_set, www_root => $www_root, - location_cfg_append => { - 'fastcgi_split_path_info' => '^(.+\.php)(/.+)$', - 'fastcgi_param' => $fastcgi_param, - 'fastcgi_pass' => $fastcgi_pass, - 'fastcgi_index' => 'index.php', - 'include' => 'fastcgi_params' - }, + location_cfg_append => $location_cfg_append, notify => Class['nginx::service'], } } -define set_php5_fpm_sock_group_and_user (){ +define set_nginx_php5_fpm_sock_group_and_user () { exec { 'set php5_fpm_sock group and user': - command => "chmod 660 ${php5_fpm_sock} && chown www-data ${php5_fpm_sock} && chgrp www-data ${php5_fpm_sock} && touch /.puphpet-stuff/php5_fpm_sock", + command => "chmod 660 ${php5_fpm_sock} && \ + chown www-data ${php5_fpm_sock} && \ + chgrp www-data ${php5_fpm_sock} && \ + touch /.puphpet-stuff/php5_fpm_sock", creates => '/.puphpet-stuff/php5_fpm_sock', } } @@ -1001,7 +990,7 @@ if hash_key_equals($php_values, 'install', 1) { { puphpet::ini { 'sendmail_path': entry => 'CUSTOM/sendmail_path', - value => '/usr/bin/env catchmail', + value => "${mailcatcher_values['settings']['mailcatcher_path']}/catchmail -f", php_version => $php_values['version'], webserver => $php_webserver_service_ini } @@ -1727,6 +1716,11 @@ if hash_key_equals($apache_values, 'install', 1) } if hash_key_equals($rabbitmq_values, 'install', 1) { + if $::osfamily == 'redhat' { + Class['erlang'] -> Class['rabbitmq'] + include 'erlang' + } + create_resources('class', { 'rabbitmq' => $rabbitmq_values['settings'] }) if hash_key_equals($php_values, 'install', 1) and ! defined(Php::Pecl::Module['amqp']) { diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile new file mode 100644 index 00000000000..95c7a5dd0b0 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Gemfile @@ -0,0 +1,15 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'rake', :require => false + gem 'rspec-puppet', :require => false + gem 'puppetlabs_spec_helper', :require => false + gem 'puppet-lint', :require => false + gem 'rspec-system-puppet', '~>2.0.0' +end + +if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false +else + gem 'puppet', :require => false +end \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE new file mode 100644 index 00000000000..009b66b6cc2 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/LICENSE @@ -0,0 +1,13 @@ +Copyright 2012-2014 Michael Stahnke + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile new file mode 100644 index 00000000000..237d164011a --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Modulefile @@ -0,0 +1,8 @@ +name 'stahnma-epel' +version '0.1.0' +source 'http://github.com/stahnma/puppet-module-epel' +author 'stahnma' +license 'Apache License, Version 2.0' +summary 'Setup the EPEL package repo' +description 'Setup the EPEL package repo on Centos/RHEL et all' +project_page 'http://github.com/stahnma/puppet-module-epel' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md new file mode 100644 index 00000000000..33b87278574 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/README.md @@ -0,0 +1,90 @@ +# Configure EPEL (Extra Repository for Enterprise Linux) + +# About +This module basically just mimics the epel-release rpm. The same repos are +enabled/disabled and the GPG key is imported. In the end you will end up with +the EPEL repos configured. + +The following Repos will be setup and enabled by default: + + * epel + +Other repositories that will setup but disabled (as per the epel-release setup) + + * epel-debuginfo + * epel-source + * epel-testing + * epel-testing-debuginfo + * epel-testing-source + +# Proxy +If you have an http proxy required to access the internet, you can use either +a class parameter in the _epel_ class, or edit the $proxy variable in the +params.pp file. By default no proxy is assumed. + +# Why? +I am a big fan of EPEL. I actually was one of the people who helped get it +going. I am also the owner of the epel-release package, so in general this +module should stay fairly up to date with the official upstream package. + +I just got sick of coding Puppet modules and basically having an assumption +that EPEL was setup or installed. I can now depend on this module instead. + +I realize it is fairly trivial to get EPEL setup. Every now-and-then however +the path to epel-release changes because something changes in the package (mass +rebuild, rpm build macros updates, etc). This module will bypass the changing +URL and just setup the package mirrors. + +This does mean that if you are looking for RPM macros that are normally +included with EPEL release, this will not have them. + +# Futher Information + +* [EPEL Wiki](http://fedoraproject.org/wiki/EPEL) +* [epel-release package information](http://mirrors.servercentral.net/fedora/epel/6/i386/repoview/epel-release.html) + +# Testing + +* This is commonly used on Puppet Enterprise 3.x +* This was tested using Puppet 3.3.0 on Centos5/6 +* This was tested using Puppet 3.1.1 on Amazon's AWS Linux +* I assume it will work on any RHEL variant (Amazon Linux is debatable as a variant) + +# Lifecycle +* No functionality has been introduced that should break Puppet 2.6 or 2.7, but I am no longer testing these versions of Puppet as they are end-of-lifed from Puppet Labs. + +## Unit tests + +Install the necessary gems + + bundle install + +Run the RSpec and puppet-lint tests + + bundle exec rake ci + +## System tests + +If you have Vagrant >=1.1.0 you can also run system tests: + + RSPEC_SET=centos-64-x64 bundle exec rake spec:system + +Available RSPEC_SET options are in .nodeset.yml + +# License +Apache Software License 2.0 + +# Author/Contributors + * Chad Metcalf + * Joseph Swick + * Matthaus Owens + * Michael Stahnke + * Michael Stahnke + * Pro Cabales + * Proletaryo Cabales + * Stefan Goethals + * Tim Rupp + * Trey Dockendorf + * Troy Bollinger + * Vlastimil Holer + * Ewoud Kohl van Wijngaarden diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile new file mode 100644 index 00000000000..5a71d17767d --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/Rakefile @@ -0,0 +1,17 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'rspec-system/rake_task' + +task :default do + sh %{rake -T} +end + +# Disable specific puppet-lint checks +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.send("disable_class_inherits_from_params_class") + +desc "Run rspec-puppet and puppet-lint tasks" +task :ci => [ + :lint, + :spec, +] diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5 new file mode 100644 index 00000000000..5a13bb4f9f9 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-5 @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.6 (GNU/Linux) + +mQGiBEXopTIRBACZDBMOoFOakAjaxw1LXjeSvh/kmE35fU1rXfM7T0AV31NATCLF +l5CQiNDA4oWreDThg2Bf6+LIVTsGQb1V+XXuLak4Em5yTYwMTVB//4/nMxQEbpl/ +QB2XwlJ7EQ0vW+kiPDz/7pHJz1p1jADzd9sQQicMtzysS4qT2i5A23j0VwCg1PB/ +lpYqo0ZhWTrevxKMa1n34FcD/REavj0hSLQFTaKNLHRotRTF8V0BajjSaTkUT4uk +/RTaZ8Kr1mTosVtosqmdIAA2XHxi8ZLiVPPSezJjfElsSqOAxEKPL0djfpp2wrTm +l/1iVnX+PZH5DRKCbjdCMLDJhYap7YUhcPsMGSeUKrwmBCBJUPc6DhjFvyhA9IMl +1T0+A/9SKTv94ToP/JYoCTHTgnG5MoVNafisfe0wojP2mWU4gRk8X4dNGKMj6lic +vM6gne3hESyjcqZSmr7yELPPGhI9MNauJ6Ob8cTR2T12Fmv9w03DD3MnBstR6vhP +QcqZKhc5SJYYY7oVfxlSOfF4xfwcHQKoD5TOKwIAQ6T8jyFpKbQkRmVkb3JhIEVQ +RUwgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iGQEExECACQFAkXopTICGwMFCRLM +AwAGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQEZzANiF1IfabmQCgzvE60MnHSOBa +ZXXF7uU2Vzu8EOkAoKg9h+j0NuNom6WUYZyJQt4zc5seuQINBEXopTYQCADapnR/ +blrJ8FhlgNPl0X9S3JE/kygPbNXIqne4XBVYisVp0uzNCRUxNZq30MpY027JCs2J +nL2fMpwvx33f0phU029vrIZKA3CmnnwVsjcWfMJOVPBmVN7m5bGU68F+PdRIcDsl +PMOWRLkTBZOGolLgIbM4719fqA8etewILrX6uPvRDwywV7/sPCFpRcfNNBUY+Zx3 +5bf4fnkaCKxgXgQS3AT+hGYhlzIqQVTkGNveHTnt4SSzgAqR9sSwQwqvEfVtYNeS +w5rDguLG41HQm1Hojv59HNYjH6F/S1rClZi21bLgZbKpCFX76qPt8CTw+iQLBPPd +yoOGHfzyp7nsfhUrAAMFB/9/H9Gpk822ZpBexQW4y3LGFo9ZSnmu+ueOZPU3SqDA +DW1ovZdYzGuJTGGM9oMl6bL8eZrcUBBOFaWge5wZczIE3hx2exEOkDdvq+MUDVD1 +axmN45q/7h1NYRp5GQL2ZsoV4g9U2gMdzHOFtZCER6PP9ErVlfJpgBUCdSL93V4H +Sgpkk7znmTOklbCM6l/G/A6q4sCRqfzHwVSTiruyTBiU9lfROsAl8fjIq2OzWJ2T +P9sadBe1llUYaow7txYSUxssW+89avct35gIyrBbof5M+CBXyAOUaSWmpM2eub24 +0qbqiSr/Y6Om0t6vSzR8gRk7g+1H6IE0Tt1IJCvCAMimiE8EGBECAA8FAkXopTYC +GwwFCRLMAwAACgkQEZzANiF1IfZQYgCgiZHCv4xb+sTHCn/otc1Ovvi/OgMAnRXY +bbsLFWOfmzAnNIGvFRWy+YHi +=MMNL +-----END PGP PUBLIC KEY BLOCK----- diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6 new file mode 100644 index 00000000000..7a2030489d2 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-6 @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 +JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B +M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn +XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 +pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV +QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp +Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq +3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu +vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar +1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g +YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB +tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS +KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9 +qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT +9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP +Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS +WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft +HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF +p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP +x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8 +wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J +l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG +iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR +XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ== +=V/6I +-----END PGP PUBLIC KEY BLOCK----- diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7 b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7 new file mode 100644 index 00000000000..f205ede4637 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/files/RPM-GPG-KEY-EPEL-7 @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.11 (GNU/Linux) + +mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB +OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm +jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP +vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM +jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 +S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ +n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB +9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 +T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj +GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf +uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB +tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB +AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk +5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q +ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu +MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re +9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax +CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv +HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB +VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q +thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc +ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 +vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt +RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== +=hdPa +-----END PGP PUBLIC KEY BLOCK----- diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb new file mode 100644 index 00000000000..ba5cb84043e --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/lib/facter/os_maj_version.rb @@ -0,0 +1,11 @@ +# This is a simple fact to get the Major version of an OS without having to +# have the entire LSB suite installed. LSB seems to pull in about 300 megs of +# stuff I often don't require. This fact is quick to load so it shouldn't be +# much of an issue. + +Facter.add(:os_maj_version) do + setcode do + v = Facter.value(:operatingsystemrelease) + v.split('.')[0].strip + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp new file mode 100644 index 00000000000..f9f4be114a6 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/init.pp @@ -0,0 +1,135 @@ +# Class epel +# +# Actions: +# Configure the proper repositories and import GPG keys +# +# Reqiures: +# You should probably be on an Enterprise Linux variant. (Centos, RHEL, +# Scientific, Oracle, Ascendos, et al) +# +# Sample Usage: +# include epel +# +class epel ( + $epel_mirrorlist = $epel::params::epel_mirrorlist, + $epel_baseurl = $epel::params::epel_baseurl, + $epel_failovermethod = $epel::params::epel_failovermethod, + $epel_proxy = $epel::params::epel_proxy, + $epel_enabled = $epel::params::epel_enabled, + $epel_gpgcheck = $epel::params::epel_gpgcheck, + $epel_testing_baseurl = $epel::params::epel_testing_baseurl, + $epel_testing_failovermethod = $epel::params::epel_testing_failovermethod, + $epel_testing_proxy = $epel::params::epel_testing_proxy, + $epel_testing_enabled = $epel::params::epel_testing_enabled, + $epel_testing_gpgcheck = $epel::params::epel_testing_gpgcheck, + $epel_source_mirrorlist = $epel::params::epel_source_mirrorlist, + $epel_source_baseurl = $epel::params::epel_source_baseurl, + $epel_source_failovermethod = $epel::params::epel_source_failovermethod, + $epel_source_proxy = $epel::params::epel_source_proxy, + $epel_source_enabled = $epel::params::epel_source_enabled, + $epel_source_gpgcheck = $epel::params::epel_source_gpgcheck, + $epel_debuginfo_mirrorlist = $epel::params::epel_debuginfo_mirrorlist, + $epel_debuginfo_baseurl = $epel::params::epel_debuginfo_baseurl, + $epel_debuginfo_failovermethod = $epel::params::epel_debuginfo_failovermethod, + $epel_debuginfo_proxy = $epel::params::epel_debuginfo_proxy, + $epel_debuginfo_enabled = $epel::params::epel_debuginfo_enabled, + $epel_debuginfo_gpgcheck = $epel::params::epel_debuginfo_gpgcheck, + $epel_testing_source_baseurl = $epel::params::epel_testing_source_baseurl, + $epel_testing_source_failovermethod = $epel::params::epel_testing_source_failovermethod, + $epel_testing_source_proxy = $epel::params::epel_testing_source_proxy, + $epel_testing_source_enabled = $epel::params::epel_testing_source_enabled, + $epel_testing_source_gpgcheck = $epel::params::epel_testing_source_gpgcheck, + $epel_testing_debuginfo_baseurl = $epel::params::epel_testing_debuginfo_baseurl, + $epel_testing_debuginfo_failovermethod = $epel::params::epel_testing_debuginfo_failovermethod, + $epel_testing_debuginfo_proxy = $epel::params::epel_testing_debuginfo_proxy, + $epel_testing_debuginfo_enabled = $epel::params::epel_testing_debuginfo_enabled, + $epel_testing_debuginfo_gpgcheck = $epel::params::epel_testing_debuginfo_gpgcheck +) inherits epel::params { + + if $::osfamily == 'RedHat' and $::operatingsystem !~ /Fedora|Amazon/ { + yumrepo { 'epel-testing': + baseurl => $epel_testing_baseurl, + failovermethod => $epel_testing_failovermethod, + proxy => $epel_testing_proxy, + enabled => $epel_testing_enabled, + gpgcheck => $epel_testing_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch ", + } + + yumrepo { 'epel-testing-debuginfo': + baseurl => $epel_testing_debuginfo_baseurl, + failovermethod => $epel_testing_debuginfo_failovermethod, + proxy => $epel_testing_debuginfo_proxy, + enabled => $epel_testing_debuginfo_enabled, + gpgcheck => $epel_testing_debuginfo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch - Debug", + } + + yumrepo { 'epel-testing-source': + baseurl => $epel_testing_source_baseurl, + failovermethod => $epel_testing_source_failovermethod, + proxy => $epel_testing_source_proxy, + enabled => $epel_testing_source_enabled, + gpgcheck => $epel_testing_source_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - Testing - \$basearch - Source", + } + + yumrepo { 'epel': + mirrorlist => $epel_mirrorlist, + baseurl => $epel_baseurl, + failovermethod => $epel_failovermethod, + proxy => $epel_proxy, + enabled => $epel_enabled, + gpgcheck => $epel_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch", + } + + yumrepo { 'epel-debuginfo': + mirrorlist => $epel_debuginfo_mirrorlist, + baseurl => $epel_debuginfo_baseurl, + failovermethod => $epel_debuginfo_failovermethod, + proxy => $epel_debuginfo_proxy, + enabled => $epel_debuginfo_enabled, + gpgcheck => $epel_debuginfo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch - Debug", + } + + yumrepo { 'epel-source': + mirrorlist => $epel_source_mirrorlist, + baseurl => $epel_source_baseurl, + failovermethod => $epel_source_failovermethod, + proxy => $epel_source_proxy, + enabled => $epel_source_enabled, + gpgcheck => $epel_source_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + descr => "Extra Packages for Enterprise Linux ${::os_maj_version} - \$basearch - Source", + } + + file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}": + ensure => present, + owner => 'root', + group => 'root', + mode => '0644', + source => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-${::os_maj_version}", + } + + epel::rpm_gpg_key{ "EPEL-${::os_maj_version}": + path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${::os_maj_version}", + before => Yumrepo['epel','epel-source','epel-debuginfo','epel-testing','epel-testing-source','epel-testing-debuginfo'], + } + + } elsif $::osfamily == 'RedHat' and $::operatingsystem == 'Amazon' { + yumrepo { 'epel': + enabled => $epel_enabled, + gpgcheck => $epel_gpgcheck, + } + } else { + notice ("Your operating system ${::operatingsystem} will not have the EPEL repository applied") + } + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp new file mode 100644 index 00000000000..0939de9045a --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/params.pp @@ -0,0 +1,45 @@ +# Optional parameters in setting up EPEL +class epel::params { + # Setting to 'absent' will fall back to the yum.conf + # Setting proxy here will be the default for all repos. + # + # If you wish to set a proxy for an individual set of repos, + # you can declare $proxy in that class, and should scope to + # the most specific declaration of proxy. + $proxy = 'absent' + + $epel_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-${::os_maj_version}&arch=\$basearch" + $epel_baseurl = 'absent' + $epel_failovermethod = 'priority' + $epel_proxy = $proxy + $epel_enabled = '1' + $epel_gpgcheck = '1' + $epel_testing_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/\$basearch" + $epel_testing_failovermethod = 'priority' + $epel_testing_proxy = $proxy + $epel_testing_enabled = '0' + $epel_testing_gpgcheck = '1' + $epel_source_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-${::os_maj_version}&arch=\$basearch" + $epel_source_baseurl = 'absent' + $epel_source_failovermethod = 'priority' + $epel_source_proxy = $proxy + $epel_source_enabled = '0' + $epel_source_gpgcheck = '1' + $epel_debuginfo_mirrorlist = "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-${::os_maj_version}&arch=\$basearch" + $epel_debuginfo_baseurl = 'absent' + $epel_debuginfo_failovermethod = 'priority' + $epel_debuginfo_proxy = $proxy + $epel_debuginfo_enabled = '0' + $epel_debuginfo_gpgcheck = '1' + $epel_testing_source_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/SRPMS" + $epel_testing_source_failovermethod = 'priority' + $epel_testing_source_proxy = $proxy + $epel_testing_source_enabled = '0' + $epel_testing_source_gpgcheck = '1' + $epel_testing_debuginfo_baseurl = "http://download.fedoraproject.org/pub/epel/testing/${::os_maj_version}/\$basearch/debug" + $epel_testing_debuginfo_failovermethod = 'priority' + $epel_testing_debuginfo_proxy = $proxy + $epel_testing_debuginfo_enabled = '0' + $epel_testing_debuginfo_gpgcheck = '1' + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp new file mode 100644 index 00000000000..ee0604dbbf9 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/manifests/rpm_gpg_key.pp @@ -0,0 +1,28 @@ +# Define epel::rpm_gpg_key +# +# Actions: +# Import a RPM gpg key +# +# Parameters: +# +# [*path*] +# Path of the RPM GPG key to import +# +# Reqiures: +# You should probably be on an Enterprise Linux variant. (Centos, RHEL, Scientific, Oracle, Ascendos, et al) +# +# Sample Usage: +# epel::rpm_gpg_key{ "EPEL-6": +# path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" +# } +# +define epel::rpm_gpg_key($path) { + # Given the path to a key, see if it is imported, if not, import it + exec { "import-${name}": + path => '/bin:/usr/bin:/sbin:/usr/sbin', + command => "rpm --import ${path}", + unless => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < ${path}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", + require => File[$path], + logoutput => 'on_failure', + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json new file mode 100644 index 00000000000..ba8770e8b69 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/metadata.json @@ -0,0 +1,45 @@ +{ + "name": "stahnma-epel", + "version": "0.1.0", + "source": "http://github.com/stahnma/puppet-module-epel", + "author": "stahnma", + "license": "Apache License, Version 2.0", + "summary": "Setup the EPEL package repo", + "description": "Setup the EPEL package repo on Centos/RHEL et all", + "project_page": "http://github.com/stahnma/puppet-module-epel", + "dependencies": [ + + ], + "types": [ + + ], + "checksums": { + "Gemfile": "3189476f30a99858b367d955298fe469", + "LICENSE": "94f0b1430ad7e59227ccabf8232f81d5", + "Modulefile": "250a4370b189d3f2e68ffd359ee02bb5", + "README.md": "6b4c4d2e7f0f9c1b6197529fa1120c88", + "Rakefile": "946eced163d7f8e0da85bda4baa7fa9c", + "files/RPM-GPG-KEY-EPEL-5": "0466c259781def56dafe0a2cdc9de0c5", + "files/RPM-GPG-KEY-EPEL-6": "d865e6b948a74cb03bc3401c0b01b785", + "files/RPM-GPG-KEY-EPEL-7": "58fa8ae27c89f37b08429f04fd4a88cc", + "lib/facter/os_maj_version.rb": "806fb856251b605df379e973c716a41c", + "manifests/init.pp": "61856de8db1eb00700e0a9a93aea506f", + "manifests/params.pp": "4fb2e283b4ba6e41abd7a914bdd001b8", + "manifests/rpm_gpg_key.pp": "69086f12752a14b200e462afaa59a93c", + "spec/classes/epel_spec.rb": "7e8e5973fdccb866e91ed00a3fd0af4c", + "spec/classes/shared_base.rb": "a6a46eb7225a1814b9343f32190ba75b", + "spec/classes/shared_debuginfo.rb": "1bd23934bc1f7d14d2491c7741f10299", + "spec/classes/shared_gpgkey.rb": "38a62fe24acfc9cc8d740d242c9f1c85", + "spec/classes/shared_source.rb": "6581989ed1ca2edd589ed98ecb08bdfa", + "spec/classes/shared_testing.rb": "50e936b9cf241c9849cf551961492532", + "spec/classes/shared_testing_debuginfo.rb": "41e8a2215d347246ff241f1b3a819c91", + "spec/classes/shared_testing_source.rb": "8cd827b2cb0b08b1633d70784417f946", + "spec/defines/rpm_gpg_key_spec.rb": "489fa716eaa2aba013089a6cf552c5a6", + "spec/spec_helper.rb": "a5ad64bd67aa3fe2512fa7ba505c8e8b", + "spec/spec_helper_system.rb": "d24a7ffdf4b67dbbd3ef5687292f51cf", + "spec/system/basic_spec.rb": "bc475b95f390134b31d905590bf8b039", + "spec/system/usage_spec.rb": "04506df5627ecbe975acd1fd0407ae40", + "spec/unit/facter/os_maj_version_spec.rb": "67ab2730991d4a8430f1115aad46bcea", + "tests/init.pp": "7c69b7adf2ba141cb62cfc9e0704d59e" + } +} \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb new file mode 100644 index 00000000000..5d95a61a5f7 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/epel_spec.rb @@ -0,0 +1,80 @@ +require 'spec_helper' +require 'classes/shared_gpgkey' +require 'classes/shared_base' +require 'classes/shared_source' +require 'classes/shared_debuginfo' +require 'classes/shared_testing' +require 'classes/shared_testing_source' +require 'classes/shared_testing_debuginfo' + +describe 'epel' do + it { should create_class('epel') } + it { should contain_class('epel::params') } + + context "operatingsystem => #{default_facts[:operatingsystem]}" do + context 'os_maj_version => 6' do + include_context :base_6 + include_context :gpgkey_6 + include_context :epel_source_6 + include_context :epel_debuginfo_6 + include_context :epel_testing_6 + include_context :epel_testing_source_6 + include_context :epel_testing_debuginfo_6 + + let :facts do + default_facts.merge({ + :operatingsystemrelease => '6.4', + :os_maj_version => '6', + }) + end + + context 'epel_baseurl => http://example.com/epel/6/x86_64' do + let(:params) {{ :epel_baseurl => "http://example.com/epel/6/x86_64" }} + it { should contain_yumrepo('epel').with('baseurl' => 'http://example.com/epel/6/x86_64') } + end + + context 'epel_mirrorlist => absent' do + let(:params) {{ :epel_mirrorlist => 'absent' }} + it { should contain_yumrepo('epel').with('mirrorlist' => 'absent') } + end + end + + context 'os_maj_version => 5' do + include_context :base_5 + include_context :gpgkey_5 + include_context :epel_source_5 + include_context :epel_debuginfo_5 + include_context :epel_testing_5 + include_context :epel_testing_source_5 + include_context :epel_testing_debuginfo_5 + + let :facts do + default_facts.merge({ + :operatingsystemrelease => '5.9', + :os_maj_version => '5', + }) + end + end + end + + context 'operatingsystem => Amazon' do + let :facts do + default_facts.merge({ + :operatingsystem => 'Amazon', + }) + end + + it { should_not contain_yumrepo('epel-testing') } + it { should_not contain_yumrepo('epel-testing-debuginfo') } + it { should_not contain_yumrepo('epel-testing-source') } + it { should_not contain_yumrepo('epel-debuginfo') } + it { should_not contain_yumrepo('epel-source') } + + it do + should contain_yumrepo('epel').with({ + 'enabled' => '1', + 'gpgcheck' => '1', + }) + end + end +end \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb new file mode 100644 index 00000000000..89b3c58cca7 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_base.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :base do + it do + should contain_yumrepo('epel').with({ + 'failovermethod' => 'priority', + 'proxy' => 'absent', + 'enabled' => '1', + 'gpgcheck' => '1', + }) + end +end + +shared_context :base_6 do + include_context :base + + it do + should contain_yumrepo('epel').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch", + }) + end +end + +shared_context :base_5 do + include_context :base + + it do + should contain_yumrepo('epel').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb new file mode 100644 index 00000000000..d47934d1425 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_debuginfo.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :epel_debuginfo do + it do + should contain_yumrepo('epel-debuginfo').with({ + 'proxy' => 'absent', + 'failovermethod' => 'priority', + 'enabled' => '0', + 'gpgcheck' => '1', + }) + end +end + +shared_context :epel_debuginfo_6 do + include_context :epel_debuginfo + + it do + should contain_yumrepo('epel-debuginfo').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-6&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch - Debug", + }) + end +end + +shared_context :epel_debuginfo_5 do + include_context :epel_debuginfo + + it do + should contain_yumrepo('epel-debuginfo').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch - Debug", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb new file mode 100644 index 00000000000..8b79c8cdd7f --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_gpgkey.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +shared_context :gpgkey_6 do + it do + should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6").with({ + 'ensure' => 'present', + 'owner' => 'root', + 'group' => 'root', + 'mode' => '0644', + 'source' => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-6", + }) + end + + it do + should contain_epel__rpm_gpg_key("EPEL-6").with({ + 'path' => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" + }) + end +end + +shared_context :gpgkey_5 do + it do + should contain_file("/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5").with({ + 'ensure' => 'present', + 'owner' => 'root', + 'group' => 'root', + 'mode' => '0644', + 'source' => "puppet:///modules/epel/RPM-GPG-KEY-EPEL-5", + }) + end + + it do + should contain_epel__rpm_gpg_key("EPEL-5").with({ + 'path' => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5" + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb new file mode 100644 index 00000000000..c371465ba91 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_source.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :epel_source do + it do + should contain_yumrepo('epel-source').with({ + 'proxy' => 'absent', + 'failovermethod' => 'priority', + 'enabled' => '0', + 'gpgcheck' => '1', + }) + end +end + +shared_context :epel_source_6 do + include_context :epel_source + + it do + should contain_yumrepo('epel-source').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-6&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - $basearch - Source", + }) + end +end + +shared_context :epel_source_5 do + include_context :epel_source + + it do + should contain_yumrepo('epel-source').with({ + 'mirrorlist' => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - $basearch - Source", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb new file mode 100644 index 00000000000..d560edb6e0a --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :epel_testing do + it do + should contain_yumrepo('epel-testing').with({ + 'failovermethod' => 'priority', + 'proxy' => 'absent', + 'enabled' => '0', + 'gpgcheck' => '1', + }) + end +end + +shared_context :epel_testing_6 do + include_context :epel_testing + + it do + should contain_yumrepo('epel-testing').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch ", + }) + end +end + +shared_context :epel_testing_5 do + include_context :epel_testing + + it do + should contain_yumrepo('epel-testing').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/$basearch", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch ", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb new file mode 100644 index 00000000000..62f647d3790 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_debuginfo.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :epel_testing_debuginfo do + it do + should contain_yumrepo('epel-testing-debuginfo').with({ + 'failovermethod' => 'priority', + 'proxy' => 'absent', + 'enabled' => '0', + 'gpgcheck' => '1', + }) + end +end + +shared_context :epel_testing_debuginfo_6 do + include_context :epel_testing_debuginfo + + it do + should contain_yumrepo('epel-testing-debuginfo').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug", + }) + end +end + +shared_context :epel_testing_debuginfo_5 do + include_context :epel_testing_debuginfo + + it do + should contain_yumrepo('epel-testing-debuginfo').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/$basearch/debug", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb new file mode 100644 index 00000000000..1a7e0a6ae83 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/classes/shared_testing_source.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +shared_context :epel_testing_source do + it do + should contain_yumrepo('epel-testing-source').with({ + 'failovermethod' => 'priority', + 'proxy' => 'absent', + 'enabled' => '0', + 'gpgcheck' => '1', + }) + end +end + +shared_context :epel_testing_source_6 do + include_context :epel_testing_source + + it do + should contain_yumrepo('epel-testing-source').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/6/SRPMS", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6", + 'descr' => "Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source", + }) + end +end + +shared_context :epel_testing_source_5 do + include_context :epel_testing_source + + it do + should contain_yumrepo('epel-testing-source').with({ + 'baseurl' => "http://download.fedoraproject.org/pub/epel/testing/5/SRPMS", + 'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5", + 'descr' => "Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source", + }) + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb new file mode 100644 index 00000000000..63cfe08ff94 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/defines/rpm_gpg_key_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe 'epel::rpm_gpg_key' do + context 'os_maj_version => 6' do + let :facts do + default_facts.merge({ + :operatingsystemrelease => '6.4', + :os_maj_version => '6', + }) + end + + let :title do + 'EPEL-6' + end + + let :params do + { :path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" } + end + + it do + should contain_exec("import-#{title}").with({ + 'path' => '/bin:/usr/bin:/sbin:/usr/sbin', + 'command' => "rpm --import #{params[:path]}", + 'unless' => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", + 'require' => "File[#{params[:path]}]", + 'logoutput' => 'on_failure', + }) + end + end + + context 'os_maj_version => 5' do + let :facts do + default_facts.merge({ + :operatingsystemrelease => '5.9', + :os_maj_version => '5', + }) + end + + let :title do + 'EPEL-5' + end + + let :params do + { :path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5" } + end + + it do + should contain_exec("import-#{title}").with({ + 'path' => '/bin:/usr/bin:/sbin:/usr/sbin', + 'command' => "rpm --import #{params[:path]}", + 'unless' => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", + 'require' => "File[#{params[:path]}]", + 'logoutput' => 'on_failure', + }) + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb new file mode 100644 index 00000000000..eafe6b60012 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper.rb @@ -0,0 +1,8 @@ +require 'puppetlabs_spec_helper/module_spec_helper' + +def default_facts + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + } +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb new file mode 100644 index 00000000000..cf680367b94 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/spec_helper_system.rb @@ -0,0 +1,23 @@ +require 'rspec-system/spec_helper' +require 'rspec-system-puppet/helpers' + +include RSpecSystemPuppet::Helpers + +RSpec.configure do |c| + # Project root for the this module's code + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + + # Enable colour in Jenkins + c.tty = true + + c.include RSpecSystemPuppet::Helpers + + # This is where we 'setup' the nodes before running our tests + c.before :suite do + # Install puppet + puppet_install + puppet_master_install + + puppet_module_install(:source => proj_root, :module_name => 'epel') + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb new file mode 100644 index 00000000000..569e12d3737 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/basic_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper_system' + +describe 'epel class:' do + context puppet_agent do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + end + + # Verify the os_maj_version fact is working + context shell 'facter --puppet os_maj_version' do + its(:stdout) { should_not be_empty } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + + pp = "class { 'epel': }" + + context puppet_apply pp do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + + context 'test EPEL repo presence' do + facts = node.facts + + # Only test for EPEL's presence if not Fedora + if facts['operatingsystem'] !~ /Fedora/ + context shell '/usr/bin/yum-config-manager epel | grep -q "\[epel\]"' do + its(:exit_code) { should be_zero } + end + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb new file mode 100644 index 00000000000..2b0d8f36e28 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/system/usage_spec.rb @@ -0,0 +1,60 @@ +require 'spec_helper_system' + +describe 'standage usage tests:' do + context 'test epel baseurl and mirrorlist' do + facts = node.facts + os_maj_version = facts['operatingsystemrelease'].split('.')[0] + pp = <<-EOS + class { 'epel': + epel_baseurl => 'http://dl.fedoraproject.org/pub/epel/#{os_maj_version}/x86_64/', + epel_mirrorlist => 'absent', + } + EOS + + context puppet_apply pp do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + + # Only test for EPEL's presence if not Fedora + if facts['operatingsystem'] !~ /Fedora/ + # Test the yum config to ensure mirrorlist was emptied + context shell '/usr/bin/yum-config-manager epel | egrep "^mirrorlist ="' do + its(:stdout) { should =~ /mirrorlist =\s+/ } + end + + # Test the yum config to ensure baseurl was defined + context shell '/usr/bin/yum-config-manager epel | egrep "^baseurl ="' do + its(:stdout) { should =~ /baseurl = http:\/\/dl.fedoraproject.org\/pub\/epel\/#{os_maj_version}\/x86_64\// } + end + end + end + + context 'test epel-testing is enabled' do + facts = node.facts + pp = <<-EOS + class { 'epel': + epel_testing_enabled => '1', + } + EOS + + context puppet_apply pp do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + + # Only test for EPEL's presence if not Fedora + if facts['operatingsystem'] !~ /Fedora/ + # Test the yum config to ensure epel-testing was enabled + context shell '/usr/bin/yum-config-manager epel-testing | grep -q "enabled = True"' do + its(:exit_code) { should be_zero } + end + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb new file mode 100644 index 00000000000..83bcdffd2c9 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/spec/unit/facter/os_maj_version_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe 'os_maj_version fact' do + before :each do + Facter.clear + end + + context "on 5.9 operatingsystemrelease" do + it "should have os_maj_version => 5" do + Facter.fact(:operatingsystemrelease).stubs(:value).returns("5.9") + Facter.fact(:os_maj_version).value.should == "5" + end + end + + context "on 6.4 operatingsystemrelease" do + it "should have os_maj_version => 6" do + Facter.fact(:operatingsystemrelease).stubs(:value).returns("6.4") + Facter.fact(:os_maj_version).value.should == "6" + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp new file mode 100644 index 00000000000..c2e61d42989 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/epel/tests/init.pp @@ -0,0 +1,3 @@ +# And by test, I mean, run this thing for me using Puppet apply and I'll check +# it out. +include 'epel' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml new file mode 100644 index 00000000000..8968df1f459 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.fixtures.yml @@ -0,0 +1,7 @@ +fixtures: + repositories: + apt: git://github.com/puppetlabs/puppetlabs-apt.git + stdlib: git://github.com/puppetlabs/puppetlabs-stdlib.git + epel: git://github.com/stahnma/puppet-module-epel.git + symlinks: + erlang: "#{source_dir}" diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml new file mode 100644 index 00000000000..cbd0d57b83d --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.nodeset.yml @@ -0,0 +1,35 @@ +--- +default_set: 'centos-64-x64' +sets: + 'centos-59-x64': + nodes: + "main.foo.vm": + prefab: 'centos-59-x64' + 'centos-64-x64': + nodes: + "main.foo.vm": + prefab: 'centos-64-x64' + 'fedora-18-x64': + nodes: + "main.foo.vm": + prefab: 'fedora-18-x64' + 'debian-607-x64': + nodes: + "main.foo.vm": + prefab: 'debian-607-x64' + 'debian-70rc1-x64': + nodes: + "main.foo.vm": + prefab: 'debian-70rc1-x64' + 'ubuntu-server-10044-x64': + nodes: + "main.foo.vm": + prefab: 'ubuntu-server-10044-x64' + 'ubuntu-server-12042-x64': + nodes: + "main.foo.vm": + prefab: 'ubuntu-server-12042-x64' + 'sles-11sp1-x64': + nodes: + "main.foo.vm": + prefab: 'sles-11sp1-x64' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec new file mode 100644 index 00000000000..49d5710b3ef --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.rspec @@ -0,0 +1 @@ +--format documentation diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml new file mode 100644 index 00000000000..cd412bfd344 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/.travis.yml @@ -0,0 +1,23 @@ +--- +language: ruby +bundler_args: --without development +before_install: rm Gemfile.lock || true +rvm: + - 1.8.7 + - 1.9.3 + - 2.0.0 +script: bundle exec rake test +env: + - PUPPET_VERSION="~> 2.7.0" + - PUPPET_VERSION="~> 3.1.0" + - PUPPET_VERSION="~> 3.2.0" + - PUPPET_VERSION="~> 3.3.0" + - PUPPET_VERSION="~> 3.4.0" +matrix: + exclude: + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 2.7.0" + - rvm: 2.0.0 + env: PUPPET_VERSION="~> 3.1.0" + - rvm: 1.9.3 + env: PUPPET_VERSION="~> 2.7.0" diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile new file mode 100644 index 00000000000..39ba7f9f63a --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile @@ -0,0 +1,15 @@ +source "http://rubygems.org" + + +gem "rake" +gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.2.0' +gem "puppet-lint" +gem "rspec-puppet", '~> 1.0.0' +gem "puppetlabs_spec_helper" +gem "rspec-system-puppet" +gem "vagrant-wrapper" +gem "puppet-syntax" + +group :development do + gem "puppet-blacksmith" +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock new file mode 100644 index 00000000000..d719aa97918 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Gemfile.lock @@ -0,0 +1,94 @@ +GEM + remote: http://rubygems.org/ + specs: + builder (3.2.2) + diff-lcs (1.2.5) + excon (0.31.0) + facter (1.7.5) + fog (1.20.0) + builder + excon (~> 0.31.0) + formatador (~> 0.2.0) + mime-types + multi_json (~> 1.0) + net-scp (~> 1.1) + net-ssh (>= 2.1.3) + nokogiri (>= 1.5.11) + formatador (0.2.4) + hiera (1.3.2) + json_pure + json_pure (1.8.1) + kwalify (0.7.2) + metaclass (0.0.4) + mime-types (1.25.1) + mocha (1.0.0) + metaclass (~> 0.0.1) + multi_json (1.8.4) + net-scp (1.1.2) + net-ssh (>= 2.6.5) + net-ssh (2.8.0) + nokogiri (1.5.11) + puppet (3.2.4) + facter (~> 1.6) + hiera (~> 1.0) + rgen (~> 0.6.5) + puppet-blacksmith (2.0.2) + nokogiri + puppet (>= 2.7.16) + rest-client + puppet-lint (0.3.2) + puppet-syntax (1.1.0) + puppet (>= 2.7.0) + rake + puppetlabs_spec_helper (0.4.1) + mocha (>= 0.10.5) + rake + rspec (>= 2.9.0) + rspec-puppet (>= 0.1.1) + rake (10.1.1) + rbvmomi (1.8.1) + builder + nokogiri (>= 1.4.1) + trollop + rest-client (1.6.7) + mime-types (>= 1.16) + rgen (0.6.6) + rspec (2.14.1) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + rspec-core (2.14.8) + rspec-expectations (2.14.5) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.6) + rspec-puppet (1.0.1) + rspec + rspec-system (2.8.0) + fog (~> 1.18) + kwalify (~> 0.7.2) + mime-types (~> 1.16) + net-scp (~> 1.1) + net-ssh (~> 2.7) + nokogiri (~> 1.5.10) + rbvmomi (~> 1.6) + rspec (~> 2.14) + systemu (~> 2.5) + rspec-system-puppet (2.2.1) + rspec-system (~> 2.0) + systemu (2.6.3) + trollop (2.0) + vagrant-wrapper (1.2.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + puppet (~> 3.2.0) + puppet-blacksmith + puppet-lint + puppet-syntax + puppetlabs_spec_helper + rake + rspec-puppet (~> 1.0.0) + rspec-system-puppet + vagrant-wrapper diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE new file mode 100644 index 00000000000..bf023233a1f --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/LICENSE @@ -0,0 +1,207 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and + distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by the + copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other + entities that control, are controlled by, or are under common control with + that entity. For the purposes of this definition, "control" means (i) the + power, direct or indirect, to cause the direction or management of such + entity, whether by contract or otherwise, or (ii) ownership of + fifty percent (50%) or more of the outstanding shares, or (iii) beneficial + ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity exercising + permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation source, + and configuration files. + + "Object" form shall mean any form resulting from mechanical transformation + or translation of a Source form, including but not limited to compiled + object code, generated documentation, and conversions to + other media types. + + "Work" shall mean the work of authorship, whether in Source or Object + form, made available under the License, as indicated by a copyright notice + that is included in or attached to the work (an example is provided in the + Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, + that is based on (or derived from) the Work and for which the editorial + revisions, annotations, elaborations, or other modifications represent, + as a whole, an original work of authorship. For the purposes of this + License, Derivative Works shall not include works that remain separable + from, or merely link (or bind by name) to the interfaces of, the Work and + Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including the original + version of the Work and any modifications or additions to that Work or + Derivative Works thereof, that is intentionally submitted to Licensor for + inclusion in the Work by the copyright owner or by an individual or + Legal Entity authorized to submit on behalf of the copyright owner. + For the purposes of this definition, "submitted" means any form of + electronic, verbal, or written communication sent to the Licensor or its + representatives, including but not limited to communication on electronic + mailing lists, source code control systems, and issue tracking systems + that are managed by, or on behalf of, the Licensor for the purpose of + discussing and improving the Work, but excluding communication that is + conspicuously marked or otherwise designated in writing by the copyright + owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity on + behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. + + Subject to the terms and conditions of this License, each Contributor + hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable copyright license to reproduce, prepare + Derivative Works of, publicly display, publicly perform, sublicense, + and distribute the Work and such Derivative Works in + Source or Object form. + +3. Grant of Patent License. + + Subject to the terms and conditions of this License, each Contributor + hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable (except as stated in this section) patent + license to make, have made, use, offer to sell, sell, import, and + otherwise transfer the Work, where such license applies only to those + patent claims licensable by such Contributor that are necessarily + infringed by their Contribution(s) alone or by combination of their + Contribution(s) with the Work to which such Contribution(s) was submitted. + If You institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work or a + Contribution incorporated within the Work constitutes direct or + contributory patent infringement, then any patent licenses granted to + You under this License for that Work shall terminate as of the date such + litigation is filed. + +4. Redistribution. + + You may reproduce and distribute copies of the Work or Derivative Works + thereof in any medium, with or without modifications, and in Source or + Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a + copy of this License; and + + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + + 3. You must retain, in the Source form of any Derivative Works that You + distribute, all copyright, patent, trademark, and attribution notices from + the Source form of the Work, excluding those notices that do not pertain + to any part of the Derivative Works; and + + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable copy + of the attribution notices contained within such NOTICE file, excluding + those notices that do not pertain to any part of the Derivative Works, + in at least one of the following places: within a NOTICE text file + distributed as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, within a + display generated by the Derivative Works, if and wherever such + third-party notices normally appear. The contents of the NOTICE file are + for informational purposes only and do not modify the License. + You may add Your own attribution notices within Derivative Works that You + distribute, alongside or as an addendum to the NOTICE text from the Work, + provided that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and may + provide additional or different license terms and conditions for use, + reproduction, or distribution of Your modifications, or for any such + Derivative Works as a whole, provided Your use, reproduction, and + distribution of the Work otherwise complies with the conditions + stated in this License. + +5. Submission of Contributions. + + Unless You explicitly state otherwise, any Contribution intentionally + submitted for inclusion in the Work by You to the Licensor shall be under + the terms and conditions of this License, without any additional + terms or conditions. Notwithstanding the above, nothing herein shall + supersede or modify the terms of any separate license agreement you may + have executed with Licensor regarding such Contributions. + +6. Trademarks. + + This License does not grant permission to use the trade names, trademarks, + service marks, or product names of the Licensor, except as required for + reasonable and customary use in describing the origin of the Work and + reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + + Unless required by applicable law or agreed to in writing, Licensor + provides the Work (and each Contributor provides its Contributions) + on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + either express or implied, including, without limitation, any warranties + or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS + FOR A PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any risks + associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + + In no event and under no legal theory, whether in tort + (including negligence), contract, or otherwise, unless required by + applicable law (such as deliberate and grossly negligent acts) or agreed + to in writing, shall any Contributor be liable to You for damages, + including any direct, indirect, special, incidental, or consequential + damages of any character arising as a result of this License or out of + the use or inability to use the Work (including but not limited to damages + for loss of goodwill, work stoppage, computer failure or malfunction, + or any and all other commercial damages or losses), even if such + Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + + While redistributing the Work or Derivative Works thereof, You may choose + to offer, and charge a fee for, acceptance of support, warranty, + indemnity, or other liability obligations and/or rights consistent with + this License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf of any + other Contributor, and only if You agree to indemnify, defend, and hold + each Contributor harmless for any liability incurred by, or claims + asserted against, such Contributor by reason of your accepting any such + warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + + To apply the Apache License to your work, attach the following boilerplate + notice, with the fields enclosed by brackets "[]" replaced with your own + identifying information. (Don't include the brackets!) The text should be + enclosed in the appropriate comment syntax for the file format. We also + recommend that a file or class name and description of purpose be included + on the same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2013 Gareth Rushgrove + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + or implied. See the License for the specific language governing + permissions and limitations under the License. diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile new file mode 100644 index 00000000000..9ca1ef70427 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Modulefile @@ -0,0 +1,10 @@ +name 'garethr-erlang' +version '0.3.0' +source 'git://github.com/garethr/garethr-erlang.git' +author 'Gareth Rushgrove' +summary 'Module for installing erlang from official repos' +description 'Install one of the official erlang packages' +license 'Apache License, Version 2.0' +dependency 'puppetlabs/apt' +dependency 'puppetlabs/stdlib' +dependency 'stahnma/epel' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md new file mode 100644 index 00000000000..a1959740bc6 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/README.md @@ -0,0 +1,28 @@ +Puppet module for installing Erlang from alternative repositories. + +On debian it will use the official repositories +mentioned on the [Erlang +docs](https://www.erlang-solutions.com/downloads/download-erlang-otp). + +On Redhat 5 it'll use an additional EPEL repository hosted by +[Redhat](http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo). + +On Redhat 6 it'll require EPEL. + +On SUSE it'll use the official repos. + +On Archlinux it'll use community repos. + +This module is also available on the [Puppet +Forge](https://forge.puppetlabs.com/garethr/erlang) + +[![Build +Status](https://secure.travis-ci.org/garethr/garethr-erlang.png)](http://travis-ci.org/garethr/garethr-erlang) + +## Usage + +The module includes a single class: + + include 'erlang' + +By default this sets up the repository and installs the erlang package. diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile new file mode 100644 index 00000000000..d45aa3d5741 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/Rakefile @@ -0,0 +1,35 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' +require 'rspec-system/rake_task' + +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.fail_on_warnings = true + +# Forsake support for Puppet 2.6.2 for the benefit of cleaner code. +# http://puppet-lint.com/checks/class_parameter_defaults/ +PuppetLint.configuration.send('disable_class_parameter_defaults') +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +# http://puppet-lint.com/checks/80chars/ +PuppetLint.configuration.send("disable_80chars") + +exclude_paths = [ + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc "Run syntax, lint, and spec tests." +task :test => [ + :syntax, + :lint, + :spec, +] diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp new file mode 100644 index 00000000000..045bada9474 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/init.pp @@ -0,0 +1,45 @@ +# == Class: erlang +# +# Module to install an up-to-date version of Erlang from the +# official repositories +# +# === Parameters +# [*version*] +# The package version to install, passed to ensure. +# Defaults to present. +# +class erlang ( + $epel_enable = $erlang::params::epel_enable, + $key_signature = $erlang::params::key_signature, + $local_repo_location = $erlang::params::local_repo_location, + $package_name = $erlang::params::package_name, + $remote_repo_location = $erlang::params::remote_repo_location, + $remote_repo_key_location = $erlang::params::remote_repo_key_location, + $repos = $erlang::params::repos, + $version = 'present', +) inherits erlang::params { + validate_string($version) + + case $::osfamily { + 'Debian' : { + include '::apt' + include '::erlang::repo::apt' + } + 'RedHat' : { + if $epel_enable { + # Include epel as this is a requirement for erlang in RHEL6. + include '::epel' + Class['epel'] -> Package[$package_name] + } + + # This is only needed on RHEL5, RHEL6 has erlang in EPEL. + if $::operatingsystemrelease =~ /^5/ { + include '::erlang::repo::yum' + } + } + default : { + } + } + + package { $package_name: ensure => $version, } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp new file mode 100644 index 00000000000..9358326cd94 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/params.pp @@ -0,0 +1,29 @@ +# == Class: erlang::params +# +# Default paramaters setting repository details for different +# operating systems +# +class erlang::params { + $epel_enable = false + + case $::osfamily { + 'Debian' : { + $key_signature = 'D208507CA14F4FCA' + $package_name = 'erlang-nox' + $remote_repo_key_location = 'http://packages.erlang-solutions.com/debian/erlang_solutions.asc' + $remote_repo_location = 'http://packages.erlang-solutions.com/debian' + $repos = 'contrib' + } + 'RedHat', 'SUSE', 'Archlinux' : { + $package_name = 'erlang' + + if $::operatingsystemrelease =~ /^5/ { + $local_repo_location = '/etc/yum.repos.d/epel-erlang.repo' + $remote_repo_location = 'http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo' + } + } + default : { + fail("The ${module_name} module is not supported on an ${::osfamily} based system.") + } + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp new file mode 100644 index 00000000000..dc5dbc9c4fb --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/apt.pp @@ -0,0 +1,41 @@ +# == Class: erlang::repo::apt +# +# Install an apt package repository containing Erlang. +# All parameters have sane default values in erlang::params. +# +# === Parameters +# [*key_signature*] +# The signature for the key used to sign packages in the repository. +# +# [*package_name*] +# Name of the Erlang package in the specified repository. +# +# [*remote_repo_key_location*] +# URL of the public key for the remote repository. +# +# [*remote_repo_location*] +# URL of the remote debian repository. +# +# [*repos*] +# Which of the standard repositories to install from the +# remote repo. For instance main, contrib, restricted. +# +class erlang::repo::apt( + $key_signature = $erlang::key_signature, + $package_name = $erlang::package_name, + $remote_repo_key_location = $erlang::remote_repo_key_location, + $remote_repo_location = $erlang::remote_repo_location, + $repos = $erlang::repos, +) { + + Class['erlang::repo::apt'] -> Package<| title == $package_name |> + + apt::source { 'erlang': + include_src => false, + key => $key_signature, + key_source => $remote_repo_key_location, + location => $remote_repo_location, + repos => $repos, + } + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp new file mode 100644 index 00000000000..702e65220b9 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/manifests/repo/yum.pp @@ -0,0 +1,30 @@ +# == Class: erlang::repo::yum +# +# Install a yum package repository containing Erlang. +# All parameters have sane default values in erlang::params. +# +# === Parameters +# [*local_repo_location*] +# File system location to store the repository details +# +# [*package_name*] +# Name of the Erlang package in the specified repository +# +# [*remote_repo_location*] +# URL of the remote repository +# +class erlang::repo::yum ( + $local_repo_location = $erlang::local_repo_location, + $package_name = $erlang::package_name, + $remote_repo_location = $erlang::remote_repo_location, +) inherits erlang { + + Class['erlang::repo::yum'] -> Package<| title == $package_name |> + + exec { 'erlang-repo-download': + command => "curl -o ${local_repo_location} ${remote_repo_location}", + path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', + creates => $local_repo_location, + } + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb new file mode 100644 index 00000000000..8708eb1afe8 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/classes/erlang_spec.rb @@ -0,0 +1,138 @@ +require 'spec_helper' + +describe 'erlang', :type => :class do + + + context 'on Debian' do + let(:facts) { { + :osfamily => 'Debian', + :lsbdistid => 'debian', + :lsbdistcodename => 'squeeze' + }} + + context 'with no parameters' do + it { should compile.with_all_deps } + it { should contain_package('erlang-nox').with_ensure('present') } + it { should contain_apt__source('erlang').with( + 'key_source' => 'http://packages.erlang-solutions.com/debian/erlang_solutions.asc', + 'key' => 'D208507CA14F4FCA' + ) } + end + + context 'with a custom version' do + let(:params) { {'version' => 'absent' } } + it { should contain_package('erlang-nox').with_ensure('absent') } + end + + context 'with a custom package name' do + let(:params) { {'package_name' => 'not-erlang' } } + it { should contain_package('not-erlang').with_ensure('present') } + end + + context 'with custom repository details' do + let(:params) { { + 'key_signature' => '1234ABCD', + 'repos' => 'main', + 'remote_repo_location' => 'http://example.com/debian', + 'remote_repo_key_location' => 'http://example.com/debian/key.asc', + } } + it { should contain_apt__source('erlang').with( + 'location' => 'http://example.com/debian', + 'key_source' => 'http://example.com/debian/key.asc', + 'key' => '1234ABCD', + 'repos' => 'main' + ) } + end + + end + + context 'on RedHat 5' do + let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '5.9' } } + + context "epel enabled" do + let(:params) {{ :epel_enable => true }} + it { should contain_class('epel') } + end + + context "epel disabled" do + let(:params) {{ :epel_enable => false }} + it { should_not contain_class('epel') } + end + + context 'with no parameters' do + it { should contain_package('erlang').with_ensure('present') } + it { should contain_exec('erlang-repo-download').with( + 'command' => 'curl -o /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo', + 'path' => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin' + ) + } + end + + context 'with a custom repository' do + let(:params) { { + 'local_repo_location' => '/tmp/yum.repos.d/tmp.repo', + 'remote_repo_location' => 'http://example.com/fake.repo', + } } + + it { should contain_exec('erlang-repo-download').with( + 'command' => 'curl -o /tmp/yum.repos.d/tmp.repo http://example.com/fake.repo' + ) + } + end + + context 'with a custom version' do + let(:params) { {'version' => 'absent' } } + it { should contain_package('erlang').with_ensure('absent') } + end + end + + context 'on RedHat 6' do + let(:facts) { {:osfamily => 'RedHat', :operatingsystemrelease => '6.4' } } + + context "epel enabled" do + let(:params) {{ :epel_enable => true }} + it { should contain_class('epel') } + end + + context "epel disabled" do + let(:params) {{ :epel_enable => false }} + it { should_not contain_class('epel') } + end + + context 'with no parameters' do + it { should contain_package('erlang').with_ensure('present') } + end + + context 'with a custom version' do + let(:params) { {'version' => 'absent' } } + it { should contain_package('erlang').with_ensure('absent') } + end + end + + context 'on SUSE' do + let(:facts) {{ :osfamily => 'SUSE', }} + + context 'with no parameters' do + it { should contain_package('erlang').with_ensure('present') } + end + + context 'with a custom version' do + let(:params) { {'version' => 'absent' } } + it { should contain_package('erlang').with_ensure('absent') } + end + end + + context 'on Archlinux' do + let(:facts) {{ :osfamily => 'Archlinux', }} + + context 'with no parameters' do + it { should contain_package('erlang').with_ensure('present') } + end + + context 'with a custom version' do + let(:params) { {'version' => 'absent' } } + it { should contain_package('erlang').with_ensure('absent') } + end + end + +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb new file mode 100644 index 00000000000..2c6f56649ae --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/module_spec_helper' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb new file mode 100644 index 00000000000..5c370248560 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/spec_helper_system.rb @@ -0,0 +1,17 @@ +require 'rspec-system/spec_helper' +require 'rspec-system-puppet/helpers' + +include RSpecSystemPuppet::Helpers + +RSpec.configure do |c| + proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + c.tty = true + c.include RSpecSystemPuppet::Helpers + + c.before :suite do + puppet_install + puppet_module_install(:source => proj_root, :module_name => 'erlang') + shell('puppet module install puppetlabs-apt') + shell('puppet module install stahnma-epel') + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb new file mode 100644 index 00000000000..4d5772fa59a --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/erlang/spec/system/erlang_spec.rb @@ -0,0 +1,25 @@ +require 'spec_helper_system' + +describe 'The erlang puppet module' do + it 'should run without errors' do + pp = <<-EOS + class { 'erlang': + epel_enable => true + } + EOS + + puppet_apply(pp) do |r| + r.exit_code.should == 2 + r.refresh + r.exit_code.should be_zero + end + end + + it 'should install the erl binary into /usr/bin' do + shell 'which erl' do |r| + r.stdout.should =~ /\/usr\/bin\/erl/ + r.stderr.should be_empty + r.exit_code.should be_zero + end + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb index fd495f8f143..90401172eb7 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/hash_key_true.rb @@ -28,7 +28,7 @@ module Puppet::Parser::Functions return false end - if arr[key].empty? + if arr[key] == false return false end @@ -36,6 +36,10 @@ module Puppet::Parser::Functions return false end + if arr[key].empty? + return false + end + return true end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb new file mode 100644 index 00000000000..d50c2d8304b --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/lib/puppet/parser/functions/value_true.rb @@ -0,0 +1,45 @@ +# +# value_true.rb +# + +module Puppet::Parser::Functions + + newfunction(:value_true, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args| + + Returns true if value is truthy + ENDHEREDOC + + unless args.length == 1 + raise Puppet::ParseError, ("value_true(): wrong number of arguments (#{args.length}; must be 1)") + end + + value = args[0] + + if value.nil? + return false + end + + if value == false + return false + end + + if value == 0 + return false + end + + if value == '0' + return false + end + + if value == 'false' + return false + end + + if value.empty? + return false + end + + return true + + end +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp index 3b27ab90af6..7a35d19efe9 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/hhvm.pp @@ -44,7 +44,11 @@ class puphpet::hhvm( 'deb http://security.debian.org/ wheezy/updates main', 'deb-src http://security.debian.org/ wheezy/updates main', 'deb http://http.us.debian.org/debian wheezy-updates main', - 'deb-src http://http.us.debian.org/debian wheezy-updates main' + 'deb-src http://http.us.debian.org/debian wheezy-updates main', + 'deb http://http.debian.net/debian wheezy main', + 'deb-src http://http.debian.net/debian wheezy main', + 'deb http://http.debian.net/debian wheezy-updates main', + 'deb-src http://http.debian.net/debian wheezy-updates main', ] each( $deb_srcs ) |$value| { diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp index 1a998e9271b..e266f862cdb 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/params.pp @@ -53,9 +53,14 @@ class puphpet::params { 'Redhat' => 'php-cgi' } + $nginx_default_conf_location = $::osfamily ? { + 'Debian' => '/etc/nginx/conf.d/default.conf', + 'Redhat' => '/etc/nginx/conf.d/default.conf' + } + $nginx_webroot_location = $::osfamily ? { 'Debian' => '/var/www/html', - 'Redhat' => '/usr/share/nginx/html' + 'Redhat' => '/var/www/html' } $mariadb_package_client_name = $::osfamily ? { diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp index 4582e67a17a..f570dcd4fc4 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pear.pp @@ -3,7 +3,8 @@ */ define puphpet::php::pear ( - $service_autorestart + $service_name = '', + $service_autorestart, ){ $package = { @@ -15,7 +16,9 @@ define puphpet::php::pear ( 'pear_command_packaging' => 'alpha', 'pear_frontend_gtk2' => false, 'php_beautifier' => 'beta', + 'php_parser' => 'alpha', 'php_parser_docblockparser' => 'alpha', + 'soap' => 'beta', 'testing_selenium' => 'beta', 'versioncontrol_git' => 'alpha', 'versioncontrol_svn' => 'alpha', @@ -38,7 +41,8 @@ define puphpet::php::pear ( ::php::pear::module { $name: use_package => false, preferred_state => $preferred_state, - service_autorestart => $php_webserver_restart, + service => $service_name, + service_autorestart => $service_autorestart, } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp index 2dd2b817fec..dfa04232f42 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/php/pecl.pp @@ -16,7 +16,10 @@ define puphpet::php::pecl ( $pecl = $::osfamily ? { 'Debian' => { - # + 'mongo' => $::lsbdistcodename ? { + 'precise' => 'mongo', + default => false, + }, }, 'Redhat' => { # @@ -63,24 +66,34 @@ define puphpet::php::pecl ( } } + $auto_answer_hash = { + 'mongo' => 'no\n' + } + $downcase_name = downcase($name) - if has_key($ignore, $downcase_name) { + if has_key($auto_answer_hash, $downcase_name) { + $auto_answer = $auto_answer_hash[$downcase_name] + } else { + $auto_answer = '\\n' + } + + if has_key($ignore, $downcase_name) and $ignore[$downcase_name] { $pecl_name = $pecl[$downcase_name] $package_name = false $preferred_state = 'stable' } - elsif has_key($pecl, $downcase_name) { - $pecl_name = false + elsif has_key($pecl, $downcase_name) and $pecl[$downcase_name] { + $pecl_name = $pecl[$downcase_name] $package_name = false - $preferred_state = false + $preferred_state = 'stable' } elsif has_key($pecl_beta, $downcase_name) and $pecl_beta[$downcase_name] { $pecl_name = $pecl_beta[$downcase_name] $package_name = false $preferred_state = 'beta' } - elsif has_key($package, $downcase_name) { + elsif has_key($package, $downcase_name) and $package[$downcase_name] { $pecl_name = false $package_name = $package[$downcase_name] } @@ -93,6 +106,7 @@ define puphpet::php::pecl ( ::php::pecl::module { $pecl_name: use_package => false, preferred_state => $preferred_state, + auto_answer => $auto_answer, service_autorestart => $service_autorestart, } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp new file mode 100644 index 00000000000..a13df08b30b --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/puphpet/manifests/supervisord.pp @@ -0,0 +1,18 @@ +# This depends on +# ajcrowe/supervisord: https://github.com/ajcrowe/puppet-supervisord + +class puphpet::supervisord { + + if ! defined(Class['::supervisord']) { + class{ 'puphpet::python::pip': } + + class { '::supervisord': + install_pip => false, + require => [ + Class['::my_fw::post'], + Class['puphpet::python::pip'], + ], + } + } + +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md index c6750445516..d956bdedcff 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/README.md @@ -111,6 +111,23 @@ class { 'rabbitmq': } ``` +**NOTE:** If you are using a version of RabbitMQ less than 3.0, +you still need to use `x-ha-policy: all` in your client +applications for any particular queue to take advantage of H/A via +mirrored queues. + +If you are using a version of RabbitMQ >= 3.0 You should set the +'config_mirrored_queues' parameter if you plan +on using RabbitMQ Mirrored Queues within your cluster: + +```puppet +class { 'rabbitmq': + config_cluster => true, + config_mirrored_queues => true, + cluster_nodes => ['rabbit1', 'rabbit2'], +} +``` + ##Reference ##Classes @@ -234,6 +251,15 @@ Determines if the service is managed. The name of the service to manage. +####`ssl` + +Configures the service for using SSL. + +####`ssl_only` + +Configures the service to only use SSL. No cleartext TCP listeners will be created. +Requires that ssl => true also. + ####`stomp_port` The port to use for Stomp. @@ -262,6 +288,16 @@ rabbitmq_user { 'dan': password => 'bar', } ``` +Optional parameter tags will set further rabbitmq tags like monitoring, policymaker, etc. +To set the administrator tag use admin-flag. +```puppet +rabbitmq_user { 'dan': + admin => true, + password => 'bar', + tags => ['monitoring', 'tag1'], +} +``` + ### rabbitmq\_vhost @@ -317,8 +353,8 @@ The module has been tested on: Testing on other platforms has been light and cannot be guaranteed. -### RedHat module dependencies -To have a suitable erlang version installed on RedHat systems, +### Module dependencies +To have a suitable erlang version installed on RedHat and Debian systems, you have to install another puppet module from http://forge.puppetlabs.com/garethr/erlang with: puppet module install garethr-erlang @@ -326,9 +362,18 @@ you have to install another puppet module from http://forge.puppetlabs.com/garet This module handles the packages for erlang. To use the module, add the following snippet to your site.pp or an appropriate profile class: +For RedHat systems: + include 'erlang' class { 'erlang': epel_enable => true} +For Debian systems: + + include 'erlang' + package { 'erlang-base': + ensure => 'latest', + } + ##Development Puppet Labs modules on the Puppet Forge are open projects, and community diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/files/plugins/amqp_client-2.3.1.ez index 6ef6d4ff148f4bbba71800a8941c26f25bd393d6..125a89a7b79c40f2d41f912b7e71dc20503c4d7d 100644 GIT binary patch delta 38 wcmV+>0NMZOq6y=o39$Kmv-*6>khjGR0ntdemsSDFQnzBM0T`dRdq@K92%3Tu82|tP delta 48 zcmaF7i1WoF&J90n7A^I&?*0RRwz B6HovE diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb index fcc3764fdd8..8e0d6ab862d 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb @@ -2,7 +2,9 @@ require 'puppet' Puppet::Type.type(:rabbitmq_exchange).provide(:rabbitmqadmin) do commands :rabbitmqctl => '/usr/sbin/rabbitmqctl' - commands :rabbitmqadmin => '/usr/local/bin/rabbitmqadmin' + has_command(:rabbitmqadmin, '/usr/local/bin/rabbitmqadmin') do + environment( { 'HOME' => '' }) + end defaultfor :feature => :posix def should_vhost diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb index e416cbe02b3..eefc9fb2541 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_plugin/rabbitmqplugins.rb @@ -1,10 +1,20 @@ Puppet::Type.type(:rabbitmq_plugin).provide(:rabbitmqplugins) do if Puppet::PUPPETVERSION.to_f < 3 - commands :rabbitmqplugins => 'rabbitmq-plugins' + if Facter.value(:osfamily) == 'RedHat' + commands :rabbitmqplugins => '/usr/lib/rabbitmq/bin/rabbitmq-plugins' + else + commands :rabbitmqplugins => 'rabbitmq-plugins' + end else - has_command(:rabbitmqplugins, 'rabbitmq-plugins') do - environment :HOME => "/tmp" + if Facter.value(:osfamily) == 'RedHat' + has_command(:rabbitmqplugins, '/usr/lib/rabbitmq/bin/rabbitmq-plugins') do + environment :HOME => "/tmp" + end + else + has_command(:rabbitmqplugins, 'rabbitmq-plugins') do + environment :HOME => "/tmp" + end end end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb index 9cb2e41c293..ef284bdcdc6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb @@ -27,6 +27,9 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do if resource[:admin] == :true make_user_admin() end + if !resource[:tags].nil? + set_user_tags(resource[:tags]) + end end def destroy @@ -39,8 +42,18 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do end end - # def password - # def password=() + + def tags + get_user_tags.entries.sort + end + + + def tags=(tags) + if ! tags.nil? + set_user_tags(tags) + end + end + def admin if usertags = get_user_tags (:true if usertags.include?('administrator')) || :false @@ -49,7 +62,6 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do end end - def admin=(state) if state == :true make_user_admin() @@ -60,6 +72,16 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do end end + def set_user_tags(tags) + is_admin = get_user_tags().member?("administrator") \ + || resource[:admin] == :true + usertags = Set.new(tags) + if is_admin + usertags.add("administrator") + end + rabbitmqctl('set_user_tags', resource[:name], usertags.entries.sort) + end + def make_user_admin usertags = get_user_tags usertags.add('administrator') @@ -73,5 +95,4 @@ Puppet::Type.type(:rabbitmq_user).provide(:rabbitmqctl) do end.compact.first Set.new(match[1].split(/, /)) if match end - end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb index 642710d1c07..be5219d5c90 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/lib/puppet/type/rabbitmq_user.rb @@ -33,6 +33,10 @@ Puppet::Type.newtype(:rabbitmq_user) do defaultto :false end + newproperty(:tags, :array_matching => :all) do + desc 'additional tags for the user' + end + validate do if self[:ensure] == :present and ! self[:password] raise ArgumentError, 'must set password when creating user' unless self[:password] diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp index 96877f6a631..8894280f6de 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/config.pp @@ -17,11 +17,14 @@ class rabbitmq::config { $port = $rabbitmq::port $service_name = $rabbitmq::service_name $ssl = $rabbitmq::ssl + $ssl_only = $rabbitmq::ssl_only $ssl_cacert = $rabbitmq::ssl_cacert $ssl_cert = $rabbitmq::ssl_cert $ssl_key = $rabbitmq::ssl_key $ssl_management_port = $rabbitmq::ssl_management_port $ssl_stomp_port = $rabbitmq::ssl_stomp_port + $ssl_verify = $rabbitmq::ssl_verify + $ssl_fail_if_no_peer_cert = $rabbitmq::ssl_fail_if_no_peer_cert $stomp_port = $rabbitmq::stomp_port $wipe_db_on_cookie_change = $rabbitmq::wipe_db_on_cookie_change $config_variables = $rabbitmq::config_variables @@ -115,3 +118,4 @@ class rabbitmq::config { } + diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp index 6c14f0097d6..c96128a792e 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/init.pp @@ -6,6 +6,7 @@ class rabbitmq( $cluster_nodes = $rabbitmq::params::cluster_nodes, $config = $rabbitmq::params::config, $config_cluster = $rabbitmq::params::config_cluster, + $config_mirrored_queues = $rabbitmq::params::config_mirrored_queues, $config_path = $rabbitmq::params::config_path, $config_stomp = $rabbitmq::params::config_stomp, $default_user = $rabbitmq::params::default_user, @@ -29,6 +30,7 @@ class rabbitmq( $service_manage = $rabbitmq::params::service_manage, $service_name = $rabbitmq::params::service_name, $ssl = $rabbitmq::params::ssl, + $ssl_only = $rabbitmq::params::ssl_only, $ssl_cacert = $rabbitmq::params::ssl_cacert, $ssl_cert = $rabbitmq::params::ssl_cert, $ssl_key = $rabbitmq::params::ssl_key, @@ -59,7 +61,6 @@ class rabbitmq( validate_string($package_gpg_key) validate_string($package_name) validate_string($package_provider) - validate_string($package_source) validate_bool($manage_repos) validate_re($version, '^\d+\.\d+\.\d+(-\d+)*$') # Allow 3 digits and optional -n postfix. # Validate config parameters. @@ -69,6 +70,7 @@ class rabbitmq( validate_string($config) validate_absolute_path($config_path) validate_bool($config_cluster) + validate_bool($config_mirrored_queues) validate_bool($config_stomp) validate_string($default_user) validate_string($default_pass) @@ -87,6 +89,7 @@ class rabbitmq( validate_bool($service_manage) validate_string($service_name) validate_bool($ssl) + validate_bool($ssl_only) validate_string($ssl_cacert) validate_string($ssl_cert) validate_string($ssl_key) @@ -105,6 +108,10 @@ class rabbitmq( validate_hash($config_variables) validate_hash($config_kernel_variables) + if $ssl_only and ! $ssl { + fail('$ssl_only => true requires that $ssl => true') + } + include '::rabbitmq::install' include '::rabbitmq::config' include '::rabbitmq::service' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp index 481a7b4f931..078e9a95f00 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/management.pp @@ -10,4 +10,10 @@ class rabbitmq::management { } } + if $rabbitmq::config_mirrored_queues { + rabbitmq::policy { 'ha-all': + pattern => '.*', + definition => '{"ha-mode":"all","ha-sync-mode":"automatic"}' + } + } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp index 9018bb7b244..63e2e491ee1 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/params.pp @@ -61,6 +61,7 @@ class rabbitmq::params { $cluster_nodes = [] $config = 'rabbitmq/rabbitmq.config.erb' $config_cluster = false + $config_mirrored_queues = false $config_path = '/etc/rabbitmq/rabbitmq.config' $config_stomp = false $default_user = 'guest' @@ -73,6 +74,7 @@ class rabbitmq::params { $plugin_dir = "/usr/lib/rabbitmq/lib/rabbitmq_server-${version}/plugins" $port = '5672' $ssl = false + $ssl_only = false $ssl_cacert = 'UNSET' $ssl_cert = 'UNSET' $ssl_key = 'UNSET' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp new file mode 100644 index 00000000000..204fb36a9cf --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/policy.pp @@ -0,0 +1,15 @@ +define rabbitmq::policy ( + $pattern, + $definition, + $vhost = '/', + $priority = 0, +) { + + exec { "rabbitmq policy: ${title}": + command => "rabbitmqctl set_policy -p ${vhost} '${name}' '${pattern}' '${definition}' ${priority}", + unless => "rabbitmqctl list_policies | grep -qE '^${vhost}\\s+${name}\\s+${pattern}\\s+${definition}\\s+${priority}$'", + path => ['/bin','/sbin','/usr/bin','/usr/sbin'], + require => Class['rabbitmq::service'], + before => Anchor['rabbitmq::end'] + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp index 495ea2f2dfc..8ad26cb5bb6 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/manifests/server.pp @@ -66,7 +66,7 @@ class rabbitmq::server( } if $config_mirrored_queues != undef { - warning('The $config_mirrored_queues parameter is deprecated; it does not affect anything') + warning('The $config_mirrored_queues parameter is deprecated in this class, use the rabbitmq class') } anchor {'before::rabbimq::class': diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb index 3e577843e8a..ff93fd4e3fc 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/classes/rabbitmq_spec.rb @@ -20,7 +20,7 @@ describe 'rabbitmq' do let(:facts) {{ :osfamily => 'Debian' }} it 'should add a repo with defaults values' do contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ - .with_content(/deb http\:\/\/www\.rabbitmq.com\/debian\/ testing main/) + .with_content(%r|deb http\://www\.rabbitmq.com/debian/ testing main|) end end @@ -32,7 +32,7 @@ describe 'rabbitmq' do }} it 'should add a repo with custom new values' do contain_file('/etc/apt/sources.list.d/rabbitmq.list')\ - .with_content(/deb http\:\/\/www\.foorepo.com\/debian\/ unstable main/) + .with_content(%r|deb http\://www\.foorepo.com/debian/ unstable main|) end end end @@ -275,6 +275,30 @@ describe 'rabbitmq' do end end + describe 'configuring ldap authentication' do + let :params do + { :config_stomp => false, + :ldap_auth => true, + :ldap_server => 'ldap.example.com', + :ldap_user_dn_pattern => 'ou=users,dc=example,dc=com', + :ldap_use_ssl => false, + :ldap_port => '389', + :ldap_log => true + } + end + + it { should contain_rabbitmq_plugin('rabbitmq_auth_backend_ldap') } + + it 'should contain ldap parameters' do + verify_contents(subject, 'rabbitmq.config', + ['[', ' {rabbit, [', ' {auth_backends, [rabbit_auth_backend_internal, rabbit_auth_backend_ldap]},', ' ]}', + ' {rabbitmq_auth_backend_ldap, [', ' {other_bind, anon},', + ' {servers, ["ldap.example.com"]},', + ' {user_dn_pattern, "ou=users,dc=example,dc=com"},', ' {use_ssl, false},', + ' {port, 389},', ' {log, true}']) + end + end + describe 'default_user and default_pass set' do let(:params) {{ :default_user => 'foo', :default_pass => 'bar' }} it 'should set default_user and default_pass to specified values' do @@ -295,10 +319,31 @@ describe 'rabbitmq' do it 'should set ssl options to specified values' do contain_file('rabbitmq.config').with({ - 'content' => /ssl_listeners, \[3141\].* - ssl_options, \[{cacertfile,"\/path\/to\/cacert".* - certfile="\/path\/to\/cert".* - keyfile,"\/path\/to\/key/, + 'content' => %r|ssl_listeners, \[3141\].* + ssl_options, \[{cacertfile,"/path/to/cacert".* + certfile="/path/to/cert".* + keyfile,"/path/to/key|, + }) + end + end + + describe 'ssl options with ssl_only' do + let(:params) { + { :ssl => true, + :ssl_only => true, + :ssl_management_port => 3141, + :ssl_cacert => '/path/to/cacert', + :ssl_cert => '/path/to/cert', + :ssl_key => '/path/to/key' + } } + + it 'should set ssl options to specified values' do + contain_file('rabbitmq.config').with({ + 'content' => %r|tcp_listeners, \[\].* + ssl_listeners, \[3141\].* + ssl_options, \[{cacertfile,"/path/to/cacert".* + certfile="/path/to/cert".* + keyfile,"/path/to/key|, }) end end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb index ea4233cba13..2c13b886a8c 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb @@ -147,4 +147,90 @@ EOT @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ['bar','baz'].sort) @provider.admin=:false end + + it 'should clear all tags on existing user' do + @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT +Listing users ... +one [administrator] +foo [tag1,tag2] +icinga [monitoring] +kitchen [] +kitchen2 [abc, def, ghi] +...done. +EOT + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', []) + @provider.tags=[] + end + + it 'should set multiple tags' do + @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT +Listing users ... +one [administrator] +foo [] +icinga [monitoring] +kitchen [] +kitchen2 [abc, def, ghi] +...done. +EOT + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ['tag1','tag2']) + @provider.tags=['tag1','tag2'] + end + + it 'should clear tags while keep admin tag' do + @resource[:admin] = true + @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT +Listing users ... +one [administrator] +foo [administrator, tag1, tag2] +icinga [monitoring] +kitchen [] +kitchen2 [abc, def, ghi] +...done. +EOT + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator"]) + @provider.tags=[] + end + + it 'should change tags while keep admin tag' do + @resource[:admin] = true + @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT +Listing users ... +one [administrator] +foo [administrator, tag1, tag2] +icinga [monitoring] +kitchen [] +kitchen2 [abc, def, ghi] +...done. +EOT + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator","tag1","tag3","tag7"]) + @provider.tags=['tag1','tag7','tag3'] + end + + it 'should create user with tags and without admin' do + @resource[:tags] = [ "tag1", "tag2" ] + @provider.expects(:rabbitmqctl).with('add_user', 'foo', 'bar') + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["tag1","tag2"]) + @provider.expects(:rabbitmqctl).with('list_users').returns <<-EOT +Listing users ... +foo [] +...done. +EOT + @provider.create + end + + it 'should create user with tags and with admin' do + @resource[:tags] = [ "tag1", "tag2" ] + @resource[:admin] = true + @provider.expects(:rabbitmqctl).with('add_user', 'foo', 'bar') + @provider.expects(:rabbitmqctl).with('list_users').twice.returns <<-EOT +Listing users ... +foo [] +...done. +EOT + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator"]) + @provider.expects(:rabbitmqctl).with('set_user_tags', 'foo', ["administrator","tag1","tag2"]) + @provider.create + end + + end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb index 766192dfdac..2d7f81bf21d 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/rabbitmq/templates/rabbitmq.config.erb @@ -9,7 +9,10 @@ {cluster_nodes, {[<%= @r_cluster_nodes.map { |n| "\'rabbit@#{n}\'" }.join(', ') %>], <%= @cluster_node_type %>}}, {cluster_partition_handling, <%= @cluster_partition_handling %>}, <% end -%> -<%- if @ssl %> +<%- if @ssl_only -%> + {tcp_listeners, []}, +<%- end -%> +<%- if @ssl -%> {ssl_listeners, [<%= @ssl_management_port %>]}, {ssl_options, [{cacertfile,"<%= @ssl_cacert %>"}, {certfile,"<%= @ssl_cert %>"}, @@ -37,6 +40,7 @@ {ssl_listeners, [<%= @ssl_stomp_port %>]} <%- end -%> ]} +<% end -%> <%- if @ldap_auth -%>, % Configure the LDAP authentication plugin {rabbitmq_auth_backend_ldap, [ @@ -47,7 +51,6 @@ {port, <%= @ldap_port %>}, {log, <%= @ldap_log %>} ]} -<% end -%> <%- end -%> ]. % EOF diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile new file mode 100644 index 00000000000..19228ff3dbb --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/Modulefile @@ -0,0 +1,13 @@ +name 'puppetlabs-sqlite' +version '0.0.1' +source 'https://github.com/puppetlabs/puppetlabs-sqlite/' +author 'puppetlabs' +license 'Apache' +summary 'Manage a sqlite installation and databases' +description 'This module provides a sqlite class to manage +the installation of sqlite on a node. It also provides +a sqlite::db defined type to manage databases on a system' +project_page 'http://projects.puppetlabs.com/projects/modules/issues' + +## Add dependencies, if any: +# dependency 'username/name', '>= 1.2.0' diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md new file mode 100644 index 00000000000..1eb43afa55e --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/README.md @@ -0,0 +1,32 @@ +sqlite +====== + +Author: Carl Caum +Copyright (c) 2011, Puppet Labs Inc. + +ABOUT +===== + +This module manages [sqlite](http://www.sqlite.org). Through declarion of the `sqlite` class, sqlite will be installed on the system. + +The `sqlite::db` defined type allows for the management of a sqlite database on the node + +CONFIGURATION +============= + +The main class (sqlite) only needs to be declared. No class parameters or top scope variables are needed. + +The `sqlite::db` defined type can be used to manage a sqlite database on the system. +The following parameters are available for the resources declaration: + +location What directory the database should go in. The presence of the directory must be managed separately of the defined type. +owner The owner of the sqlite database file on disk +group The group owning the sqlite database file on disk +mode The mode of the sqlite database file on disk +ensure Whether the database should be `present` or `absent`. Default to `present` +sqlite_cmd The sqlite command for the node's platform. Defaults to `sqlite3` + +TODO +==== + + * Allow for sql commands to be based to sqlite::db for use during creation diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp new file mode 100644 index 00000000000..8b780462e9e --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/db.pp @@ -0,0 +1,44 @@ +# Define: sqlite::db +# +# This define allows for managing the existance of a sqlite database +# +# Parameters: +# $location: +# The location on disk to store the sqlite database +# $owner: +# The owner of the sqlite database file on disk +# $group: +# The group owning the sqlite database file on disk +# $mode: +# The mode of the sqlite datbase file on disk +# $ensure: +# Whether the database should be `present` or `absent`. Defaults to `present` +# $sqlite_cmd: +# The sqlite command for the node's platform. Defaults to `sqlite3` +define sqlite::db( + $location = '', + $owner = 'root', + $group = 0, + $mode = '755', + $ensure = present, + $sqlite_cmd = 'sqlite3' + ) { + + $safe_location = $location ? { + '' => "/var/lib/sqlite/${name}.db", + default => $location, + } + + file { $safe_location: + ensure => $ensure, + owner => $owner, + group => $group, + notify => Exec["create_${name}_db"], + } + + exec { "create_${name}_db": + command => "${sqlite_cmd} $safe_location", + path => '/usr/bin:/usr/local/bin', + refreshonly => true, + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp new file mode 100644 index 00000000000..46b25062812 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/manifests/init.pp @@ -0,0 +1,16 @@ +# Class: sqlite +# +# This class manages the installation of the sqlite +# database. +# +# Sample Usage: +# class { 'sqlite': } +class sqlite { + package { 'sqlite': + ensure => installed, + } + + file { '/var/lib/sqlite/': + ensure => directory, + } +} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json new file mode 100644 index 00000000000..8ce7797ff33 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/metadata.json @@ -0,0 +1,12 @@ +/* ++-----------------------------------------------------------------------+ +| | +| ==> DO NOT EDIT THIS FILE! <== | +| | +| You should edit the `Modulefile` and run `puppet-module build` | +| to generate the `metadata.json` file for your releases. | +| | ++-----------------------------------------------------------------------+ +*/ + +{} diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts new file mode 100644 index 00000000000..91cd6427ed6 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec.opts @@ -0,0 +1,6 @@ +--format +s +--colour +--loadby +mtime +--backtrace diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb new file mode 100644 index 00000000000..a4aeeae232f --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/spec/spec_helper.rb @@ -0,0 +1,18 @@ +require 'pathname' +dir = Pathname.new(__FILE__).parent +$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') + +require 'mocha' +require 'puppet' +gem 'rspec', '=1.2.9' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp new file mode 100644 index 00000000000..520d095142b --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/sqlite/tests/init.pp @@ -0,0 +1 @@ +include sqlite diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/border.png index df13bb6daf79307915e7dd1cf29d48730a50c29d..bc04508aae37b87025042bf57efcfe197288ca50 100644 GIT binary patch delta 12 TcmZ3?xQLOZGr-S%BI`T=7}Nvq delta 13 UcmZ3)xR{Z(Gr-TCcOuI?02{{x`v3p{ diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/colorbox/controls.png index 65cfd1dc95c5ee4c6c3d0848b1dcfc0ec69f6aea..57fe953b7e59ff70b15797d2ce74577a5c518891 100644 GIT binary patch delta 13 Ucmey!|AC*SGr-S%BkLP>048Y#8vpP delta 11 ScmXS~VC@X>bLXANQVakV76W(y diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/stdlib/spec/unit/facter/coverage/assets/0.8.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png index 42ccba269b6e91bef12ad0fa18be651b5ef0ee68..5c0c93f1e9f7fa1fc87ea7b84cfef3c066fc91a9 100644 GIT binary patch delta 10 Rcmd1IVCf9-bDzkX0ss=qZ15E$` delta 11 Scmd1JW9ku`;Fa~9ijE&w=F1c delta 21 ccmeBInyAFu8Q|y6yOAY@jgfbA2HSEj07L`@ku`;Fa~9ijE&w=F1c delta 21 ccmeBInyAFu8Q|y6yOAY@jgfbA2HSEj07L`@ku`;Fa~9ijE&w=F1c delta 21 ccmeBInyAFu8Q|y6yOAY@jgfbA2HSEj07L`@ku`;Fa~9ijE&w=F1c delta 21 ccmeBInyAFu8Q|y6yOAY@jgfbA2HSEj07L`@ku`;Fa~9ijE&w=F1c delta 21 ccmeBInyAFu8Q|y6yOAY@jgfbA2HSEj07L`@ $supervisord::package_ensure, provider => $supervisord::package_provider } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp index f9d82e5804b..47a21852e01 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/params.pp @@ -3,14 +3,35 @@ # Default parameters for supervisord # class supervisord::params { + case $::osfamily { + 'RedHat': { + $init_defaults = '/etc/sysconfig/supervisord' + $unix_socket_group = 'nobody' + $install_init = true + $executable_path = '/usr/bin' + } + 'Debian': { + $init_defaults = '/etc/default/supervisor' + $unix_socket_group = 'nogroup' + $install_init = true + $executable_path = '/usr/local/bin' + } + default: { + $init_defaults = false + $unix_socket_group = 'nogroup' + $install_init = false + $executable_path = '/usr/local/bin' + } + } + # default supervisord params $package_ensure = 'installed' $package_provider = 'pip' $service_ensure = 'running' $service_name = 'supervisord' $package_name = 'supervisor' - $executable = 'supervisord' - $executable_ctl = 'supervisorctl' + $executable = "${$executable_path}/supervisord" + $executable_ctl = "${executable_path}/supervisorctl" $run_path = '/var/run' $pid_file = 'supervisord.pid' @@ -36,22 +57,4 @@ class supervisord::params { $inet_server_hostname = '127.0.0.1' $inet_server_port = '9001' $inet_auth = false - - case $::osfamily { - 'RedHat': { - $init_defaults = '/etc/sysconfig/supervisord' - $unix_socket_group = 'nobody' - $install_init = true - } - 'Debian': { - $init_defaults = '/etc/default/supervisor' - $unix_socket_group = 'nogroup' - $install_init = true - } - default: { - $init_defaults = false - $unix_socket_group = 'nogroup' - $install_init = false - } - } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp index 71dd3653da3..dcf57223498 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/pip.pp @@ -4,7 +4,9 @@ # class supervisord::pip inherits supervisord { - Exec { path => [ '/usr/bin/', '/usr/local/bin', '/bin', '/usr/local/sbin', '/usr/sbin', '/sbin' ] } + Exec { + path => '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin' + } exec { 'install_setuptools': command => "curl ${supervisord::setuptools_url} | python", diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp index e5a4637e430..79eca3d7e0f 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/reload.pp @@ -2,20 +2,18 @@ # # Class to reread and update supervisord with supervisorctl # -class supervisord::reload { - - Exec { path => [ '/usr/bin/', '/usr/local/bin' ] } +class supervisord::reload inherits supervisord { $supervisorctl = $::supervisord::executable_ctl exec { 'supervisorctl_reread': command => "${supervisorctl} reread", refreshonly => true, - returns => [0, 2], + require => Service[$supervisord::service_name], } exec { 'supervisorctl_update': command => "${supervisorctl} update", refreshonly => true, - returns => [0, 2], + require => Service[$supervisord::service_name], } } diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp index ec4dbed9337..473d301185b 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/manifests/supervisorctl.pp @@ -8,8 +8,6 @@ define supervisord::supervisorctl( $refreshonly = false ) { - Exec { path => [ '/usr/bin/', '/usr/local/bin' ] } - validate_string($command) validate_string($process) @@ -26,4 +24,4 @@ define supervisord::supervisorctl( command => $cmd, refreshonly => $refreshonly } -} +} \ No newline at end of file diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb index bff9857257a..f8bdb5ff854 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/Debian/init.erb @@ -16,7 +16,11 @@ DAEMON=<%= @executable %> NAME=supervisord DESC=supervisor -test -x $DAEMON || exit 0 +# Tests if executable exists +if [ ! -x $DAEMON ] ; then + echo "Executable not found ${DAEMON}" + exit 1 +fi LOGDIR=<%= @log_path %> PIDFILE=<%= @run_path %>/<%= @pid_file %> diff --git a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb index dabb2784510..617f3eed93b 100644 --- a/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb +++ b/dev/vagrant/dolibarrdev/puphpet/puppet/modules/supervisord/templates/init/RedHat/init.erb @@ -23,10 +23,17 @@ [ -e <%= @init_defaults %> ] && . <%= @init_defaults %> RETVAL=0 -DAEMON=/usr/bin/supervisord +DAEMON=<%= @executable %> +CTL=<%= @executable_ctl %> DESC=supervisord PIDFILE=<%= @run_path %>/<%= @pid_file %> +# Tests if executable exists +if [ ! -x $DAEMON ] ; then + echo "Executable not found ${DAEMON}" + exit 1 +fi + running_pid() { # Check if a given process pid's cmdline matches a given name @@ -89,7 +96,7 @@ case "$1" in restart ;; reload) - /usr/bin/supervisorctl $OPTIONS reload + $CTL $OPTIONS reload RETVAL=$? ;; condrestart) @@ -110,4 +117,4 @@ case "$1" in exit 1 esac -exit $RETVAL \ No newline at end of file +exit $RETVAL diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh index c6c08a7b04c..198d7e2dfb7 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh @@ -18,12 +18,13 @@ if [[ (${#files[@]} -gt 0) ]]; then echo "Created directory /.puphpet-stuff/${EXEC_ONCE_DIR}-ran" fi - find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ONCE_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec cp -n '{}' "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" \; - find "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" -maxdepth 1 -type f -exec chmod +x '{}' \; -exec {} \; -exec sh -c '>{}' \; + find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ONCE_DIR}" -maxdepth 1 -not -path '/.*' -type f \( ! -iname "empty" \) -exec cp -n '{}' "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" \; + find "/.puphpet-stuff/${EXEC_ONCE_DIR}-ran" -maxdepth 1 -type f -exec chmod +x '{}' \; -exec ls {} \; | sort | xargs -r0 sh -c echo "Finished running files in files/${EXEC_ONCE_DIR}" echo "To run again, delete file(s) you want rerun in /.puphpet-stuff/${EXEC_ONCE_DIR}-ran or the whole folder to rerun all" fi echo "Running files in files/${EXEC_ALWAYS_DIR}" -find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ALWAYS_DIR}" -maxdepth 1 -not -path '*/\.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \; +find "${VAGRANT_CORE_FOLDER}/files/${EXEC_ALWAYS_DIR}" -maxdepth 1 -not -path '/.*' -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec ls {} \; | sort | xargs -r0 sh -c echo "Finished running files in files/${EXEC_ALWAYS_DIR}" + diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt b/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt new file mode 100644 index 00000000000..ce3331b3ced --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/shell/hostsupdater-notice.txt @@ -0,0 +1,4 @@ +=============================================================================== +You have the Vagrant::Hostsupdater plugin installed. You may be required to +enter your host's root/privileged password below to continue! +=============================================================================== diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh b/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh index bd1bb95cabe..21486cd3b93 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/important-notices.sh @@ -2,8 +2,10 @@ VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') -if [[ ! -f '/.puphpet-stuff/displayed-important-notices' ]]; then - cat "${VAGRANT_CORE_FOLDER}/shell/important-notices.txt" - - touch '/.puphpet-stuff/displayed-important-notices' +if [[ -f '/.puphpet-stuff/displayed-important-notices' ]]; then + exit 0 fi + +cat "${VAGRANT_CORE_FOLDER}/shell/important-notices.txt" + +touch '/.puphpet-stuff/displayed-important-notices' diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh b/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh index 8fbfe3a2014..e653f8991c1 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh @@ -8,6 +8,8 @@ OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID) CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME) cat "${VAGRANT_CORE_FOLDER}/shell/self-promotion.txt" +printf "\n" +echo "" if [[ ! -d '/.puphpet-stuff' ]]; then mkdir '/.puphpet-stuff' @@ -17,91 +19,49 @@ fi touch '/.puphpet-stuff/vagrant-core-folder.txt' echo "${VAGRANT_CORE_FOLDER}" > '/.puphpet-stuff/vagrant-core-folder.txt' -if [[ ! -f '/.puphpet-stuff/initial-setup-base-packages' ]]; then - if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then - echo 'Running initial-setup apt-get update' - apt-get update >/dev/null - echo 'Finished running initial-setup apt-get update' - - echo 'Installing git' - apt-get -q -y install git-core >/dev/null - echo 'Finished installing git' - - if [[ "${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise' ]]; then - echo 'Installing basic curl packages (Ubuntu only)' - apt-get install -y libcurl3 libcurl4-gnutls-dev curl >/dev/null - echo 'Finished installing basic curl packages (Ubuntu only)' - fi - - echo 'Installing rubygems' - apt-get install -y rubygems >/dev/null - echo 'Finished installing rubygems' - - echo 'Installing base packages for r10k' - apt-get install -y build-essential ruby-dev >/dev/null - gem install json >/dev/null - echo 'Finished installing base packages for r10k' - - if [ "${OS}" == 'ubuntu' ]; then - echo 'Updating libgemplugin-ruby (Ubuntu only)' - apt-get install -y libgemplugin-ruby >/dev/null - echo 'Finished updating libgemplugin-ruby (Ubuntu only)' - fi - - if [ "${CODENAME}" == 'lucid' ]; then - echo 'Updating rubygems (Ubuntu Lucid only)' - gem install rubygems-update >/dev/null 2>&1 - /var/lib/gems/1.8/bin/update_rubygems >/dev/null 2>&1 - echo 'Finished updating rubygems (Ubuntu Lucid only)' - fi - - echo 'Installing r10k' - gem install r10k >/dev/null 2>&1 - echo 'Finished installing r10k' - - touch '/.puphpet-stuff/initial-setup-base-packages' - elif [[ "${OS}" == 'centos' ]]; then - echo 'Running initial-setup yum update' - perl -p -i -e 's@enabled=1@enabled=0@gi' /etc/yum/pluginconf.d/fastestmirror.conf - perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/os/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/os/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo - perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/updates/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/updates/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo - perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/extras/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/extras/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo - - yum -y --nogpgcheck install 'http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm' >/dev/null - yum -y --nogpgcheck install 'https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' >/dev/null - yum -y install centos-release-SCL >/dev/null - yum clean all >/dev/null - yum -y check-update >/dev/null - echo 'Finished running initial-setup yum update' - - echo 'Installing git' - yum -y install git >/dev/null - echo 'Finished installing git' - - echo 'Updating to Ruby 1.9.3' - yum -y install centos-release-SCL >/dev/null 2>&1 - yum remove ruby >/dev/null 2>&1 - yum -y install ruby193 ruby193-ruby-irb ruby193-ruby-doc ruby193-libyaml rubygems >/dev/null 2>&1 - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-rgen-0.6.5-2.el6.noarch.rpm' >/dev/null 2>&1 - gem update --system >/dev/null 2>&1 - gem install haml >/dev/null 2>&1 - - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/products/x86_64/hiera-1.3.2-1.el6.noarch.rpm' >/dev/null - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/products/x86_64/facter-1.7.5-1.el6.x86_64.rpm' >/dev/null - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/rubygem-json-1.5.5-1.el6.x86_64.rpm' >/dev/null - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-json-1.5.5-1.el6.x86_64.rpm' >/dev/null - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-shadow-2.2.0-2.el6.x86_64.rpm' >/dev/null - yum -y --nogpgcheck install 'https://yum.puppetlabs.com/el/6/dependencies/x86_64/ruby-augeas-0.4.1-3.el6.x86_64.rpm' >/dev/null - echo 'Finished updating to Ruby 1.9.3' - - echo 'Installing basic development tools (CentOS)' - yum -y groupinstall 'Development Tools' >/dev/null - echo 'Finished installing basic development tools (CentOS)' - - echo 'Installing r10k' - gem install r10k >/dev/null 2>&1 - echo 'Finished installing r10k' - - touch '/.puphpet-stuff/initial-setup-base-packages' - fi +if [[ -f '/.puphpet-stuff/initial-setup-base-packages' ]]; then + exit 0 fi + +if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then + echo 'Running initial-setup apt-get update' + apt-get update >/dev/null + echo 'Finished running initial-setup apt-get update' + + echo 'Installing git' + apt-get -y install git-core >/dev/null + echo 'Finished installing git' + + if [[ "${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise' ]]; then + echo 'Installing basic curl packages' + apt-get -y install libcurl3 libcurl4-gnutls-dev curl >/dev/null + echo 'Finished installing basic curl packages' + fi + + echo 'Installing build-essential package' + apt-get -y install build-essential >/dev/null + echo 'Finished installing build-essential packages' +elif [[ "${OS}" == 'centos' ]]; then + echo 'Adding repos: elrep, epel, scl' + perl -p -i -e 's@enabled=1@enabled=0@gi' /etc/yum/pluginconf.d/fastestmirror.conf + perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/os/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/os/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo + perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/updates/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/updates/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo + perl -p -i -e 's@#baseurl=http://mirror.centos.org/centos/\$releasever/extras/\$basearch/@baseurl=http://mirror.rackspace.com/CentOS//\$releasever/extras/\$basearch/\nenabled=1@gi' /etc/yum.repos.d/CentOS-Base.repo + + yum -y --nogpgcheck install 'http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm' >/dev/null + yum -y --nogpgcheck install 'https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' >/dev/null + yum -y install centos-release-SCL >/dev/null + yum clean all >/dev/null + yum -y check-update >/dev/null + echo 'Finished adding repos: elrep, epel, scl' + + echo 'Installing git' + yum -y install git >/dev/null + echo 'Finished installing git' + + echo 'Installing Development Tools' + yum -y groupinstall 'Development Tools' >/dev/null + echo 'Finished installing Development Tools' +fi + +touch '/.puphpet-stuff/initial-setup-base-packages' diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh b/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh new file mode 100644 index 00000000000..93f1c32c6c7 --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/shell/install-puppet.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') + +OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID) +RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE) +CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME) + +if [[ -f '/.puphpet-stuff/install-puppet' ]]; then + exit 0 +fi + +if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then + apt-get -y install augeas-tools libaugeas-dev +elif [[ "${OS}" == 'centos' ]]; then + yum -y install augeas-devel +fi + +echo 'Installing Puppet requirements' +/usr/bin/gem install haml hiera facter json ruby-augeas +echo 'Finished installing Puppet requirements' + +echo 'Installing Puppet 3.4.3' +/usr/bin/gem install puppet --version 3.4.3 + +if [[ -f '/usr/bin/puppet' ]]; then + mv /usr/bin/puppet /usr/bin/puppet-old +fi + +ln -s /usr/local/rvm/wrappers/default/puppet /usr/bin/puppet +echo 'Finished installing Puppet 3.4.3' + +touch '/.puphpet-stuff/install-puppet' diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh b/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh new file mode 100644 index 00000000000..d1b94e37f7d --- /dev/null +++ b/dev/vagrant/dolibarrdev/puphpet/shell/install-ruby.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +export DEBIAN_FRONTEND=noninteractive + +VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') + +OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID) +RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE) +CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME) + +if [[ -f '/.puphpet-stuff/install-ruby' ]]; then + exit 0 +fi + +if [[ -f '/usr/local/rvm/wrappers/default/ruby' ]]; then + RUBY_VERSION=$(/usr/local/rvm/wrappers/default/ruby --version); + if [ "grep '1.9.3' ${RUBY_VERSION}" ]; then + touch '/.puphpet-stuff/install-ruby' + exit 0 + fi +fi + +echo 'Installing Ruby 1.9.3 using RVM' + +curl -sSL https://get.rvm.io | bash -s stable --ruby=1.9.3 +source /usr/local/rvm/scripts/rvm + +if [[ -f '/usr/bin/ruby' ]]; then + mv /usr/bin/ruby /usr/bin/ruby-old +fi + +if [[ -f '/usr/bin/gem' ]]; then + mv /usr/bin/gem /usr/bin/gem-old +fi + +ln -s /usr/local/rvm/wrappers/default/ruby /usr/bin/ruby +ln -s /usr/local/rvm/wrappers/default/gem /usr/bin/gem + +gem update --system >/dev/null + +touch '/.puphpet-stuff/install-ruby' + +echo 'Finished install Ruby 1.9.3 using RVM' diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh b/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh index 3f679008fe8..5a73825dd59 100644 --- a/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh +++ b/dev/vagrant/dolibarrdev/puphpet/shell/os-detect.sh @@ -1,36 +1,32 @@ #!/bin/bash -# Try and get debian operating system -# id, codename, and release - TYPE=$(echo "$1" | tr '[A-Z]' '[a-z]') OS=$(uname) ID='unknown' CODENAME='unknown' RELEASE='unknown' +ARCH='unknown' -if [ "${OS}" == 'Linux' ]; then - # detect centos - grep 'centos' /etc/issue -i -q - if [ $? = '0' ]; then - ID='centos' - RELEASE=$(cat /etc/redhat-release | grep -o 'release [0-9]' | cut -d " " -f2) - # could be debian or ubuntu - elif [ $(which lsb_release) ]; then - ID=$(lsb_release -i | cut -f2) - CODENAME=$(lsb_release -c | cut -f2) - RELEASE=$(lsb_release -r | cut -f2) - elif [ -f '/etc/lsb-release' ]; then - ID=$(cat /etc/lsb-release | grep DISTRIB_ID | cut -d "=" -f2) - CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d "=" -f2) - RELEASE=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2) - elif [ -f '/etc/issue' ]; then - ID=$(head -1 /etc/issue | cut -d " " -f1) - if [ -f '/etc/debian_version' ]; then - RELEASE=$(/dev/null -echo 'Finished running update r10k' diff --git a/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh b/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh deleted file mode 100644 index f8c1f5d2256..00000000000 --- a/dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -export DEBIAN_FRONTEND=noninteractive - -VAGRANT_CORE_FOLDER=$(cat '/.puphpet-stuff/vagrant-core-folder.txt') - -OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID) -RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE) -CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME) - -if [[ ! -f '/.puphpet-stuff/update-puppet' ]]; then - if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then - echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" - wget --quiet --tries=5 --connect-timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" - echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" - - dpkg -i "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" >/dev/null - - echo 'Running update-puppet apt-get update' - apt-get update >/dev/null - echo 'Finished running update-puppet apt-get update' - - echo 'Updating Puppet to version 3.4.x' - apt-get install -y puppet-common=3.4.* puppet=3.4.* >/dev/null - apt-mark hold puppet puppet-common >/dev/null - PUPPET_VERSION=$(puppet help | grep 'Puppet v') - echo "Finished updating puppet to latest version: ${PUPPET_VERSION}" - - touch '/.puphpet-stuff/update-puppet' - elif [ "${OS}" == 'centos' ]; then - echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm" - yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm" >/dev/null - echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppet-3.4.3-1.el6.noarch.rpm" - - echo 'Installing/Updating Puppet to version 3.4.x' - yum -y install yum-versionlock puppet >/dev/null - yum versionlock puppet - PUPPET_VERSION=$(puppet help | grep 'Puppet v') - echo "Finished installing/updating puppet to version: ${PUPPET_VERSION}" - - touch '/.puphpet-stuff/update-puppet' - fi -fi From 18f6718e06d48378ebc4cf87cae257253caf0cfc Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 29 Jul 2014 14:06:31 +0200 Subject: [PATCH 344/502] Update expedition.class.php fetch line on expedition in the same order than the customer order --- htdocs/expedition/class/expedition.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index f6a92b91434..8a5d6b7b73e 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1066,6 +1066,7 @@ class Expedition extends CommonObject $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product"; $sql.= " WHERE ed.fk_expedition = ".$this->id; $sql.= " AND ed.fk_origin_line = cd.rowid"; + $sql.= " ORDER BY cd.rang"; dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql = $this->db->query($sql); From 6349e5e4a21a738b295f1059462d6c1cfa22f519 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 29 Jul 2014 15:45:53 +0200 Subject: [PATCH 345/502] Class MouvementStock was not extending CommonObject so error on call_trigger function --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 8219da2b814..9e508f41461 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -28,7 +28,7 @@ /** * Class to manage stock movements */ -class MouvementStock +class MouvementStock extends CommonObject { var $error; var $db; From fada3ca9a2c5947bd53d9209b88a1fe8af30ab9b Mon Sep 17 00:00:00 2001 From: frederic34 Date: Tue, 29 Jul 2014 16:27:34 +0200 Subject: [PATCH 346/502] User must not see invoices if no rights --- htdocs/margin/tabs/productMargins.php | 235 ++++++++++++-------------- htdocs/product/stats/facture.php | 129 +++++++------- 2 files changed, 174 insertions(+), 190 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 49d61013d16..c1881433947 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -128,91 +128,86 @@ if ($id > 0 || ! empty($ref)) print ''; - $sql = "SELECT s.nom, s.rowid as socid, s.code_client,"; - $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; - $sql.= " f.datef, f.paye, f.fk_statut as statut,"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; - $sql.= " sum(d.total_ht) as selling_price,"; - $sql.= $db->ifsql('f.type =2','sum(d.qty *-1)','sum(d.qty)')." as qty,"; - $sql.= $db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,"; - $sql.= $db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge" ; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.fk_statut > 0"; - $sql.= " AND s.entity = ".$conf->entity; - $sql.= " AND d.fk_facture = f.rowid"; - $sql.= " AND d.fk_product =".$object->id; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if (! empty($socid)) $sql.= " AND f.fk_soc = $socid"; - $sql .= " AND d.buy_price_ht IS NOT NULL"; - if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user"; - $sql.= " ORDER BY ".$sortfield." ".$sortorder; - // TODO: calculate total to display then restore pagination - //$sql.= $db->plimit($conf->liste_limit +1, $offset); - dol_syslog('margin:tabs:productMargins.php', LOG_DEBUG); - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); + if ($user->rights->facture->lire) { + $sql = "SELECT s.nom, s.rowid as socid, s.code_client,"; + $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; + $sql.= " f.datef, f.paye, f.fk_statut as statut,"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; + $sql.= " sum(d.total_ht) as selling_price,"; + $sql.= $db->ifsql('f.type =2','sum(d.qty *-1)','sum(d.qty)')." as qty,"; + $sql.= $db->ifsql('f.type =2','sum(d.qty * d.buy_price_ht *-1)','sum(d.qty * d.buy_price_ht)')." as buying_price,"; + $sql.= $db->ifsql('f.type =2','sum(-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty)))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge" ; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.fk_statut > 0"; + $sql.= " AND s.entity = ".$conf->entity; + $sql.= " AND d.fk_facture = f.rowid"; + $sql.= " AND d.fk_product =".$object->id; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if (! empty($socid)) $sql.= " AND f.fk_soc = $socid"; + $sql .= " AND d.buy_price_ht IS NOT NULL"; + if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; + $sql.= " GROUP BY s.nom, s.rowid, s.code_client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user"; + $sql.= " ORDER BY ".$sortfield." ".$sortorder; + // TODO: calculate total to display then restore pagination + //$sql.= $db->plimit($conf->liste_limit +1, $offset); + dol_syslog('margin:tabs:productMargins.php', LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',0,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',0,0,''); - $i = 0; - print "
'; } - $ret.=$object->$fieldref; + $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) { $ret.=' '.$morehtmlref; From 3011ecf6dffeecd1fb48da0190aaf502d21c9f84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 19:55:12 +0200 Subject: [PATCH 332/502] Fix: PHPCS --- ...etect.class.php => mobiledetect.class.php} | 62 ++++++++++--------- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 34 insertions(+), 30 deletions(-) rename htdocs/core/class/{MobileDetect.class.php => mobiledetect.class.php} (98%) diff --git a/htdocs/core/class/MobileDetect.class.php b/htdocs/core/class/mobiledetect.class.php similarity index 98% rename from htdocs/core/class/MobileDetect.class.php rename to htdocs/core/class/mobiledetect.class.php index 1f1795f51ea..107a13f47e3 100644 --- a/htdocs/core/class/MobileDetect.class.php +++ b/htdocs/core/class/mobiledetect.class.php @@ -23,6 +23,9 @@ * @version 2.8.3 */ +/** + * Class to manage detection of type of terminal (classic, tablet, mobile) + */ class MobileDetect { /** @@ -548,10 +551,8 @@ class MobileDetect * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT * from the $headers array instead. */ - public function __construct( - array $headers = null, - $userAgent = null - ){ + public function __construct(array $headers = null, $userAgent = null) + { $this->setHttpHeaders($headers); $this->setUserAgent($userAgent); } @@ -572,8 +573,9 @@ class MobileDetect /** * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. * - * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract - * the headers. The default null is left for backwards compatibilty. + * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract + * the headers. The default null is left for backwards compatibilty. + * @return void */ public function setHttpHeaders($httpHeaders = null) { @@ -691,10 +693,11 @@ class MobileDetect * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. * - * @deprecated since version 2.6.9 + * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default + * parameter is null which will default to self::DETECTION_TYPE_MOBILE. + * @return void * - * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default - * parameter is null which will default to self::DETECTION_TYPE_MOBILE. + * @deprecated since version 2.6.9 */ public function setDetectionType($type = null) { @@ -869,11 +872,12 @@ class MobileDetect /** * Magic overloading method. * - * @method boolean is[...]() - * @param string $name - * @param array $arguments + * @param string $name Name + * @param array $arguments Arguments * @return mixed + * * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' + * @method boolean is[...]() */ public function __call($name, $arguments) { @@ -915,9 +919,9 @@ class MobileDetect * If the key is found the try to match the corresponding * regex agains the User-Agent. * - * @param string $key - * @param null $userAgent deprecated - * @return mixed + * @param string $key Key + * @param string $userAgent deprecated + * @return mixed */ protected function matchUAAgainstKey($key, $userAgent = null) { @@ -941,8 +945,9 @@ class MobileDetect /** * Check if the device is mobile. * Returns true if any type of mobile device detected, including special ones - * @param null $userAgent deprecated - * @param null $httpHeaders deprecated + * + * @param string $userAgent deprecated + * @param string $httpHeaders deprecated * @return bool */ public function isMobile($userAgent = null, $httpHeaders = null) @@ -990,12 +995,13 @@ class MobileDetect /** * This method checks for a certain property in the * userAgent. - * @todo: The httpHeaders part is not yet used. * - * @param string $key - * @param string $userAgent deprecated - * @param string $httpHeaders deprecated + * @param string $key key + * @param string $userAgent deprecated + * @param string $httpHeaders deprecated * @return bool|int|null + * + * @todo: The httpHeaders part is not yet used. */ public function is($key, $userAgent = null, $httpHeaders = null) { @@ -1018,13 +1024,12 @@ class MobileDetect * because of the diversity of devices, vendors and * their conventions in representing the User-Agent or * the HTTP headers. - * * This method will be used to check custom regexes against * the User-Agent string. * - * @param $regex - * @param string $userAgent - * @return bool + * @param string $regex Regex + * @param string $userAgent User agent + * @return bool * * @todo: search in the HTTP headers too. */ @@ -1049,11 +1054,10 @@ class MobileDetect /** * Prepare the version number. * - * @todo Remove the error supression from str_replace() call. - * - * @param string $ver The string version, like "2.6.21.2152"; - * + * @param string $ver The string version, like "2.6.21.2152"; * @return float + * + * @todo Remove the error supression from str_replace() call. */ public function prepareVersionNo($ver) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index caa812a82a6..554f29d1f58 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -156,7 +156,7 @@ function getBrowserInfo() $firefox=0; if (in_array($name,array('firefox','iceweasel'))) $firefox=1; - include_once DOL_DOCUMENT_ROOT.'/core/class/MobileDetect.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/mobiledetect.class.php'; $detectmobile=new MobileDetect(); $phone=$detectmobile->isMobile(); $tablet=$detectmobile->isTablet(); From f8b6b004cd3e91309fb7b528fc15adaab8bdd0f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 19:58:29 +0200 Subject: [PATCH 333/502] Fix: [ bug #1541 ] Surveys menu is not shown up if Export/Import module is not enabled. --- htdocs/core/menus/standard/eldy.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8ea68ea4146..294f1db1ac7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -217,9 +217,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) // Tools - $tmpentry=array('enabled'=>(! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled)), - 'perms'=>(! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run)), - 'module'=>'mailing|export|import'); + $tmpentry=array('enabled'=>(! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled)), + 'perms'=>(! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read)), + 'module'=>'mailing|export|import|opensurvey'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { From 910eeee4b82347a3571480f5b51c8b691a3126f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 20:00:46 +0200 Subject: [PATCH 334/502] Fix: [ bug #1541 ] Surveys menu is not shown up if Export/Import module is not enabled. --- htdocs/core/menus/init_menu_auguria.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 48584247bbc..67d303b0b19 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -15,7 +15,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|facture|deplacement|don|tax', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->deplacement->enabled || $conf->don->enabled || $conf->tax->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->deplacement->lire || $user->rights->don->lire || $user->rights->tax->charges->lire', '', 2, 50, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run', '', 2, 90, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import|opensurvey', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read', '', 2, 90, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('boutique', '! empty($conf->boutique->enabled)', 11__+MAX_llx_menu__, __HANDLER__, 'top', 'shop', '', 0, '/boutique/index.php?mainmenu=shop&leftmenu=', 'OSCommerce', -1, 'shop', '', '', 0, 100, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm', '$conf->holiday->enabled || $conf->deplacement->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/compta/hrm.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->holiday->write || $user->rights->deplacement->lire', '', 0, 80, __ENTITY__); From c20256f7024a16ce1944a8a587da246d37498816 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 20:12:01 +0200 Subject: [PATCH 335/502] Fix: [ bug #1542 ] extrafields.class.php, showOutputField wrong translate. --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c9aa1405ff7..56b243cd7ec 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -978,7 +978,7 @@ class ExtraFields { foreach ($fields_label as $field_toshow) { - $translabel=$langs->trans($field_toshow); + $translabel=$langs->trans($obj->field_toshow); if ($translabel!=$field_toshow) { $value.=dol_trunc($translabel,18).' '; }else { From bcd441cc1e8d61abc77d45124aeed8a194fda7e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 28 Jul 2014 20:30:31 +0200 Subject: [PATCH 336/502] Fix: Bad url for cron Fix: must use html syntax, not xml --- htdocs/core/lib/cron.lib.php | 4 ++-- htdocs/cron/list.php | 8 ++++---- htdocs/public/cron/cron_run_jobs.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 34a21c83dab..79e23e90089 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -93,10 +93,10 @@ function dol_print_cron_urls() // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; - $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; + $url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; - $url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; + $url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 453de0d8515..dd9eb8b6289 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -123,13 +123,13 @@ print $langs->trans('CronInfo'); if ($action == 'delete') { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); - + } if ($action == 'execute') { print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); - + } // liste des jobs creer @@ -218,13 +218,13 @@ if (count($object->lines) > 0) print $langs->trans('CronObject').':'. $line->objectname.'
'; print $langs->trans('CronMethod').':'. $line->methodename; if(!empty($line->params)) { - print '
'.$langs->trans('CronArgs').':'. $line->params; + print '
'.$langs->trans('CronArgs').':'. $line->params; } }elseif ($line->jobtype=='command') { print $langs->trans('CronCommand').':'. dol_trunc($line->command); if(!empty($line->params)) { - print '
'.$langs->trans('CronArgs').':'. $line->params; + print '
'.$langs->trans('CronArgs').':'. $line->params; } } print '
"; + $i = 0; + print '
'; - print ''; - print_liste_field_titre($langs->trans("Invoice"),$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$object->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$object->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - if (! empty($conf->global->DISPLAY_MARK_RATES)) - print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$object->id,'align="right"',$sortfield,$sortorder); - print "\n"; + print ''; + print_liste_field_titre($langs->trans("Invoice"),$_SERVER["PHP_SELF"],"f.facnumber","","&id=".$object->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$object->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$object->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$object->id,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Margin"),$_SERVER["PHP_SELF"],"marge","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) + print_liste_field_titre($langs->trans("MarginRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + if (! empty($conf->global->DISPLAY_MARK_RATES)) + print_liste_field_titre($langs->trans("MarkRate"),$_SERVER["PHP_SELF"],"","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$object->id,'align="right"',$sortfield,$sortorder); + print "\n"; - $cumul_achat = 0; - $cumul_vente = 0; - $cumul_qty = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); + $cumul_achat = 0; + $cumul_vente = 0; + $cumul_qty = 0; + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) - { - $var=True; - while ($i < $num /*&& $i < $conf->liste_limit*/) - { - $objp = $db->fetch_object($result); - $var=!$var; + if ($num > 0) { + $var=True; + while ($i < $num /*&& $i < $conf->liste_limit*/) { + $objp = $db->fetch_object($result); + $var=!$var; - if ($objp->marge < 0) - { - $marginRate = ($objp->buying_price != 0)?-1*(100 * $objp->marge / $objp->buying_price):'' ; - $markRate = ($objp->selling_price != 0)?-1*(100 * $objp->marge / $objp->selling_price):'' ; - } - else - { - $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; - $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; - } + if ($objp->marge < 0) { + $marginRate = ($objp->buying_price != 0)?-1*(100 * $objp->marge / $objp->buying_price):'' ; + $markRate = ($objp->selling_price != 0)?-1*(100 * $objp->marge / $objp->selling_price):'' ; + } else { + $marginRate = ($objp->buying_price != 0)?(100 * $objp->marge / $objp->buying_price):'' ; + $markRate = ($objp->selling_price != 0)?(100 * $objp->marge / $objp->selling_price):'' ; + } - print ""; - print '\n"; - print ''; - print "\n"; + print ''; + print '\n"; + print ''; + print "\n"; print ""; print "\n"; @@ -224,52 +219,46 @@ if ($id > 0 || ! empty($ref)) if (! empty($conf->global->DISPLAY_MARK_RATES)) print "\n"; print ''; - print "\n"; - $i++; - $cumul_achat += $objp->buying_price; - $cumul_vente += $objp->selling_price; - $cumul_qty += $objp->qty; - } - } + print "\n"; + $i++; + $cumul_achat += $objp->buying_price; + $cumul_vente += $objp->selling_price; + $cumul_qty += $objp->qty; + } + } - // affichage totaux marges - $var=!$var; - $totalMargin = $cumul_vente - $cumul_achat; - if ($totalMargin < 0) - { - $marginRate = ($cumul_achat != 0)?-1*(100 * $totalMargin / $cumul_achat):''; - $markRate = ($cumul_vente != 0)?-1*(100 * $totalMargin / $cumul_vente):''; - } - else - { - $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; - $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; - } - print ''; - print '"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print "\n"; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - print "\n"; - print ''; - print "\n"; - } - else - { - dol_print_error($db); - } - print "
'; - $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; - print $invoicestatic->getNomUrl(1); - print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'".$objp->code_client."
'; + $invoicestatic->id=$objp->facid; + $invoicestatic->ref=$objp->facnumber; + print $invoicestatic->getNomUrl(1); + print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'".$objp->code_client.""; print dol_print_date($db->jdate($objp->datef),'day')."".price($objp->selling_price, null, null, null, null, $rounding)."".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'
'.$langs->trans('TotalMargin')."".price($cumul_vente, null, null, null, null, $rounding)."".price($cumul_achat, null, null, null, null, $rounding)."".price($cumul_qty, null, null, null, null, $rounding)."".price($totalMargin, null, null, null, null, $rounding)."".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")." 
"; - print '
'; - $db->free($result); - } -} -else -{ - dol_print_error(); + // affichage totaux marges + $var=!$var; + $totalMargin = $cumul_vente - $cumul_achat; + if ($totalMargin < 0) { + $marginRate = ($cumul_achat != 0)?-1*(100 * $totalMargin / $cumul_achat):''; + $markRate = ($cumul_vente != 0)?-1*(100 * $totalMargin / $cumul_vente):''; + } else { + $marginRate = ($cumul_achat != 0)?(100 * $totalMargin / $cumul_achat):''; + $markRate = ($cumul_vente != 0)?(100 * $totalMargin / $cumul_vente):''; + } + print '
'.$langs->trans('TotalMargin')."'.price($cumul_vente, null, null, null, null, $rounding)."'.price($cumul_achat, null, null, null, null, $rounding)."'.price($cumul_qty, null, null, null, null, $rounding)."'.price($totalMargin, null, null, null, null, $rounding)."'.(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")." 
"; + print '
'; + } else { + dol_print_error($db); + } + $db->free($result); + } + } +} else { + dol_print_error(); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index dc65764defd..6f717dd4e73 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -120,80 +120,75 @@ if ($id > 0 || ! empty($ref)) print ''; - $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; - $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; - $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; - if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND d.fk_facture = f.rowid"; - $sql.= " AND d.fk_product =".$product->id; - if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND f.fk_soc = $socid"; - $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= $db->plimit($conf->liste_limit +1, $offset); + if ($user->rights->facture->lire) { + $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; + $sql.= " f.facnumber, f.total as total_ht,"; + $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; + if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.fk_soc = s.rowid"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND d.fk_facture = f.rowid"; + $sql.= " AND d.fk_product =".$product->id; + if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql.= " AND f.fk_soc = $socid"; + $sql.= " ORDER BY $sortfield $sortorder "; + $sql.= $db->plimit($conf->liste_limit +1, $offset); - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); + $result = $db->query($sql); + if ($result) { + $num = $db->num_rows($result); - print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,0,''); - $i = 0; - print ""; + $i = 0; + print '
'; - print ''; - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$product->id,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$product->id,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&id=".$product->id,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$product->id,'align="right"',$sortfield,$sortorder); - print "\n"; + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","&id=".$product->id,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateInvoice"),$_SERVER["PHP_SELF"],"f.datef","","&id=".$product->id,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"],"d.qty","","&id=".$product->id,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&id=".$product->id,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.paye,f.fk_statut","","&id=".$product->id,'align="right"',$sortfield,$sortorder); + print "\n"; - if ($num > 0) - { - $var=True; - while ($i < $num && $i < $conf->liste_limit) - { - $objp = $db->fetch_object($result); - $var=!$var; + if ($num > 0) { + $var=True; + while ($i < $num && $i < $conf->liste_limit) { + $objp = $db->fetch_object($result); + $var=!$var; - print ""; - print '\n"; - print ''; - print "\n"; - print ""; - print "\n"; - print "\n"; - print ''; - print "\n"; - $i++; - } - } - } - else - { - dol_print_error($db); - } - print "
'; - $invoicestatic->id=$objp->facid; - $invoicestatic->ref=$objp->facnumber; - print $invoicestatic->getNomUrl(1); - print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'".$objp->code_client.""; - print dol_print_date($db->jdate($objp->datef),'day')."".$objp->qty."".price($objp->total_ht)."'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'
"; - print '
'; - $db->free($result); + print '
'; + $invoicestatic->id=$objp->facid; + $invoicestatic->ref=$objp->facnumber; + print $invoicestatic->getNomUrl(1); + print "'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'".$objp->code_client."'; + print dol_print_date($db->jdate($objp->datef),'day')."'.$objp->qty."'.price($objp->total_ht)."'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'
"; + print '
'; + } else { + dol_print_error($db); + } + $db->free($result); + } } -} -else -{ +} else { dol_print_error(); } From 6226d39cdad111863b85091e9b0ef61a6c9ad79b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jul 2014 19:45:48 +0200 Subject: [PATCH 347/502] Fix: Pb when option javascript disabled. --- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 3 ++- htdocs/core/lib/agenda.lib.php | 11 +++++++++-- htdocs/resource/class/html.formresource.class.php | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 56b243cd7ec..fe6b7474642 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -673,7 +673,7 @@ class ExtraFields elseif ($type == 'select') { $out = ''; - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8cb0a344e43..ebe0f143a93 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -804,7 +804,7 @@ class Form $resql=$this->db->query($sql); if ($resql) { - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); @@ -1008,6 +1008,7 @@ class Form if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo && ! $options_only) { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 8ea437dab54..048561b34e5 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -77,11 +77,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; //print '  '; print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); - print ajax_combobox('usertodo'); + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + print ajax_combobox('usertodo'); + } print '   '.$langs->trans("or") . ' '; print $langs->trans("ActionsForUsersGroup").'   '; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); - print ajax_combobox('usergroup'); + if (! empty($conf->use_javascript_ajax)) + { + print ajax_combobox('usergroup'); + } print '
'; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object @@ -225,7 +225,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (! empty($contents[$i][$j]['logo'])) { $logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']); - print img_object($langs->trans("Show"),$logo); + print img_object(':'.$langs->trans("Show"),$logo); } $maxlength=$MAXLENGTHBOX; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 554f29d1f58..b5316f27bea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1785,7 +1785,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo /** * Show picto whatever it's its name (generic function) * - * @param string $alt Text on alt and title of image (alt only if param notitle is set to 1) + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show ('filenew', ...) * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img @@ -1842,13 +1842,19 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon } if ($srconly) return $fullpathpicto; - else return ''.dol_escape_htmltag($alt).''; + else + { + $tmparray=explode(':',$alt); + $alt=$tmparray[0]; + $title=empty($tmparray[1])?$alt:$tmparray[1]; + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + } } /** * Show a picto called object_picto (generic function) * - * @param string $alt Text of alt on image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) * For external modules use imagename@mymodule to search into directory "img" of module. * @param string $options Add more attribute on img tag (ie: class="datecallink") @@ -1864,7 +1870,7 @@ function img_object($alt, $picto, $options = '', $pictoisfullpath = false) /** * Show picto (generic function) * - * @param string $alt Text on alt and title of image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $options Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path @@ -1896,7 +1902,7 @@ function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0) /** * Show logo action * - * @param string $alt Text for image alt and title ('default', ...) + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $numaction Action to show * @return string Return an img tag */ @@ -1919,7 +1925,7 @@ function img_action($alt, $numaction) /** * Show pdf logo * - * @param string $alt Texte sur le alt de l'image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px * @return string Retourne tag img */ @@ -1935,7 +1941,7 @@ function img_pdf($alt = 'default', $size = 3) /** * Show logo + * - * @param string $alt Texte sur le alt de l'image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return tag img */ function img_edit_add($alt = 'default') @@ -1949,7 +1955,7 @@ function img_edit_add($alt = 'default') /** * Show logo - * - * @param string $alt Texte sur le alt de l'image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Retourne tag img */ function img_edit_remove($alt = 'default') @@ -1964,7 +1970,7 @@ function img_edit_remove($alt = 'default') /** * Show logo editer/modifier fiche * - * @param string $alt Texte sur le alt de l'image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img * @return string Retourne tag img @@ -1981,7 +1987,7 @@ function img_edit($alt = 'default', $float = 0, $other = '') /** * Show logo view card * - * @param string $alt Texte sur le alt de l'image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img * @return string Retourne tag img @@ -2000,7 +2006,7 @@ function img_view($alt = 'default', $float = 0, $other = '') /** * Show delete logo * - * @param string $alt Text on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ @@ -2016,7 +2022,7 @@ function img_delete($alt = 'default', $other = '') /** * Show printer logo * - * @param string $alt Text on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ @@ -2050,7 +2056,7 @@ function img_help($usehelpcursor = 1, $usealttitle = 1) /** * Show info logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_info($alt = 'default') @@ -2065,7 +2071,7 @@ function img_info($alt = 'default') /** * Show warning logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $float If we must add style "float: right" * @return string Return img tag */ @@ -2081,7 +2087,7 @@ function img_warning($alt = 'default', $float = 0) /** * Show error logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_error($alt = 'default') @@ -2096,7 +2102,7 @@ function img_error($alt = 'default') /** * Show next logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_next($alt = 'default') @@ -2111,7 +2117,7 @@ function img_next($alt = 'default') /** * Show previous logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_previous($alt = 'default') @@ -2126,7 +2132,7 @@ function img_previous($alt = 'default') /** * Show down arrow logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ @@ -2142,7 +2148,7 @@ function img_down($alt = 'default', $selected = 0) /** * Show top arrow logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ @@ -2158,7 +2164,7 @@ function img_up($alt = 'default', $selected = 0) /** * Show left arrow logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag @@ -2175,7 +2181,7 @@ function img_left($alt = 'default', $selected = 0, $options='') /** * Show right arrow logo * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag @@ -2193,7 +2199,7 @@ function img_right($alt = 'default', $selected = 0, $options='') * Show tick logo if allowed * * @param string $allow Allow - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_allow($allow, $alt = 'default') @@ -2212,7 +2218,7 @@ function img_allow($allow, $alt = 'default') * Show MIME img of a file * * @param string $file Filename - * @param string $alt Alternate text to show on img mous hover + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ function img_mime($file, $alt = '') @@ -2232,7 +2238,7 @@ function img_mime($file, $alt = '') * Show phone logo. * Use img_picto instead. * - * @param string $alt Text to show on alt image + * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $option Option * @return string Return img tag * @deprecated diff --git a/htdocs/index.php b/htdocs/index.php index d18c05d4f12..6dbccde9cf0 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -256,7 +256,7 @@ if (empty($user->societe_id)) $text=$langs->trans($titres[$key]); print ''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 58d3a27f834..f306b26eb28 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -221,7 +221,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 81c9185c68f..e701a4b9384 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -222,7 +222,7 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 98779836576..56d822876a0 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -221,7 +221,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 0029866b75a..bca47dd9460 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -337,7 +337,7 @@ class box_graph_product_distribution extends ModeleBoxes } $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 61e83f3cd60..8efa4be54a8 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -227,7 +227,7 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index b7333602bab..ece19fe222c 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -225,7 +225,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (! empty($contents[$i][$j]['logo'])) { $logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']); - print img_object(':'.$langs->trans("Show"),$logo); + print img_object($langs->trans("Show"),$logo); } $maxlength=$MAXLENGTHBOX; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5316f27bea..f658d2550dc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1785,7 +1785,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo /** * Show picto whatever it's its name (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on title and alt. If text is "TextA:TextB", use Text A on alt and Text B on title. Alt only if param notitle is set to 1. * @param string $picto Name of image file to show ('filenew', ...) * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img @@ -1798,7 +1798,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo * @return string Return img tag * @see #img_object, #img_picto_common */ -function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { global $conf; @@ -1844,9 +1844,9 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon if ($srconly) return $fullpathpicto; else { - $tmparray=explode(':',$alt); - $alt=$tmparray[0]; - $title=empty($tmparray[1])?$alt:$tmparray[1]; + $tmparray=explode(':',$titlealt); + $title=$tmparray[0]; + $alt=empty($tmparray[1])?'':$tmparray[1]; return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } @@ -1854,7 +1854,7 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon /** * Show a picto called object_picto (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) * For external modules use imagename@mymodule to search into directory "img" of module. * @param string $options Add more attribute on img tag (ie: class="datecallink") @@ -1862,22 +1862,22 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon * @return string Return img tag * @see #img_picto, #img_picto_common */ -function img_object($alt, $picto, $options = '', $pictoisfullpath = false) +function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false) { - return img_picto($alt, 'object_'.$picto, $options, $pictoisfullpath); + return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath); } /** * Show picto (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $options Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0) +function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0) { global $conf; @@ -1896,141 +1896,141 @@ function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0) } } - return img_picto($alt, $path, $options, 1); + return img_picto($titlealt, $path, $options, 1); } /** * Show logo action * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $numaction Action to show * @return string Return an img tag */ -function img_action($alt, $numaction) +function img_action($titlealt, $numaction) { global $conf, $langs; - if ($alt == 'default') + if ($titlealt == 'default') { - if ($numaction == -1) $alt = $langs->transnoentitiesnoconv('ChangeDoNotContact'); - if ($numaction == 0) $alt = $langs->transnoentitiesnoconv('ChangeNeverContacted'); - if ($numaction == 1) $alt = $langs->transnoentitiesnoconv('ChangeToContact'); - if ($numaction == 2) $alt = $langs->transnoentitiesnoconv('ChangeContactInProcess'); - if ($numaction == 3) $alt = $langs->transnoentitiesnoconv('ChangeContactDone'); + if ($numaction == -1) $titlealt = $langs->transnoentitiesnoconv('ChangeDoNotContact'); + if ($numaction == 0) $titlealt = $langs->transnoentitiesnoconv('ChangeNeverContacted'); + if ($numaction == 1) $titlealt = $langs->transnoentitiesnoconv('ChangeToContact'); + if ($numaction == 2) $titlealt = $langs->transnoentitiesnoconv('ChangeContactInProcess'); + if ($numaction == 3) $titlealt = $langs->transnoentitiesnoconv('ChangeContactDone'); } - return img_picto($alt, 'stcomm'.$numaction.'.png'); + return img_picto($titlealt, 'stcomm'.$numaction.'.png'); } /** * Show pdf logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px * @return string Retourne tag img */ -function img_pdf($alt = 'default', $size = 3) +function img_pdf($titlealt = 'default', $size = 3) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Show'); + if ($titlealt == 'default') $titlealt = $langs->trans('Show'); - return img_picto($alt, 'pdf'.$size.'.png'); + return img_picto($titlealt, 'pdf'.$size.'.png'); } /** * Show logo + * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return tag img */ -function img_edit_add($alt = 'default') +function img_edit_add($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Add'); + if ($titlealt == 'default') $titlealt = $langs->trans('Add'); - return img_picto($alt, 'edit_add.png'); + return img_picto($titlealt, 'edit_add.png'); } /** * Show logo - * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @return string Retourne tag img + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @return string Return tag img */ -function img_edit_remove($alt = 'default') +function img_edit_remove($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Remove'); + if ($titlealt == 'default') $titlealt = $langs->trans('Remove'); - return img_picto($alt, 'edit_remove.png'); + return img_picto($titlealt, 'edit_remove.png'); } /** * Show logo editer/modifier fiche * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img - * @return string Retourne tag img + * @return string Return tag img */ -function img_edit($alt = 'default', $float = 0, $other = '') +function img_edit($titlealt = 'default', $float = 0, $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Modify'); + if ($titlealt == 'default') $titlealt = $langs->trans('Modify'); - return img_picto($alt, 'edit.png', ($float ? 'style="float: right"' : $other)); + return img_picto($titlealt, 'edit.png', ($float ? 'style="float: right"' : $other)); } /** * Show logo view card * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param float $float Si il faut y mettre le style "float: right" + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img - * @return string Retourne tag img + * @return string Return tag img */ -function img_view($alt = 'default', $float = 0, $other = '') +function img_view($titlealt = 'default', $float = 0, $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('View'); + if ($titlealt == 'default') $titlealt = $langs->trans('View'); $options = ($float ? 'style="float: right" ' : '').$other; - return img_picto($alt, 'view.png', $options); + return img_picto($titlealt, 'view.png', $options); } /** * Show delete logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ -function img_delete($alt = 'default', $other = '') +function img_delete($titlealt = 'default', $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Delete'); + if ($titlealt == 'default') $titlealt = $langs->trans('Delete'); - return img_picto($alt, 'delete.png', $other); + return img_picto($titlealt, 'delete.png', $other); } /** * Show printer logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ -function img_printer($alt = "default", $other='') +function img_printer($titlealt = "default", $other='') { global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Print"); - return img_picto($alt,'printer.png',$other); + if ($titlealt=="default") $titlealt=$langs->trans("Print"); + return img_picto($titlealt,'printer.png',$other); } /** @@ -2056,159 +2056,159 @@ function img_help($usehelpcursor = 1, $usealttitle = 1) /** * Show info logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_info($alt = 'default') +function img_info($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Informations'); + if ($titlealt == 'default') $titlealt = $langs->trans('Informations'); - return img_picto($alt, 'info.png'); + return img_picto($titlealt, 'info.png'); } /** * Show warning logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $float If we must add style "float: right" * @return string Return img tag */ -function img_warning($alt = 'default', $float = 0) +function img_warning($titlealt = 'default', $float = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Warning'); + if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); - return img_picto($alt, 'warning.png', ($float ? 'style="float: right"' : '')); + return img_picto($titlealt, 'warning.png', ($float ? 'style="float: right"' : '')); } /** * Show error logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_error($alt = 'default') +function img_error($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Error'); + if ($titlealt == 'default') $titlealt = $langs->trans('Error'); - return img_picto($alt, 'error.png'); + return img_picto($titlealt, 'error.png'); } /** * Show next logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_next($alt = 'default') +function img_next($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Next'); + if ($titlealt == 'default') $titlealt = $langs->trans('Next'); - return img_picto($alt, 'next.png'); + return img_picto($titlealt, 'next.png'); } /** * Show previous logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_previous($alt = 'default') +function img_previous($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Previous'); + if ($titlealt == 'default') $titlealt = $langs->trans('Previous'); - return img_picto($alt, 'previous.png'); + return img_picto($titlealt, 'previous.png'); } /** * Show down arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ -function img_down($alt = 'default', $selected = 0) +function img_down($titlealt = 'default', $selected = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Down'); + if ($titlealt == 'default') $titlealt = $langs->trans('Down'); - return img_picto($alt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"'); + return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"'); } /** * Show top arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ -function img_up($alt = 'default', $selected = 0) +function img_up($titlealt = 'default', $selected = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Up'); + if ($titlealt == 'default') $titlealt = $langs->trans('Up'); - return img_picto($alt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"'); + return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"'); } /** * Show left arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_left($alt = 'default', $selected = 0, $options='') +function img_left($titlealt = 'default', $selected = 0, $options='') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Left'); + if ($titlealt == 'default') $titlealt = $langs->trans('Left'); - return img_picto($alt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); } /** * Show right arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_right($alt = 'default', $selected = 0, $options='') +function img_right($titlealt = 'default', $selected = 0, $options='') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Right'); + if ($titlealt == 'default') $titlealt = $langs->trans('Right'); - return img_picto($alt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); } /** * Show tick logo if allowed * * @param string $allow Allow - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_allow($allow, $alt = 'default') +function img_allow($allow, $titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Active'); + if ($titlealt == 'default') $titlealt = $langs->trans('Active'); - if ($allow == 1) return img_picto($alt, 'tick.png'); + if ($allow == 1) return img_picto($titlealt, 'tick.png'); return '-'; } @@ -2218,19 +2218,19 @@ function img_allow($allow, $alt = 'default') * Show MIME img of a file * * @param string $file Filename - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_mime($file, $alt = '') +function img_mime($file, $titlealt = '') { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $mimetype = dol_mimetype($file, '', 1); $mimeimg = dol_mimetype($file, '', 2); - if (empty($alt)) $alt = 'Mime type: '.$mimetype; + if (empty($titlealt)) $titlealt = 'Mime type: '.$mimetype; - return img_picto_common($alt, 'mime/'.$mimeimg); + return img_picto_common($titlealt, 'mime/'.$mimeimg); } @@ -2238,21 +2238,21 @@ function img_mime($file, $alt = '') * Show phone logo. * Use img_picto instead. * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $option Option * @return string Return img tag * @deprecated */ -function img_phone($alt = 'default', $option = 0) +function img_phone($titlealt = 'default', $option = 0) { global $conf,$langs; - if ($alt == 'default') $alt = $langs->trans('Call'); + if ($titlealt == 'default') $titlealt = $langs->trans('Call'); if ($option == 1) $img = 'call'; else $img = 'call_out'; - return img_picto($alt, $img); + return img_picto($titlealt, $img); } diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index 0ed80121042..1986ae1cdf7 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -357,15 +357,15 @@ if($cp_events == 1) { print '
'.$langs->trans('DurationDays').'
'; $toprightmenu.='
'."\n"; print "\n"; unset($form); @@ -1540,7 +1536,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname'); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname', 'T'); } if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire) @@ -1553,7 +1549,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) { $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall'); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P'); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) @@ -1566,7 +1562,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall'); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', 'M'); } // Execute hook printSearchForm @@ -1797,9 +1793,10 @@ function getHelpParamFor($helppagename,$langs) * @param string $title Title search area * @param string $htmlmodesearch Value to set into parameter "mode_search" ('soc','contact','products','member',...) * @param string $htmlinputname Field Name input form + * @param string $accesskey Accesskey * @return string */ -function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname) +function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname,$accesskey='') { global $conf,$langs; @@ -1815,7 +1812,8 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput $ret.=''; $ret.=''; $ret.=''; - $ret.='global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; $ret.=' name="'.$htmlinputname.'" id="'.$htmlinputname.'" size="10" />'; From a12f4da9788b381d393f2867ddae71e73a064ae7 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 30 Jul 2014 05:49:16 +0200 Subject: [PATCH 351/502] Accountancy :: account_parent must be an int (again) --- htdocs/install/mysql/data/llx_accounting.sql | 894 ++++++++++--------- 1 file changed, 454 insertions(+), 440 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 81ba988cc7e..6c19c76f2a4 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -34,453 +34,467 @@ delete from llx_accounting_system; -- Descriptif des plans comptables FR PCG99-ABREGE -- -insert into llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (1,'PCG99-ABREGE', 1, 'The simple accountancy french plan', 1); +INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (1,'PCG99-ABREGE', 1, 'The simple accountancy french plan', 1); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 1,'PCG99-ABREGE','CAPIT', 'CAPITAL', '101', '1', 'Capital', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 2,'PCG99-ABREGE','CAPIT', 'XXXXXX', '105', '1', 'Ecarts de réévaluation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 3,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1061', '1', 'Réserve légale', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 4,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1063', '1', 'Réserves statutaires ou contractuelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 5,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1064', '1', 'Réserves réglementées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 6,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1068', '1', 'Autres réserves', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 7,'PCG99-ABREGE','CAPIT', 'XXXXXX', '108', '1', 'Compte de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 8,'PCG99-ABREGE','CAPIT', 'XXXXXX', '12', '1', 'Résultat de l''exercice', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 9,'PCG99-ABREGE','CAPIT', 'XXXXXX', '145', '1', 'Amortissements dérogatoires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 10,'PCG99-ABREGE','CAPIT', 'XXXXXX', '146', '1', 'Provision spéciale de réévaluation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 11,'PCG99-ABREGE','CAPIT', 'XXXXXX', '147', '1', 'Plus-values réinvesties', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 12,'PCG99-ABREGE','CAPIT', 'XXXXXX', '148', '1', 'Autres provisions réglementées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 13,'PCG99-ABREGE','CAPIT', 'XXXXXX', '15', '1', 'Provisions pour risques et charges', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 14,'PCG99-ABREGE','CAPIT', 'XXXXXX', '16', '1', 'Emprunts et dettes assimilees', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 15,'PCG99-ABREGE','IMMO', 'XXXXXX', '20', '2', 'Immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 16,'PCG99-ABREGE','IMMO', 'XXXXXX', '201','20', 'Frais d''établissement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 17,'PCG99-ABREGE','IMMO', 'XXXXXX', '206','20', 'Droit au bail', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 18,'PCG99-ABREGE','IMMO', 'XXXXXX', '207','20', 'Fonds commercial', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 19,'PCG99-ABREGE','IMMO', 'XXXXXX', '208','20', 'Autres immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 20,'PCG99-ABREGE','IMMO', 'XXXXXX', '21', '2', 'Immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 21,'PCG99-ABREGE','IMMO', 'XXXXXX', '23', '2', 'Immobilisations en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 22,'PCG99-ABREGE','IMMO', 'XXXXXX', '27', '2', 'Autres immobilisations financieres', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 23,'PCG99-ABREGE','IMMO', 'XXXXXX', '280', '2', 'Amortissements des immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 24,'PCG99-ABREGE','IMMO', 'XXXXXX', '281', '2', 'Amortissements des immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 25,'PCG99-ABREGE','IMMO', 'XXXXXX', '290', '2', 'Provisions pour dépréciation des immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 26,'PCG99-ABREGE','IMMO', 'XXXXXX', '291', '2', 'Provisions pour dépréciation des immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 27,'PCG99-ABREGE','IMMO', 'XXXXXX', '297', '2', 'Provisions pour dépréciation des autres immobilisations financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 28,'PCG99-ABREGE','STOCK', 'XXXXXX', '31', '3', 'Matieres premières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 29,'PCG99-ABREGE','STOCK', 'XXXXXX', '32', '3', 'Autres approvisionnements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 30,'PCG99-ABREGE','STOCK', 'XXXXXX', '33', '3', 'En-cours de production de biens', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 31,'PCG99-ABREGE','STOCK', 'XXXXXX', '34', '3', 'En-cours de production de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 32,'PCG99-ABREGE','STOCK', 'XXXXXX', '35', '3', 'Stocks de produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 33,'PCG99-ABREGE','STOCK', 'XXXXXX', '37', '3', 'Stocks de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 34,'PCG99-ABREGE','STOCK', 'XXXXXX', '391', '3', 'Provisions pour dépréciation des matières premières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 35,'PCG99-ABREGE','STOCK', 'XXXXXX', '392', '3', 'Provisions pour dépréciation des autres approvisionnements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 36,'PCG99-ABREGE','STOCK', 'XXXXXX', '393', '3', 'Provisions pour dépréciation des en-cours de production de biens', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 37,'PCG99-ABREGE','STOCK', 'XXXXXX', '394', '3', 'Provisions pour dépréciation des en-cours de production de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 38,'PCG99-ABREGE','STOCK', 'XXXXXX', '395', '3', 'Provisions pour dépréciation des stocks de produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 39,'PCG99-ABREGE','STOCK', 'XXXXXX', '397', '3', 'Provisions pour dépréciation des stocks de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 40,'PCG99-ABREGE','TIERS', 'SUPPLIER','400', '4', 'Fournisseurs et Comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 41,'PCG99-ABREGE','TIERS', 'XXXXXX', '409', '4', 'Fournisseurs débiteurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 42,'PCG99-ABREGE','TIERS', 'CUSTOMER','410', '4', 'Clients et Comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 43,'PCG99-ABREGE','TIERS', 'XXXXXX', '419', '4', 'Clients créditeurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 44,'PCG99-ABREGE','TIERS', 'XXXXXX', '421', '4', 'Personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 45,'PCG99-ABREGE','TIERS', 'XXXXXX', '428', '4', 'Personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 46,'PCG99-ABREGE','TIERS', 'XXXXXX', '43', '4', 'Sécurité sociale et autres organismes sociaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 47,'PCG99-ABREGE','TIERS', 'XXXXXX', '444', '4', 'Etat - impôts sur bénéfice', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 48,'PCG99-ABREGE','TIERS', 'XXXXXX', '445', '4', 'Etat - Taxes sur chiffre affaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 49,'PCG99-ABREGE','TIERS', 'XXXXXX', '447', '4', 'Autres impôts, taxes et versements assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 50,'PCG99-ABREGE','TIERS', 'XXXXXX', '45', '4', 'Groupe et associes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 51,'PCG99-ABREGE','TIERS', 'XXXXXX', '455','45', 'Associés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 52,'PCG99-ABREGE','TIERS', 'XXXXXX', '46', '4', 'Débiteurs divers et créditeurs divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 53,'PCG99-ABREGE','TIERS', 'XXXXXX', '47', '4', 'Comptes transitoires ou d''attente', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 54,'PCG99-ABREGE','TIERS', 'XXXXXX', '481', '4', 'Charges à répartir sur plusieurs exercices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 55,'PCG99-ABREGE','TIERS', 'XXXXXX', '486', '4', 'Charges constatées d''avance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 56,'PCG99-ABREGE','TIERS', 'XXXXXX', '487', '4', 'Produits constatés d''avance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 57,'PCG99-ABREGE','TIERS', 'XXXXXX', '491', '4', 'Provisions pour dépréciation des comptes de clients', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 58,'PCG99-ABREGE','TIERS', 'XXXXXX', '496', '4', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 59,'PCG99-ABREGE','FINAN', 'XXXXXX', '50', '5', 'Valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 60,'PCG99-ABREGE','FINAN', 'BANK', '51', '5', 'Banques, établissements financiers et assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 61,'PCG99-ABREGE','FINAN', 'CASH', '53', '5', 'Caisse', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 62,'PCG99-ABREGE','FINAN', 'XXXXXX', '54', '5', 'Régies d''avance et accréditifs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 63,'PCG99-ABREGE','FINAN', 'XXXXXX', '58', '5', 'Virements internes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 64,'PCG99-ABREGE','FINAN', 'XXXXXX', '590', '5', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 65,'PCG99-ABREGE','CHARGE','PRODUCT', '60', '6', 'Achats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 66,'PCG99-ABREGE','CHARGE','XXXXXX', '603','60', 'Variations des stocks', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 67,'PCG99-ABREGE','CHARGE','SERVICE', '61', '6', 'Services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 68,'PCG99-ABREGE','CHARGE','XXXXXX', '62', '6', 'Autres services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 69,'PCG99-ABREGE','CHARGE','XXXXXX', '63', '6', 'Impôts, taxes et versements assimiles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 70,'PCG99-ABREGE','CHARGE','XXXXXX', '641', '6', 'Rémunérations du personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 71,'PCG99-ABREGE','CHARGE','XXXXXX', '644', '6', 'Rémunération du travail de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 72,'PCG99-ABREGE','CHARGE','SOCIAL', '645', '6', 'Charges de sécurité sociale et de prévoyance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 73,'PCG99-ABREGE','CHARGE','XXXXXX', '646', '6', 'Cotisations sociales personnelles de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 74,'PCG99-ABREGE','CHARGE','XXXXXX', '65', '6', 'Autres charges de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 75,'PCG99-ABREGE','CHARGE','XXXXXX', '66', '6', 'Charges financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 76,'PCG99-ABREGE','CHARGE','XXXXXX', '67', '6', 'Charges exceptionnelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 77,'PCG99-ABREGE','CHARGE','XXXXXX', '681', '6', 'Dotations aux amortissements et aux provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 78,'PCG99-ABREGE','CHARGE','XXXXXX', '686', '6', 'Dotations aux amortissements et aux provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 79,'PCG99-ABREGE','CHARGE','XXXXXX', '687', '6', 'Dotations aux amortissements et aux provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 80,'PCG99-ABREGE','CHARGE','XXXXXX', '691', '6', 'Participation des salariés aux résultats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 81,'PCG99-ABREGE','CHARGE','XXXXXX', '695', '6', 'Impôts sur les bénéfices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 82,'PCG99-ABREGE','CHARGE','XXXXXX', '697', '6', 'Imposition forfaitaire annuelle des sociétés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 83,'PCG99-ABREGE','CHARGE','XXXXXX', '699', '6', 'Produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 84,'PCG99-ABREGE','PROD', 'PRODUCT', '701', '7', 'Ventes de produits finis', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 85,'PCG99-ABREGE','PROD', 'SERVICE', '706', '7', 'Prestations de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 86,'PCG99-ABREGE','PROD', 'PRODUCT', '707', '7', 'Ventes de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 87,'PCG99-ABREGE','PROD', 'PRODUCT', '708', '7', 'Produits des activités annexes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 88,'PCG99-ABREGE','PROD', 'XXXXXX', '709', '7', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 89,'PCG99-ABREGE','PROD', 'XXXXXX', '713', '7', 'Variation des stocks', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 90,'PCG99-ABREGE','PROD', 'XXXXXX', '72', '7', 'Production immobilisée', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 91,'PCG99-ABREGE','PROD', 'XXXXXX', '73', '7', 'Produits nets partiels sur opérations à long terme', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 92,'PCG99-ABREGE','PROD', 'XXXXXX', '74', '7', 'Subventions d''exploitation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 93,'PCG99-ABREGE','PROD', 'XXXXXX', '75', '7', 'Autres produits de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 94,'PCG99-ABREGE','PROD', 'XXXXXX', '753','75', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 95,'PCG99-ABREGE','PROD', 'XXXXXX', '754','75', 'Ristournes perçues des coopératives', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 96,'PCG99-ABREGE','PROD', 'XXXXXX', '755','75', 'Quotes-parts de résultat sur opérations faites en commun', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 97,'PCG99-ABREGE','PROD', 'XXXXXX', '76', '7', 'Produits financiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 98,'PCG99-ABREGE','PROD', 'XXXXXX', '77', '7', 'Produits exceptionnels', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 99,'PCG99-ABREGE','PROD', 'XXXXXX', '781', '7', 'Reprises sur amortissements et provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (100,'PCG99-ABREGE','PROD', 'XXXXXX', '786', '7', 'Reprises sur provisions pour risques', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (101,'PCG99-ABREGE','PROD', 'XXXXXX', '787', '7', 'Reprises sur provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (102,'PCG99-ABREGE','PROD', 'XXXXXX', '79', '7', 'Transferts de charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 1,'PCG99-ABREGE','CAPIT', 'CAPITAL', '101', '1401', 'Capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 2,'PCG99-ABREGE','CAPIT', 'XXXXXX', '105', '1401', 'Ecarts de réévaluation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 3,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1061', '1401', 'Réserve légale', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 4,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1063', '1401', 'Réserves statutaires ou contractuelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 5,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1064', '1401', 'Réserves réglementées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 6,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1068', '1401', 'Autres réserves', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 7,'PCG99-ABREGE','CAPIT', 'XXXXXX', '108', '1401', 'Compte de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 8,'PCG99-ABREGE','CAPIT', 'XXXXXX', '12', '1401', 'Résultat de l''exercice', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 9,'PCG99-ABREGE','CAPIT', 'XXXXXX', '145', '1401', 'Amortissements dérogatoires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 10,'PCG99-ABREGE','CAPIT', 'XXXXXX', '146', '1401', 'Provision spéciale de réévaluation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 11,'PCG99-ABREGE','CAPIT', 'XXXXXX', '147', '1401', 'Plus-values réinvesties', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 12,'PCG99-ABREGE','CAPIT', 'XXXXXX', '148', '1401', 'Autres provisions réglementées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 13,'PCG99-ABREGE','CAPIT', 'XXXXXX', '15', '1401', 'Provisions pour risques et charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 14,'PCG99-ABREGE','CAPIT', 'XXXXXX', '16', '1401', 'Emprunts et dettes assimilees', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 15,'PCG99-ABREGE','IMMO', 'XXXXXX', '20', '1402', 'Immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 16,'PCG99-ABREGE','IMMO', 'XXXXXX', '201', '15', 'Frais d''établissement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 17,'PCG99-ABREGE','IMMO', 'XXXXXX', '206', '15', 'Droit au bail', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 18,'PCG99-ABREGE','IMMO', 'XXXXXX', '207', '15', 'Fonds commercial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 19,'PCG99-ABREGE','IMMO', 'XXXXXX', '208', '15', 'Autres immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 20,'PCG99-ABREGE','IMMO', 'XXXXXX', '21', '1402', 'Immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 21,'PCG99-ABREGE','IMMO', 'XXXXXX', '23', '1402', 'Immobilisations en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 22,'PCG99-ABREGE','IMMO', 'XXXXXX', '27', '1402', 'Autres immobilisations financieres', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 23,'PCG99-ABREGE','IMMO', 'XXXXXX', '280', '1402', 'Amortissements des immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 24,'PCG99-ABREGE','IMMO', 'XXXXXX', '281', '1402', 'Amortissements des immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 25,'PCG99-ABREGE','IMMO', 'XXXXXX', '290', '1402', 'Provisions pour dépréciation des immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 26,'PCG99-ABREGE','IMMO', 'XXXXXX', '291', '1402', 'Provisions pour dépréciation des immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 27,'PCG99-ABREGE','IMMO', 'XXXXXX', '297', '1402', 'Provisions pour dépréciation des autres immobilisations financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 28,'PCG99-ABREGE','STOCK', 'XXXXXX', '31', '1403', 'Matieres premières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 29,'PCG99-ABREGE','STOCK', 'XXXXXX', '32', '1403', 'Autres approvisionnements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 30,'PCG99-ABREGE','STOCK', 'XXXXXX', '33', '1403', 'En-cours de production de biens', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 31,'PCG99-ABREGE','STOCK', 'XXXXXX', '34', '1403', 'En-cours de production de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 32,'PCG99-ABREGE','STOCK', 'XXXXXX', '35', '1403', 'Stocks de produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 33,'PCG99-ABREGE','STOCK', 'XXXXXX', '37', '1403', 'Stocks de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 34,'PCG99-ABREGE','STOCK', 'XXXXXX', '391', '1403', 'Provisions pour dépréciation des matières premières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 35,'PCG99-ABREGE','STOCK', 'XXXXXX', '392', '1403', 'Provisions pour dépréciation des autres approvisionnements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 36,'PCG99-ABREGE','STOCK', 'XXXXXX', '393', '1403', 'Provisions pour dépréciation des en-cours de production de biens', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 37,'PCG99-ABREGE','STOCK', 'XXXXXX', '394', '1403', 'Provisions pour dépréciation des en-cours de production de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 38,'PCG99-ABREGE','STOCK', 'XXXXXX', '395', '1403', 'Provisions pour dépréciation des stocks de produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 39,'PCG99-ABREGE','STOCK', 'XXXXXX', '397', '1403', 'Provisions pour dépréciation des stocks de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 40,'PCG99-ABREGE','TIERS', 'SUPPLIER','400', '1404', 'Fournisseurs et Comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 41,'PCG99-ABREGE','TIERS', 'XXXXXX', '409', '1404', 'Fournisseurs débiteurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 42,'PCG99-ABREGE','TIERS', 'CUSTOMER','410', '1404', 'Clients et Comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 43,'PCG99-ABREGE','TIERS', 'XXXXXX', '419', '1404', 'Clients créditeurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 44,'PCG99-ABREGE','TIERS', 'XXXXXX', '421', '1404', 'Personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 45,'PCG99-ABREGE','TIERS', 'XXXXXX', '428', '1404', 'Personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 46,'PCG99-ABREGE','TIERS', 'XXXXXX', '43', '1404', 'Sécurité sociale et autres organismes sociaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 47,'PCG99-ABREGE','TIERS', 'XXXXXX', '444', '1404', 'Etat - impôts sur bénéfice', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 48,'PCG99-ABREGE','TIERS', 'XXXXXX', '445', '1404', 'Etat - Taxes sur chiffre affaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 49,'PCG99-ABREGE','TIERS', 'XXXXXX', '447', '1404', 'Autres impôts, taxes et versements assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 50,'PCG99-ABREGE','TIERS', 'XXXXXX', '45', '1404', 'Groupe et associes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 51,'PCG99-ABREGE','TIERS', 'XXXXXX', '455', '50', 'Associés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 52,'PCG99-ABREGE','TIERS', 'XXXXXX', '46', '1404', 'Débiteurs divers et créditeurs divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 53,'PCG99-ABREGE','TIERS', 'XXXXXX', '47', '1404', 'Comptes transitoires ou d''attente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 54,'PCG99-ABREGE','TIERS', 'XXXXXX', '481', '1404', 'Charges à répartir sur plusieurs exercices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 55,'PCG99-ABREGE','TIERS', 'XXXXXX', '486', '1404', 'Charges constatées d''avance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 56,'PCG99-ABREGE','TIERS', 'XXXXXX', '487', '1404', 'Produits constatés d''avance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 57,'PCG99-ABREGE','TIERS', 'XXXXXX', '491', '1404', 'Provisions pour dépréciation des comptes de clients', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 58,'PCG99-ABREGE','TIERS', 'XXXXXX', '496', '1404', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 59,'PCG99-ABREGE','FINAN', 'XXXXXX', '50', '1405', 'Valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 60,'PCG99-ABREGE','FINAN', 'BANK', '51', '1405', 'Banques, établissements financiers et assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 61,'PCG99-ABREGE','FINAN', 'CASH', '53', '1405', 'Caisse', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 62,'PCG99-ABREGE','FINAN', 'XXXXXX', '54', '1405', 'Régies d''avance et accréditifs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 63,'PCG99-ABREGE','FINAN', 'XXXXXX', '58', '1405', 'Virements internes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 64,'PCG99-ABREGE','FINAN', 'XXXXXX', '590', '1405', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 65,'PCG99-ABREGE','CHARGE','PRODUCT', '60', '1406', 'Achats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 66,'PCG99-ABREGE','CHARGE','XXXXXX', '603', '65', 'Variations des stocks', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 67,'PCG99-ABREGE','CHARGE','SERVICE', '61', '1406', 'Services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 68,'PCG99-ABREGE','CHARGE','XXXXXX', '62', '1406', 'Autres services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 69,'PCG99-ABREGE','CHARGE','XXXXXX', '63', '1406', 'Impôts, taxes et versements assimiles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 70,'PCG99-ABREGE','CHARGE','XXXXXX', '641', '1406', 'Rémunérations du personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 71,'PCG99-ABREGE','CHARGE','XXXXXX', '644', '1406', 'Rémunération du travail de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 72,'PCG99-ABREGE','CHARGE','SOCIAL', '645', '1406', 'Charges de sécurité sociale et de prévoyance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 73,'PCG99-ABREGE','CHARGE','XXXXXX', '646', '1406', 'Cotisations sociales personnelles de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 74,'PCG99-ABREGE','CHARGE','XXXXXX', '65', '1406', 'Autres charges de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 75,'PCG99-ABREGE','CHARGE','XXXXXX', '66', '1406', 'Charges financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 76,'PCG99-ABREGE','CHARGE','XXXXXX', '67', '1406', 'Charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 77,'PCG99-ABREGE','CHARGE','XXXXXX', '681', '1406', 'Dotations aux amortissements et aux provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 78,'PCG99-ABREGE','CHARGE','XXXXXX', '686', '1406', 'Dotations aux amortissements et aux provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 79,'PCG99-ABREGE','CHARGE','XXXXXX', '687', '1406', 'Dotations aux amortissements et aux provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 80,'PCG99-ABREGE','CHARGE','XXXXXX', '691', '1406', 'Participation des salariés aux résultats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 81,'PCG99-ABREGE','CHARGE','XXXXXX', '695', '1406', 'Impôts sur les bénéfices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 82,'PCG99-ABREGE','CHARGE','XXXXXX', '697', '1406', 'Imposition forfaitaire annuelle des sociétés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 83,'PCG99-ABREGE','CHARGE','XXXXXX', '699', '1406', 'Produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 84,'PCG99-ABREGE','PROD', 'PRODUCT', '701', '1407', 'Ventes de produits finis', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 85,'PCG99-ABREGE','PROD', 'SERVICE', '706', '1407', 'Prestations de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 86,'PCG99-ABREGE','PROD', 'PRODUCT', '707', '1407', 'Ventes de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 87,'PCG99-ABREGE','PROD', 'PRODUCT', '708', '1407', 'Produits des activités annexes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 88,'PCG99-ABREGE','PROD', 'XXXXXX', '709', '1407', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 89,'PCG99-ABREGE','PROD', 'XXXXXX', '713', '1407', 'Variation des stocks', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 90,'PCG99-ABREGE','PROD', 'XXXXXX', '72', '1407', 'Production immobilisée', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 91,'PCG99-ABREGE','PROD', 'XXXXXX', '73', '1407', 'Produits nets partiels sur opérations à long terme', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 92,'PCG99-ABREGE','PROD', 'XXXXXX', '74', '1407', 'Subventions d''exploitation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 93,'PCG99-ABREGE','PROD', 'XXXXXX', '75', '1407', 'Autres produits de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 94,'PCG99-ABREGE','PROD', 'XXXXXX', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 95,'PCG99-ABREGE','PROD', 'XXXXXX', '754', '93', 'Ristournes perçues des coopératives', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 96,'PCG99-ABREGE','PROD', 'XXXXXX', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 97,'PCG99-ABREGE','PROD', 'XXXXXX', '76', '1407', 'Produits financiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 98,'PCG99-ABREGE','PROD', 'XXXXXX', '77', '1407', 'Produits exceptionnels', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 99,'PCG99-ABREGE','PROD', 'XXXXXX', '781', '1407', 'Reprises sur amortissements et provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (100,'PCG99-ABREGE','PROD', 'XXXXXX', '786', '1407', 'Reprises sur provisions pour risques', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (101,'PCG99-ABREGE','PROD', 'XXXXXX', '787', '1407', 'Reprises sur provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (102,'PCG99-ABREGE','PROD', 'XXXXXX', '79', '1407', 'Transferts de charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1401,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1402,'PCG99-ABREGE','IMMO', 'XXXXXX', '2', '', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1403,'PCG99-ABREGE','STOCK', 'XXXXXX', '3', '', 'Stock et commandes en cours d''exécution', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1404,'PCG99-ABREGE','TIERS', 'XXXXXX', '4', '', 'Créances et dettes à un an au plus', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1405,'PCG99-ABREGE','FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1406,'PCG99-ABREGE','CHARGE','XXXXXX', '6', '', 'Charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1407,'PCG99-ABREGE','PROD', 'XXXXXX', '7', '', 'Produits', '1'); -- -- Descriptif des plans comptables FR PCG99-BASE -- -insert into llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (2,'PCG99-BASE', 1, 'The base accountancy french plan', 1); +INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (2,'PCG99-BASE', 1, 'The base accountancy french plan', 1); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (103,'PCG99-BASE','CAPIT', 'XXXXXX', '10', '1', 'Capital et réserves', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (104,'PCG99-BASE','CAPIT', 'CAPITAL', '101', '10', 'Capital', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (105,'PCG99-BASE','CAPIT', 'XXXXXX', '104', '10', 'Primes liées au capital social', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (106,'PCG99-BASE','CAPIT', 'XXXXXX', '105', '10', 'Ecarts de réévaluation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (107,'PCG99-BASE','CAPIT', 'XXXXXX', '106', '10', 'Réserves', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (108,'PCG99-BASE','CAPIT', 'XXXXXX', '107', '10', 'Ecart d''equivalence', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (109,'PCG99-BASE','CAPIT', 'XXXXXX', '108', '10', 'Compte de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (110,'PCG99-BASE','CAPIT', 'XXXXXX', '109', '10', 'Actionnaires : capital souscrit - non appelé', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (111,'PCG99-BASE','CAPIT', 'XXXXXX', '11', '1', 'Report à nouveau (solde créditeur ou débiteur)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (112,'PCG99-BASE','CAPIT', 'XXXXXX', '110', '11', 'Report à nouveau (solde créditeur)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (113,'PCG99-BASE','CAPIT', 'XXXXXX', '119', '11', 'Report à nouveau (solde débiteur)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (114,'PCG99-BASE','CAPIT', 'XXXXXX', '12', '1', 'Résultat de l''exercice (bénéfice ou perte)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (115,'PCG99-BASE','CAPIT', 'XXXXXX', '120', '12', 'Résultat de l''exercice (bénéfice)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (116,'PCG99-BASE','CAPIT', 'XXXXXX', '129', '12', 'Résultat de l''exercice (perte)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (117,'PCG99-BASE','CAPIT', 'XXXXXX', '13', '1', 'Subventions d''investissement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (118,'PCG99-BASE','CAPIT', 'XXXXXX', '131', '13', 'Subventions d''équipement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (119,'PCG99-BASE','CAPIT', 'XXXXXX', '138', '13', 'Autres subventions d''investissement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (120,'PCG99-BASE','CAPIT', 'XXXXXX', '139', '13', 'Subventions d''investissement inscrites au compte de résultat', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (121,'PCG99-BASE','CAPIT', 'XXXXXX', '14', '1', 'Provisions réglementées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (122,'PCG99-BASE','CAPIT', 'XXXXXX', '142', '14', 'Provisions réglementées relatives aux immobilisations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (123,'PCG99-BASE','CAPIT', 'XXXXXX', '143', '14', 'Provisions réglementées relatives aux stocks', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (124,'PCG99-BASE','CAPIT', 'XXXXXX', '144', '14', 'Provisions réglementées relatives aux autres éléments de l''actif', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (125,'PCG99-BASE','CAPIT', 'XXXXXX', '145', '14', 'Amortissements dérogatoires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (126,'PCG99-BASE','CAPIT', 'XXXXXX', '146', '14', 'Provision spéciale de réévaluation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (127,'PCG99-BASE','CAPIT', 'XXXXXX', '147', '14', 'Plus-values réinvesties', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (128,'PCG99-BASE','CAPIT', 'XXXXXX', '148', '14', 'Autres provisions réglementées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (129,'PCG99-BASE','CAPIT', 'XXXXXX', '15', '1', 'Provisions pour risques et charges', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (130,'PCG99-BASE','CAPIT', 'XXXXXX', '151', '15', 'Provisions pour risques', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (131,'PCG99-BASE','CAPIT', 'XXXXXX', '153', '15', 'Provisions pour pensions et obligations similaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (132,'PCG99-BASE','CAPIT', 'XXXXXX', '154', '15', 'Provisions pour restructurations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (133,'PCG99-BASE','CAPIT', 'XXXXXX', '155', '15', 'Provisions pour impôts', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (134,'PCG99-BASE','CAPIT', 'XXXXXX', '156', '15', 'Provisions pour renouvellement des immobilisations (entreprises concessionnaires)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (135,'PCG99-BASE','CAPIT', 'XXXXXX', '157', '15', 'Provisions pour charges à répartir sur plusieurs exercices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (136,'PCG99-BASE','CAPIT', 'XXXXXX', '158', '15', 'Autres provisions pour charges', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (137,'PCG99-BASE','CAPIT', 'XXXXXX', '16', '1', 'Emprunts et dettes assimilees', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (138,'PCG99-BASE','CAPIT', 'XXXXXX', '161', '16', 'Emprunts obligataires convertibles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (139,'PCG99-BASE','CAPIT', 'XXXXXX', '163', '16', 'Autres emprunts obligataires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (140,'PCG99-BASE','CAPIT', 'XXXXXX', '164', '16', 'Emprunts auprès des établissements de crédit', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (141,'PCG99-BASE','CAPIT', 'XXXXXX', '165', '16', 'Dépôts et cautionnements reçus', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (142,'PCG99-BASE','CAPIT', 'XXXXXX', '166', '16', 'Participation des salariés aux résultats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (143,'PCG99-BASE','CAPIT', 'XXXXXX', '167', '16', 'Emprunts et dettes assortis de conditions particulières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (144,'PCG99-BASE','CAPIT', 'XXXXXX', '168', '16', 'Autres emprunts et dettes assimilées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (145,'PCG99-BASE','CAPIT', 'XXXXXX', '169', '16', 'Primes de remboursement des obligations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (146,'PCG99-BASE','CAPIT', 'XXXXXX', '17', '1', 'Dettes rattachées à des participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (147,'PCG99-BASE','CAPIT', 'XXXXXX', '171', '17', 'Dettes rattachées à des participations (groupe)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (148,'PCG99-BASE','CAPIT', 'XXXXXX', '174', '17', 'Dettes rattachées à des participations (hors groupe)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (149,'PCG99-BASE','CAPIT', 'XXXXXX', '178', '17', 'Dettes rattachées à des sociétés en participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (150,'PCG99-BASE','CAPIT', 'XXXXXX', '18', '1', 'Comptes de liaison des établissements et sociétés en participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (151,'PCG99-BASE','CAPIT', 'XXXXXX', '181', '18', 'Comptes de liaison des établissements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (152,'PCG99-BASE','CAPIT', 'XXXXXX', '186', '18', 'Biens et prestations de services échangés entre établissements (charges)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (153,'PCG99-BASE','CAPIT', 'XXXXXX', '187', '18', 'Biens et prestations de services échangés entre établissements (produits)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (154,'PCG99-BASE','CAPIT', 'XXXXXX', '188', '18', 'Comptes de liaison des sociétés en participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (155,'PCG99-BASE','IMMO', 'XXXXXX', '20', '2', 'Immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (156,'PCG99-BASE','IMMO', 'XXXXXX', '201', '20', 'Frais d''établissement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (157,'PCG99-BASE','IMMO', 'XXXXXX', '203', '20', 'Frais de recherche et de développement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (158,'PCG99-BASE','IMMO', 'XXXXXX', '205', '20', 'Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (159,'PCG99-BASE','IMMO', 'XXXXXX', '206', '20', 'Droit au bail', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (160,'PCG99-BASE','IMMO', 'XXXXXX', '207', '20', 'Fonds commercial', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (161,'PCG99-BASE','IMMO', 'XXXXXX', '208', '20', 'Autres immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (162,'PCG99-BASE','IMMO', 'XXXXXX', '21', '2', 'Immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (163,'PCG99-BASE','IMMO', 'XXXXXX', '211', '21', 'Terrains', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (164,'PCG99-BASE','IMMO', 'XXXXXX', '212', '21', 'Agencements et aménagements de terrains', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (165,'PCG99-BASE','IMMO', 'XXXXXX', '213', '21', 'Constructions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (166,'PCG99-BASE','IMMO', 'XXXXXX', '214', '21', 'Constructions sur sol d''autrui', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (167,'PCG99-BASE','IMMO', 'XXXXXX', '215', '21', 'Installations techniques, matériels et outillage industriels', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (168,'PCG99-BASE','IMMO', 'XXXXXX', '218', '21', 'Autres immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (169,'PCG99-BASE','IMMO', 'XXXXXX', '22', '2', 'Immobilisations mises en concession', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (170,'PCG99-BASE','IMMO', 'XXXXXX', '23', '2', 'Immobilisations en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (171,'PCG99-BASE','IMMO', 'XXXXXX', '231', '23', 'Immobilisations corporelles en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (172,'PCG99-BASE','IMMO', 'XXXXXX', '232', '23', 'Immobilisations incorporelles en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (173,'PCG99-BASE','IMMO', 'XXXXXX', '237', '23', 'Avances et acomptes versés sur immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (174,'PCG99-BASE','IMMO', 'XXXXXX', '238', '23', 'Avances et acomptes versés sur commandes d''immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (175,'PCG99-BASE','IMMO', 'XXXXXX', '25', '2', 'Parts dans des entreprises liées et créances sur des entreprises liées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (176,'PCG99-BASE','IMMO', 'XXXXXX', '26', '2', 'Participations et créances rattachées à des participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (177,'PCG99-BASE','IMMO', 'XXXXXX', '261', '26', 'Titres de participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (178,'PCG99-BASE','IMMO', 'XXXXXX', '266', '26', 'Autres formes de participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (179,'PCG99-BASE','IMMO', 'XXXXXX', '267', '26', 'Créances rattachées à des participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (180,'PCG99-BASE','IMMO', 'XXXXXX', '268', '26', 'Créances rattachées à des sociétés en participation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (181,'PCG99-BASE','IMMO', 'XXXXXX', '269', '26', 'Versements restant à effectuer sur titres de participation non libérés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (182,'PCG99-BASE','IMMO', 'XXXXXX', '27', '2', 'Autres immobilisations financieres', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (183,'PCG99-BASE','IMMO', 'XXXXXX', '271', '27', 'Titres immobilisés autres que les titres immobilisés de l''activité de portefeuille (droit de propriété)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (184,'PCG99-BASE','IMMO', 'XXXXXX', '272', '27', 'Titres immobilisés (droit de créance)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (185,'PCG99-BASE','IMMO', 'XXXXXX', '273', '27', 'Titres immobilisés de l''activité de portefeuille', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (186,'PCG99-BASE','IMMO', 'XXXXXX', '274', '27', 'Prêts', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (187,'PCG99-BASE','IMMO', 'XXXXXX', '275', '27', 'Dépôts et cautionnements versés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (188,'PCG99-BASE','IMMO', 'XXXXXX', '276', '27', 'Autres créances immobilisées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (189,'PCG99-BASE','IMMO', 'XXXXXX', '277', '27', '(Actions propres ou parts propres)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (190,'PCG99-BASE','IMMO', 'XXXXXX', '279', '27', 'Versements restant à effectuer sur titres immobilisés non libérés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (191,'PCG99-BASE','IMMO', 'XXXXXX', '28', '2', 'Amortissements des immobilisations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (192,'PCG99-BASE','IMMO', 'XXXXXX', '280', '28', 'Amortissements des immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (193,'PCG99-BASE','IMMO', 'XXXXXX', '281', '28', 'Amortissements des immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (194,'PCG99-BASE','IMMO', 'XXXXXX', '282', '28', 'Amortissements des immobilisations mises en concession', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (195,'PCG99-BASE','IMMO', 'XXXXXX', '29', '2', 'Dépréciations des immobilisations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (196,'PCG99-BASE','IMMO', 'XXXXXX', '290', '29', 'Dépréciations des immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (197,'PCG99-BASE','IMMO', 'XXXXXX', '291', '29', 'Dépréciations des immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (198,'PCG99-BASE','IMMO', 'XXXXXX', '292', '29', 'Dépréciations des immobilisations mises en concession', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (199,'PCG99-BASE','IMMO', 'XXXXXX', '293', '29', 'Dépréciations des immobilisations en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (200,'PCG99-BASE','IMMO', 'XXXXXX', '296', '29', 'Provisions pour dépréciation des participations et créances rattachées à des participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (201,'PCG99-BASE','IMMO', 'XXXXXX', '297', '29', 'Provisions pour dépréciation des autres immobilisations financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (202,'PCG99-BASE','STOCK', 'XXXXXX', '31', '3', 'Matières premières (et fournitures)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (203,'PCG99-BASE','STOCK', 'XXXXXX', '311', '31', 'Matières (ou groupe) A', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (204,'PCG99-BASE','STOCK', 'XXXXXX', '312', '31', 'Matières (ou groupe) B', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (205,'PCG99-BASE','STOCK', 'XXXXXX', '317', '31', 'Fournitures A, B, C,', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (206,'PCG99-BASE','STOCK', 'XXXXXX', '32', '3', 'Autres approvisionnements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (207,'PCG99-BASE','STOCK', 'XXXXXX', '321', '32', 'Matières consommables', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (208,'PCG99-BASE','STOCK', 'XXXXXX', '322', '32', 'Fournitures consommables', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (209,'PCG99-BASE','STOCK', 'XXXXXX', '326', '32', 'Emballages', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (210,'PCG99-BASE','STOCK', 'XXXXXX', '33', '3', 'En-cours de production de biens', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (211,'PCG99-BASE','STOCK', 'XXXXXX', '331', '33', 'Produits en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (212,'PCG99-BASE','STOCK', 'XXXXXX', '335', '33', 'Travaux en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (213,'PCG99-BASE','STOCK', 'XXXXXX', '34', '3', 'En-cours de production de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (214,'PCG99-BASE','STOCK', 'XXXXXX', '341', '34', 'Etudes en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (215,'PCG99-BASE','STOCK', 'XXXXXX', '345', '34', 'Prestations de services en cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (216,'PCG99-BASE','STOCK', 'XXXXXX', '35', '3', 'Stocks de produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (217,'PCG99-BASE','STOCK', 'XXXXXX', '351', '35', 'Produits intermédiaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (218,'PCG99-BASE','STOCK', 'XXXXXX', '355', '35', 'Produits finis', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (219,'PCG99-BASE','STOCK', 'XXXXXX', '358', '35', 'Produits résiduels (ou matières de récupération)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (220,'PCG99-BASE','STOCK', 'XXXXXX', '37', '3', 'Stocks de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (221,'PCG99-BASE','STOCK', 'XXXXXX', '371', '37', 'Marchandises (ou groupe) A', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (222,'PCG99-BASE','STOCK', 'XXXXXX', '372', '37', 'Marchandises (ou groupe) B', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (223,'PCG99-BASE','STOCK', 'XXXXXX', '39', '3', 'Provisions pour dépréciation des stocks et en-cours', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (224,'PCG99-BASE','STOCK', 'XXXXXX', '391', '39', 'Provisions pour dépréciation des matières premières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (225,'PCG99-BASE','STOCK', 'XXXXXX', '392', '39', 'Provisions pour dépréciation des autres approvisionnements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (226,'PCG99-BASE','STOCK', 'XXXXXX', '393', '39', 'Provisions pour dépréciation des en-cours de production de biens', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (227,'PCG99-BASE','STOCK', 'XXXXXX', '394', '39', 'Provisions pour dépréciation des en-cours de production de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (228,'PCG99-BASE','STOCK', 'XXXXXX', '395', '39', 'Provisions pour dépréciation des stocks de produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (229,'PCG99-BASE','STOCK', 'XXXXXX', '397', '39', 'Provisions pour dépréciation des stocks de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (230,'PCG99-BASE','TIERS', 'XXXXXX', '40', '4', 'Fournisseurs et Comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (231,'PCG99-BASE','TIERS', 'XXXXXX', '400', '40', 'Fournisseurs et Comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (232,'PCG99-BASE','TIERS', 'SUPPLIER','401', '40', 'Fournisseurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (233,'PCG99-BASE','TIERS', 'XXXXXX', '403', '40', 'Fournisseurs - Effets à payer', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (234,'PCG99-BASE','TIERS', 'XXXXXX', '404', '40', 'Fournisseurs d''immobilisations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (235,'PCG99-BASE','TIERS', 'XXXXXX', '405', '40', 'Fournisseurs d''immobilisations - Effets à payer', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (236,'PCG99-BASE','TIERS', 'XXXXXX', '408', '40', 'Fournisseurs - Factures non parvenues', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (237,'PCG99-BASE','TIERS', 'XXXXXX', '409', '40', 'Fournisseurs débiteurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (238,'PCG99-BASE','TIERS', 'XXXXXX', '41', '4', 'Clients et comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (239,'PCG99-BASE','TIERS', 'XXXXXX', '410', '41', 'Clients et Comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (240,'PCG99-BASE','TIERS', 'CUSTOMER','411', '41', 'Clients', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (241,'PCG99-BASE','TIERS', 'XXXXXX', '413', '41', 'Clients - Effets à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (242,'PCG99-BASE','TIERS', 'XXXXXX', '416', '41', 'Clients douteux ou litigieux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (243,'PCG99-BASE','TIERS', 'XXXXXX', '418', '41', 'Clients - Produits non encore facturés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (244,'PCG99-BASE','TIERS', 'XXXXXX', '419', '41', 'Clients créditeurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (245,'PCG99-BASE','TIERS', 'XXXXXX', '42', '4', 'Personnel et comptes rattachés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (246,'PCG99-BASE','TIERS', 'XXXXXX', '421', '42', 'Personnel - Rémunérations dues', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (247,'PCG99-BASE','TIERS', 'XXXXXX', '422', '42', 'Comités d''entreprises, d''établissement, ...', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (248,'PCG99-BASE','TIERS', 'XXXXXX', '424', '42', 'Participation des salariés aux résultats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (249,'PCG99-BASE','TIERS', 'XXXXXX', '425', '42', 'Personnel - Avances et acomptes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (250,'PCG99-BASE','TIERS', 'XXXXXX', '426', '42', 'Personnel - Dépôts', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (251,'PCG99-BASE','TIERS', 'XXXXXX', '427', '42', 'Personnel - Oppositions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (252,'PCG99-BASE','TIERS', 'XXXXXX', '428', '42', 'Personnel - Charges à payer et produits à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (253,'PCG99-BASE','TIERS', 'XXXXXX', '43', '4', 'Sécurité sociale et autres organismes sociaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (254,'PCG99-BASE','TIERS', 'XXXXXX', '431', '43', 'Sécurité sociale', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (255,'PCG99-BASE','TIERS', 'XXXXXX', '437', '43', 'Autres organismes sociaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (256,'PCG99-BASE','TIERS', 'XXXXXX', '438', '43', 'Organismes sociaux - Charges à payer et produits à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (257,'PCG99-BASE','TIERS', 'XXXXXX', '44', '4', 'État et autres collectivités publiques', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (258,'PCG99-BASE','TIERS', 'XXXXXX', '441', '44', 'État - Subventions à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (259,'PCG99-BASE','TIERS', 'XXXXXX', '442', '44', 'Etat - Impôts et taxes recouvrables sur des tiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (260,'PCG99-BASE','TIERS', 'XXXXXX', '443', '44', 'Opérations particulières avec l''Etat, les collectivités publiques, les organismes internationaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (261,'PCG99-BASE','TIERS', 'XXXXXX', '444', '44', 'Etat - Impôts sur les bénéfices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (262,'PCG99-BASE','TIERS', 'XXXXXX', '445', '44', 'Etat - Taxes sur le chiffre d''affaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (263,'PCG99-BASE','TIERS', 'XXXXXX', '446', '44', 'Obligations cautionnées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (264,'PCG99-BASE','TIERS', 'XXXXXX', '447', '44', 'Autres impôts, taxes et versements assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (265,'PCG99-BASE','TIERS', 'XXXXXX', '448', '44', 'Etat - Charges à payer et produits à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (266,'PCG99-BASE','TIERS', 'XXXXXX', '449', '44', 'Quotas d''émission à restituer à l''Etat', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (267,'PCG99-BASE','TIERS', 'XXXXXX', '45', '4', 'Groupe et associes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (268,'PCG99-BASE','TIERS', 'XXXXXX', '451', '45', 'Groupe', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (269,'PCG99-BASE','TIERS', 'XXXXXX', '455', '45', 'Associés - Comptes courants', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (270,'PCG99-BASE','TIERS', 'XXXXXX', '456', '45', 'Associés - Opérations sur le capital', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (271,'PCG99-BASE','TIERS', 'XXXXXX', '457', '45', 'Associés - Dividendes à payer', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (272,'PCG99-BASE','TIERS', 'XXXXXX', '458', '45', 'Associés - Opérations faites en commun et en G.I.E.', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (273,'PCG99-BASE','TIERS', 'XXXXXX', '46', '4', 'Débiteurs divers et créditeurs divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (274,'PCG99-BASE','TIERS', 'XXXXXX', '462', '46', 'Créances sur cessions d''immobilisations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (275,'PCG99-BASE','TIERS', 'XXXXXX', '464', '46', 'Dettes sur acquisitions de valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (276,'PCG99-BASE','TIERS', 'XXXXXX', '465', '46', 'Créances sur cessions de valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (277,'PCG99-BASE','TIERS', 'XXXXXX', '467', '46', 'Autres comptes débiteurs ou créditeurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (278,'PCG99-BASE','TIERS', 'XXXXXX', '468', '46', 'Divers - Charges à payer et produits à recevoir', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (279,'PCG99-BASE','TIERS', 'XXXXXX', '47', '4', 'Comptes transitoires ou d''attente', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (280,'PCG99-BASE','TIERS', 'XXXXXX', '471', '47', 'Comptes d''attente', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (281,'PCG99-BASE','TIERS', 'XXXXXX', '476', '47', 'Différence de conversion - Actif', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (282,'PCG99-BASE','TIERS', 'XXXXXX', '477', '47', 'Différences de conversion - Passif', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (283,'PCG99-BASE','TIERS', 'XXXXXX', '478', '47', 'Autres comptes transitoires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (284,'PCG99-BASE','TIERS', 'XXXXXX', '48', '4', 'Comptes de régularisation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (285,'PCG99-BASE','TIERS', 'XXXXXX', '481', '48', 'Charges à répartir sur plusieurs exercices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (286,'PCG99-BASE','TIERS', 'XXXXXX', '486', '48', 'Charges constatées d''avance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (287,'PCG99-BASE','TIERS', 'XXXXXX', '487', '48', 'Produits constatés d''avance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (288,'PCG99-BASE','TIERS', 'XXXXXX', '488', '48', 'Comptes de répartition périodique des charges et des produits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (289,'PCG99-BASE','TIERS', 'XXXXXX', '489', '48', 'Quotas d''émission alloués par l''Etat', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (290,'PCG99-BASE','TIERS', 'XXXXXX', '49', '4', 'Provisions pour dépréciation des comptes de tiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (291,'PCG99-BASE','TIERS', 'XXXXXX', '491', '49', 'Provisions pour dépréciation des comptes de clients', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (292,'PCG99-BASE','TIERS', 'XXXXXX', '495', '49', 'Provisions pour dépréciation des comptes du groupe et des associés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (293,'PCG99-BASE','TIERS', 'XXXXXX', '496', '49', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (294,'PCG99-BASE','FINAN', 'XXXXXX', '50', '5', 'Valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (295,'PCG99-BASE','FINAN', 'XXXXXX', '501', '50', 'Parts dans des entreprises liées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (296,'PCG99-BASE','FINAN', 'XXXXXX', '502', '50', 'Actions propres', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (297,'PCG99-BASE','FINAN', 'XXXXXX', '503', '50', 'Actions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (298,'PCG99-BASE','FINAN', 'XXXXXX', '504', '50', 'Autres titres conférant un droit de propriété', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (299,'PCG99-BASE','FINAN', 'XXXXXX', '505', '50', 'Obligations et bons émis par la société et rachetés par elle', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (300,'PCG99-BASE','FINAN', 'XXXXXX', '506', '50', 'Obligations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (301,'PCG99-BASE','FINAN', 'XXXXXX', '507', '50', 'Bons du Trésor et bons de caisse à court terme', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (302,'PCG99-BASE','FINAN', 'XXXXXX', '508', '50', 'Autres valeurs mobilières de placement et autres créances assimilées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (303,'PCG99-BASE','FINAN', 'XXXXXX', '509', '50', 'Versements restant à effectuer sur valeurs mobilières de placement non libérées', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (304,'PCG99-BASE','FINAN', 'XXXXXX', '51', '5', 'Banques, établissements financiers et assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (305,'PCG99-BASE','FINAN', 'XXXXXX', '511', '51', 'Valeurs à l''encaissement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (306,'PCG99-BASE','FINAN', 'BANK', '512', '51', 'Banques', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (307,'PCG99-BASE','FINAN', 'XXXXXX', '514', '51', 'Chèques postaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (308,'PCG99-BASE','FINAN', 'XXXXXX', '515', '51', '"Caisses" du Trésor et des établissements publics', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (309,'PCG99-BASE','FINAN', 'XXXXXX', '516', '51', 'Sociétés de bourse', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (310,'PCG99-BASE','FINAN', 'XXXXXX', '517', '51', 'Autres organismes financiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (311,'PCG99-BASE','FINAN', 'XXXXXX', '518', '51', 'Intérêts courus', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (312,'PCG99-BASE','FINAN', 'XXXXXX', '519', '51', 'Concours bancaires courants', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (313,'PCG99-BASE','FINAN', 'XXXXXX', '52', '5', 'Instruments de trésorerie', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (314,'PCG99-BASE','FINAN', 'CASH', '53', '5', 'Caisse', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (315,'PCG99-BASE','FINAN', 'XXXXXX', '531', '53', 'Caisse siège social', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (316,'PCG99-BASE','FINAN', 'XXXXXX', '532', '53', 'Caisse succursale (ou usine) A', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (317,'PCG99-BASE','FINAN', 'XXXXXX', '533', '53', 'Caisse succursale (ou usine) B', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (318,'PCG99-BASE','FINAN', 'XXXXXX', '54', '5', 'Régies d''avance et accréditifs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (319,'PCG99-BASE','FINAN', 'XXXXXX', '58', '5', 'Virements internes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (320,'PCG99-BASE','FINAN', 'XXXXXX', '59', '5', 'Provisions pour dépréciation des comptes financiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (321,'PCG99-BASE','FINAN', 'XXXXXX', '590', '59', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (322,'PCG99-BASE','CHARGE','PRODUCT', '60', '6', 'Achats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','CHARGE','XXXXXX', '601','60', 'Achats stockés - Matières premières (et fournitures)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','CHARGE','XXXXXX', '602','60', 'Achats stockés - Autres approvisionnements', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','CHARGE','XXXXXX', '603','60', 'Variations des stocks (approvisionnements et marchandises)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604','60', 'Achats stockés - Matières premières (et fournitures)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','CHARGE','XXXXXX', '605','60', 'Achats de matériel, équipements et travaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','CHARGE','XXXXXX', '606','60', 'Achats non stockés de matière et fournitures', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','CHARGE','XXXXXX', '607','60', 'Achats de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (330,'PCG99-BASE','CHARGE','XXXXXX', '608','60', '(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (331,'PCG99-BASE','CHARGE','XXXXXX', '609','60', 'Rabais, remises et ristournes obtenus sur achats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (332,'PCG99-BASE','CHARGE','SERVICE', '61', '6', 'Services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (333,'PCG99-BASE','CHARGE','XXXXXX', '611','61', 'Sous-traitance générale', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (334,'PCG99-BASE','CHARGE','XXXXXX', '612','61', 'Redevances de crédit-bail', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (335,'PCG99-BASE','CHARGE','XXXXXX', '613','61', 'Locations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (336,'PCG99-BASE','CHARGE','XXXXXX', '614','61', 'Charges locatives et de copropriété', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (337,'PCG99-BASE','CHARGE','XXXXXX', '615','61', 'Entretien et réparations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (338,'PCG99-BASE','CHARGE','XXXXXX', '616','61', 'Primes d''assurances', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (339,'PCG99-BASE','CHARGE','XXXXXX', '617','61', 'Etudes et recherches', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (340,'PCG99-BASE','CHARGE','XXXXXX', '618','61', 'Divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (341,'PCG99-BASE','CHARGE','XXXXXX', '619','61', 'Rabais, remises et ristournes obtenus sur services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (342,'PCG99-BASE','CHARGE','XXXXXX', '62', '6', 'Autres services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (343,'PCG99-BASE','CHARGE','XXXXXX', '621','62', 'Personnel extérieur à l''entreprise', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (344,'PCG99-BASE','CHARGE','XXXXXX', '622','62', 'Rémunérations d''intermédiaires et honoraires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (345,'PCG99-BASE','CHARGE','XXXXXX', '623','62', 'Publicité, publications, relations publiques', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (346,'PCG99-BASE','CHARGE','XXXXXX', '624','62', 'Transports de biens et transports collectifs du personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (347,'PCG99-BASE','CHARGE','XXXXXX', '625','62', 'Déplacements, missions et réceptions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (348,'PCG99-BASE','CHARGE','XXXXXX', '626','62', 'Frais postaux et de télécommunications', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (349,'PCG99-BASE','CHARGE','XXXXXX', '627','62', 'Services bancaires et assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (350,'PCG99-BASE','CHARGE','XXXXXX', '628','62', 'Divers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (351,'PCG99-BASE','CHARGE','XXXXXX', '629','62', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (352,'PCG99-BASE','CHARGE','XXXXXX', '63', '6', 'Impôts, taxes et versements assimilés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (353,'PCG99-BASE','CHARGE','XXXXXX', '631','63', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (354,'PCG99-BASE','CHARGE','XXXXXX', '633','63', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (355,'PCG99-BASE','CHARGE','XXXXXX', '635','63', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (356,'PCG99-BASE','CHARGE','XXXXXX', '637','63', 'Autres impôts, taxes et versements assimilés (autres organismes)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (357,'PCG99-BASE','CHARGE','XXXXXX', '64', '6', 'Charges de personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (358,'PCG99-BASE','CHARGE','XXXXXX', '641','64', 'Rémunérations du personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (359,'PCG99-BASE','CHARGE','XXXXXX', '644','64', 'Rémunération du travail de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (360,'PCG99-BASE','CHARGE','SOCIAL', '645','64', 'Charges de sécurité sociale et de prévoyance', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (361,'PCG99-BASE','CHARGE','XXXXXX', '646','64', 'Cotisations sociales personnelles de l''exploitant', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (362,'PCG99-BASE','CHARGE','XXXXXX', '647','64', 'Autres charges sociales', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (363,'PCG99-BASE','CHARGE','XXXXXX', '648','64', 'Autres charges de personnel', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (364,'PCG99-BASE','CHARGE','XXXXXX', '65', '6', 'Autres charges de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (365,'PCG99-BASE','CHARGE','XXXXXX', '651','65', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (366,'PCG99-BASE','CHARGE','XXXXXX', '653','65', 'Jetons de présence', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (367,'PCG99-BASE','CHARGE','XXXXXX', '654','65', 'Pertes sur créances irrécouvrables', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (368,'PCG99-BASE','CHARGE','XXXXXX', '655','65', 'Quote-part de résultat sur opérations faites en commun', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (369,'PCG99-BASE','CHARGE','XXXXXX', '658','65', 'Charges diverses de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (370,'PCG99-BASE','CHARGE','XXXXXX', '66', '6', 'Charges financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (371,'PCG99-BASE','CHARGE','XXXXXX', '661','66', 'Charges d''intérêts', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (372,'PCG99-BASE','CHARGE','XXXXXX', '664','66', 'Pertes sur créances liées à des participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (373,'PCG99-BASE','CHARGE','XXXXXX', '665','66', 'Escomptes accordés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (374,'PCG99-BASE','CHARGE','XXXXXX', '666','66', 'Pertes de change', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (375,'PCG99-BASE','CHARGE','XXXXXX', '667','66', 'Charges nettes sur cessions de valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (376,'PCG99-BASE','CHARGE','XXXXXX', '668','66', 'Autres charges financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (377,'PCG99-BASE','CHARGE','XXXXXX', '67', '6', 'Charges exceptionnelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (378,'PCG99-BASE','CHARGE','XXXXXX', '671','67', 'Charges exceptionnelles sur opérations de gestion', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (379,'PCG99-BASE','CHARGE','XXXXXX', '672','67', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les charges sur exercices antérieurs)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (380,'PCG99-BASE','CHARGE','XXXXXX', '675','67', 'Valeurs comptables des éléments d''actif cédés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (381,'PCG99-BASE','CHARGE','XXXXXX', '678','67', 'Autres charges exceptionnelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (382,'PCG99-BASE','CHARGE','XXXXXX', '68', '6', 'Dotations aux amortissements et aux provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (383,'PCG99-BASE','CHARGE','XXXXXX', '681','68', 'Dotations aux amortissements et aux provisions - Charges d''exploitation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (384,'PCG99-BASE','CHARGE','XXXXXX', '686','68', 'Dotations aux amortissements et aux provisions - Charges financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (385,'PCG99-BASE','CHARGE','XXXXXX', '687','68', 'Dotations aux amortissements et aux provisions - Charges exceptionnelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (386,'PCG99-BASE','CHARGE','XXXXXX', '69', '6', 'Participation des salariés - impôts sur les bénéfices et assimiles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (387,'PCG99-BASE','CHARGE','XXXXXX', '691','69', 'Participation des salariés aux résultats', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (388,'PCG99-BASE','CHARGE','XXXXXX', '695','69', 'Impôts sur les bénéfices', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (389,'PCG99-BASE','CHARGE','XXXXXX', '696','69', 'Suppléments d''impôt sur les sociétés liés aux distributions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (390,'PCG99-BASE','CHARGE','XXXXXX', '697','69', 'Imposition forfaitaire annuelle des sociétés', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (391,'PCG99-BASE','CHARGE','XXXXXX', '698','69', 'Intégration fiscale', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (392,'PCG99-BASE','CHARGE','XXXXXX', '699','69', 'Produits - Reports en arrière des déficits', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (393,'PCG99-BASE','PROD', 'XXXXXX', '70', '7', 'Ventes de produits fabriqués, prestations de services, marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (394,'PCG99-BASE','PROD', 'PRODUCT', '701','70', 'Ventes de produits finis', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (395,'PCG99-BASE','PROD', 'XXXXXX', '702','70', 'Ventes de produits intermédiaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (396,'PCG99-BASE','PROD', 'XXXXXX', '703','70', 'Ventes de produits résiduels', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (397,'PCG99-BASE','PROD', 'XXXXXX', '704','70', 'Travaux', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (398,'PCG99-BASE','PROD', 'XXXXXX', '705','70', 'Etudes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (399,'PCG99-BASE','PROD', 'SERVICE', '706','70', 'Prestations de services', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (400,'PCG99-BASE','PROD', 'PRODUCT', '707','70', 'Ventes de marchandises', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (401,'PCG99-BASE','PROD', 'PRODUCT', '708','70', 'Produits des activités annexes', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (402,'PCG99-BASE','PROD', 'XXXXXX', '709','70', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (403,'PCG99-BASE','PROD', 'XXXXXX', '71', '7', 'Production stockée (ou déstockage)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (404,'PCG99-BASE','PROD', 'XXXXXX', '713','71', 'Variation des stocks (en-cours de production, produits)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (405,'PCG99-BASE','PROD', 'XXXXXX', '72', '7', 'Production immobilisée', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (406,'PCG99-BASE','PROD', 'XXXXXX', '721','72', 'Immobilisations incorporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (407,'PCG99-BASE','PROD', 'XXXXXX', '722','72', 'Immobilisations corporelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (408,'PCG99-BASE','PROD', 'XXXXXX', '74', '7', 'Subventions d''exploitation', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (409,'PCG99-BASE','PROD', 'XXXXXX', '75', '7', 'Autres produits de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (410,'PCG99-BASE','PROD', 'XXXXXX', '751','75', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (411,'PCG99-BASE','PROD', 'XXXXXX', '752','75', 'Revenus des immeubles non affectés à des activités professionnelles', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (412,'PCG99-BASE','PROD', 'XXXXXX', '753','75', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (413,'PCG99-BASE','PROD', 'XXXXXX', '754','75', 'Ristournes perçues des coopératives (provenant des excédents)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (414,'PCG99-BASE','PROD', 'XXXXXX', '755','75', 'Quotes-parts de résultat sur opérations faites en commun', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (415,'PCG99-BASE','PROD', 'XXXXXX', '758','75', 'Produits divers de gestion courante', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (416,'PCG99-BASE','PROD', 'XXXXXX', '76', '7', 'Produits financiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (417,'PCG99-BASE','PROD', 'XXXXXX', '761','76', 'Produits de participations', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (418,'PCG99-BASE','PROD', 'XXXXXX', '762','76', 'Produits des autres immobilisations financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (419,'PCG99-BASE','PROD', 'XXXXXX', '763','76', 'Revenus des autres créances', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (420,'PCG99-BASE','PROD', 'XXXXXX', '764','76', 'Revenus des valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (421,'PCG99-BASE','PROD', 'XXXXXX', '765','76', 'Escomptes obtenus', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (422,'PCG99-BASE','PROD', 'XXXXXX', '766','76', 'Gains de change', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (423,'PCG99-BASE','PROD', 'XXXXXX', '767','76', 'Produits nets sur cessions de valeurs mobilières de placement', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (424,'PCG99-BASE','PROD', 'XXXXXX', '768','76', 'Autres produits financiers', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (425,'PCG99-BASE','PROD', 'XXXXXX', '77', '7', 'Produits exceptionnels', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (426,'PCG99-BASE','PROD', 'XXXXXX', '771','77', 'Produits exceptionnels sur opérations de gestion', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (427,'PCG99-BASE','PROD', 'XXXXXX', '772','77', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les produits sur exercices antérieurs)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (428,'PCG99-BASE','PROD', 'XXXXXX', '775','77', 'Produits des cessions d''éléments d''actif', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (429,'PCG99-BASE','PROD', 'XXXXXX', '777','77', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (430,'PCG99-BASE','PROD', 'XXXXXX', '778','77', 'Autres produits exceptionnels', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (431,'PCG99-BASE','PROD', 'XXXXXX', '78', '7', 'Reprises sur amortissements et provisions', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (432,'PCG99-BASE','PROD', 'XXXXXX', '781','78', 'Reprises sur amortissements et provisions (à inscrire dans les produits d''exploitation)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (433,'PCG99-BASE','PROD', 'XXXXXX', '786','78', 'Reprises sur provisions pour risques (à inscrire dans les produits financiers)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (434,'PCG99-BASE','PROD', 'XXXXXX', '787','78', 'Reprises sur provisions (à inscrire dans les produits exceptionnels)', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (435,'PCG99-BASE','PROD', 'XXXXXX', '79', '7', 'Transferts de charges', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','PROD', 'XXXXXX', '791','79', 'Transferts de charges d''exploitation ', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','PROD', 'XXXXXX', '796','79', 'Transferts de charges financières', '1'); -insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','PROD', 'XXXXXX', '797','79', 'Transferts de charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (103,'PCG99-BASE','CAPIT', 'XXXXXX', '10','1501', 'Capital et réserves', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (104,'PCG99-BASE','CAPIT', 'CAPITAL', '101', '103', 'Capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (105,'PCG99-BASE','CAPIT', 'XXXXXX', '104', '103', 'Primes liées au capital social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (106,'PCG99-BASE','CAPIT', 'XXXXXX', '105', '103', 'Ecarts de réévaluation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (107,'PCG99-BASE','CAPIT', 'XXXXXX', '106', '103', 'Réserves', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (108,'PCG99-BASE','CAPIT', 'XXXXXX', '107', '103', 'Ecart d''equivalence', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (109,'PCG99-BASE','CAPIT', 'XXXXXX', '108', '103', 'Compte de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (110,'PCG99-BASE','CAPIT', 'XXXXXX', '109', '103', 'Actionnaires : capital souscrit - non appelé', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (111,'PCG99-BASE','CAPIT', 'XXXXXX', '11','1501', 'Report à nouveau (solde créditeur ou débiteur)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (112,'PCG99-BASE','CAPIT', 'XXXXXX', '110', '111', 'Report à nouveau (solde créditeur)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (113,'PCG99-BASE','CAPIT', 'XXXXXX', '119', '111', 'Report à nouveau (solde débiteur)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (114,'PCG99-BASE','CAPIT', 'XXXXXX', '12','1501', 'Résultat de l''exercice (bénéfice ou perte)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (115,'PCG99-BASE','CAPIT', 'XXXXXX', '120', '114', 'Résultat de l''exercice (bénéfice)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (116,'PCG99-BASE','CAPIT', 'XXXXXX', '129', '114', 'Résultat de l''exercice (perte)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (117,'PCG99-BASE','CAPIT', 'XXXXXX', '13','1501', 'Subventions d''investissement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (118,'PCG99-BASE','CAPIT', 'XXXXXX', '131', '117', 'Subventions d''équipement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (119,'PCG99-BASE','CAPIT', 'XXXXXX', '138', '117', 'Autres subventions d''investissement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (120,'PCG99-BASE','CAPIT', 'XXXXXX', '139', '117', 'Subventions d''investissement inscrites au compte de résultat', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (121,'PCG99-BASE','CAPIT', 'XXXXXX', '14','1501', 'Provisions réglementées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (122,'PCG99-BASE','CAPIT', 'XXXXXX', '142', '121', 'Provisions réglementées relatives aux immobilisations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (123,'PCG99-BASE','CAPIT', 'XXXXXX', '143', '121', 'Provisions réglementées relatives aux stocks', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (124,'PCG99-BASE','CAPIT', 'XXXXXX', '144', '121', 'Provisions réglementées relatives aux autres éléments de l''actif', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (125,'PCG99-BASE','CAPIT', 'XXXXXX', '145', '121', 'Amortissements dérogatoires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (126,'PCG99-BASE','CAPIT', 'XXXXXX', '146', '121', 'Provision spéciale de réévaluation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (127,'PCG99-BASE','CAPIT', 'XXXXXX', '147', '121', 'Plus-values réinvesties', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (128,'PCG99-BASE','CAPIT', 'XXXXXX', '148', '121', 'Autres provisions réglementées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (129,'PCG99-BASE','CAPIT', 'XXXXXX', '15','1501', 'Provisions pour risques et charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (130,'PCG99-BASE','CAPIT', 'XXXXXX', '151', '129', 'Provisions pour risques', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (131,'PCG99-BASE','CAPIT', 'XXXXXX', '153', '129', 'Provisions pour pensions et obligations similaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (132,'PCG99-BASE','CAPIT', 'XXXXXX', '154', '129', 'Provisions pour restructurations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (133,'PCG99-BASE','CAPIT', 'XXXXXX', '155', '129', 'Provisions pour impôts', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (134,'PCG99-BASE','CAPIT', 'XXXXXX', '156', '129', 'Provisions pour renouvellement des immobilisations (entreprises concessionnaires)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (135,'PCG99-BASE','CAPIT', 'XXXXXX', '157', '129', 'Provisions pour charges à répartir sur plusieurs exercices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (136,'PCG99-BASE','CAPIT', 'XXXXXX', '158', '129', 'Autres provisions pour charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (137,'PCG99-BASE','CAPIT', 'XXXXXX', '16','1501', 'Emprunts et dettes assimilees', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (138,'PCG99-BASE','CAPIT', 'XXXXXX', '161', '137', 'Emprunts obligataires convertibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (139,'PCG99-BASE','CAPIT', 'XXXXXX', '163', '137', 'Autres emprunts obligataires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (140,'PCG99-BASE','CAPIT', 'XXXXXX', '164', '137', 'Emprunts auprès des établissements de crédit', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (141,'PCG99-BASE','CAPIT', 'XXXXXX', '165', '137', 'Dépôts et cautionnements reçus', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (142,'PCG99-BASE','CAPIT', 'XXXXXX', '166', '137', 'Participation des salariés aux résultats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (143,'PCG99-BASE','CAPIT', 'XXXXXX', '167', '137', 'Emprunts et dettes assortis de conditions particulières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (144,'PCG99-BASE','CAPIT', 'XXXXXX', '168', '137', 'Autres emprunts et dettes assimilées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (145,'PCG99-BASE','CAPIT', 'XXXXXX', '169', '137', 'Primes de remboursement des obligations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (146,'PCG99-BASE','CAPIT', 'XXXXXX', '17','1501', 'Dettes rattachées à des participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (147,'PCG99-BASE','CAPIT', 'XXXXXX', '171', '146', 'Dettes rattachées à des participations (groupe)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (148,'PCG99-BASE','CAPIT', 'XXXXXX', '174', '146', 'Dettes rattachées à des participations (hors groupe)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (149,'PCG99-BASE','CAPIT', 'XXXXXX', '178', '146', 'Dettes rattachées à des sociétés en participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (150,'PCG99-BASE','CAPIT', 'XXXXXX', '18','1501', 'Comptes de liaison des établissements et sociétés en participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (151,'PCG99-BASE','CAPIT', 'XXXXXX', '181', '150', 'Comptes de liaison des établissements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (152,'PCG99-BASE','CAPIT', 'XXXXXX', '186', '150', 'Biens et prestations de services échangés entre établissements (charges)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (153,'PCG99-BASE','CAPIT', 'XXXXXX', '187', '150', 'Biens et prestations de services échangés entre établissements (produits)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (154,'PCG99-BASE','CAPIT', 'XXXXXX', '188', '150', 'Comptes de liaison des sociétés en participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (155,'PCG99-BASE','IMMO', 'XXXXXX', '20','1502', 'Immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (156,'PCG99-BASE','IMMO', 'XXXXXX', '201', '155', 'Frais d''établissement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (157,'PCG99-BASE','IMMO', 'XXXXXX', '203', '155', 'Frais de recherche et de développement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (158,'PCG99-BASE','IMMO', 'XXXXXX', '205', '155', 'Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (159,'PCG99-BASE','IMMO', 'XXXXXX', '206', '155', 'Droit au bail', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (160,'PCG99-BASE','IMMO', 'XXXXXX', '207', '155', 'Fonds commercial', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (161,'PCG99-BASE','IMMO', 'XXXXXX', '208', '155', 'Autres immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (162,'PCG99-BASE','IMMO', 'XXXXXX', '21','1502', 'Immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (163,'PCG99-BASE','IMMO', 'XXXXXX', '211', '162', 'Terrains', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (164,'PCG99-BASE','IMMO', 'XXXXXX', '212', '162', 'Agencements et aménagements de terrains', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (165,'PCG99-BASE','IMMO', 'XXXXXX', '213', '162', 'Constructions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (166,'PCG99-BASE','IMMO', 'XXXXXX', '214', '162', 'Constructions sur sol d''autrui', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (167,'PCG99-BASE','IMMO', 'XXXXXX', '215', '162', 'Installations techniques, matériels et outillage industriels', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (168,'PCG99-BASE','IMMO', 'XXXXXX', '218', '162', 'Autres immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (169,'PCG99-BASE','IMMO', 'XXXXXX', '22','1502', 'Immobilisations mises en concession', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (170,'PCG99-BASE','IMMO', 'XXXXXX', '23','1502', 'Immobilisations en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (171,'PCG99-BASE','IMMO', 'XXXXXX', '231', '170', 'Immobilisations corporelles en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (172,'PCG99-BASE','IMMO', 'XXXXXX', '232', '170', 'Immobilisations incorporelles en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (173,'PCG99-BASE','IMMO', 'XXXXXX', '237', '170', 'Avances et acomptes versés sur immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (174,'PCG99-BASE','IMMO', 'XXXXXX', '238', '170', 'Avances et acomptes versés sur commandes d''immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (175,'PCG99-BASE','IMMO', 'XXXXXX', '25','1502', 'Parts dans des entreprises liées et créances sur des entreprises liées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (176,'PCG99-BASE','IMMO', 'XXXXXX', '26','1502', 'Participations et créances rattachées à des participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (177,'PCG99-BASE','IMMO', 'XXXXXX', '261', '176', 'Titres de participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (178,'PCG99-BASE','IMMO', 'XXXXXX', '266', '176', 'Autres formes de participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (179,'PCG99-BASE','IMMO', 'XXXXXX', '267', '176', 'Créances rattachées à des participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (180,'PCG99-BASE','IMMO', 'XXXXXX', '268', '176', 'Créances rattachées à des sociétés en participation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (181,'PCG99-BASE','IMMO', 'XXXXXX', '269', '176', 'Versements restant à effectuer sur titres de participation non libérés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (182,'PCG99-BASE','IMMO', 'XXXXXX', '27','1502', 'Autres immobilisations financieres', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (183,'PCG99-BASE','IMMO', 'XXXXXX', '271', '183', 'Titres immobilisés autres que les titres immobilisés de l''activité de portefeuille (droit de propriété)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (184,'PCG99-BASE','IMMO', 'XXXXXX', '272', '183', 'Titres immobilisés (droit de créance)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (185,'PCG99-BASE','IMMO', 'XXXXXX', '273', '183', 'Titres immobilisés de l''activité de portefeuille', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (186,'PCG99-BASE','IMMO', 'XXXXXX', '274', '183', 'Prêts', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (187,'PCG99-BASE','IMMO', 'XXXXXX', '275', '183', 'Dépôts et cautionnements versés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (188,'PCG99-BASE','IMMO', 'XXXXXX', '276', '183', 'Autres créances immobilisées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (189,'PCG99-BASE','IMMO', 'XXXXXX', '277', '183', '(Actions propres ou parts propres)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (190,'PCG99-BASE','IMMO', 'XXXXXX', '279', '183', 'Versements restant à effectuer sur titres immobilisés non libérés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (191,'PCG99-BASE','IMMO', 'XXXXXX', '28','1502', 'Amortissements des immobilisations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (192,'PCG99-BASE','IMMO', 'XXXXXX', '280', '191', 'Amortissements des immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (193,'PCG99-BASE','IMMO', 'XXXXXX', '281', '191', 'Amortissements des immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (194,'PCG99-BASE','IMMO', 'XXXXXX', '282', '191', 'Amortissements des immobilisations mises en concession', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (195,'PCG99-BASE','IMMO', 'XXXXXX', '29','1502', 'Dépréciations des immobilisations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (196,'PCG99-BASE','IMMO', 'XXXXXX', '290', '195', 'Dépréciations des immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (197,'PCG99-BASE','IMMO', 'XXXXXX', '291', '195', 'Dépréciations des immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (198,'PCG99-BASE','IMMO', 'XXXXXX', '292', '195', 'Dépréciations des immobilisations mises en concession', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (199,'PCG99-BASE','IMMO', 'XXXXXX', '293', '195', 'Dépréciations des immobilisations en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (200,'PCG99-BASE','IMMO', 'XXXXXX', '296', '195', 'Provisions pour dépréciation des participations et créances rattachées à des participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (201,'PCG99-BASE','IMMO', 'XXXXXX', '297', '195', 'Provisions pour dépréciation des autres immobilisations financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (202,'PCG99-BASE','STOCK', 'XXXXXX', '31','1503', 'Matières premières (et fournitures)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (203,'PCG99-BASE','STOCK', 'XXXXXX', '311', '202', 'Matières (ou groupe) A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (204,'PCG99-BASE','STOCK', 'XXXXXX', '312', '202', 'Matières (ou groupe) B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (205,'PCG99-BASE','STOCK', 'XXXXXX', '317', '202', 'Fournitures A, B, C,', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (206,'PCG99-BASE','STOCK', 'XXXXXX', '32','1503', 'Autres approvisionnements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (207,'PCG99-BASE','STOCK', 'XXXXXX', '321', '206', 'Matières consommables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (208,'PCG99-BASE','STOCK', 'XXXXXX', '322', '206', 'Fournitures consommables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (209,'PCG99-BASE','STOCK', 'XXXXXX', '326', '206', 'Emballages', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (210,'PCG99-BASE','STOCK', 'XXXXXX', '33','1503', 'En-cours de production de biens', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (211,'PCG99-BASE','STOCK', 'XXXXXX', '331', '210', 'Produits en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (212,'PCG99-BASE','STOCK', 'XXXXXX', '335', '210', 'Travaux en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (213,'PCG99-BASE','STOCK', 'XXXXXX', '34','1503', 'En-cours de production de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (214,'PCG99-BASE','STOCK', 'XXXXXX', '341', '213', 'Etudes en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (215,'PCG99-BASE','STOCK', 'XXXXXX', '345', '213', 'Prestations de services en cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (216,'PCG99-BASE','STOCK', 'XXXXXX', '35','1503', 'Stocks de produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (217,'PCG99-BASE','STOCK', 'XXXXXX', '351', '216', 'Produits intermédiaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (218,'PCG99-BASE','STOCK', 'XXXXXX', '355', '216', 'Produits finis', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (219,'PCG99-BASE','STOCK', 'XXXXXX', '358', '216', 'Produits résiduels (ou matières de récupération)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (220,'PCG99-BASE','STOCK', 'XXXXXX', '37','1503', 'Stocks de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (221,'PCG99-BASE','STOCK', 'XXXXXX', '371', '220', 'Marchandises (ou groupe) A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (222,'PCG99-BASE','STOCK', 'XXXXXX', '372', '220', 'Marchandises (ou groupe) B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (223,'PCG99-BASE','STOCK', 'XXXXXX', '39','1503', 'Provisions pour dépréciation des stocks et en-cours', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (224,'PCG99-BASE','STOCK', 'XXXXXX', '391', '223', 'Provisions pour dépréciation des matières premières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (225,'PCG99-BASE','STOCK', 'XXXXXX', '392', '223', 'Provisions pour dépréciation des autres approvisionnements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (226,'PCG99-BASE','STOCK', 'XXXXXX', '393', '223', 'Provisions pour dépréciation des en-cours de production de biens', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (227,'PCG99-BASE','STOCK', 'XXXXXX', '394', '223', 'Provisions pour dépréciation des en-cours de production de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (228,'PCG99-BASE','STOCK', 'XXXXXX', '395', '223', 'Provisions pour dépréciation des stocks de produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (229,'PCG99-BASE','STOCK', 'XXXXXX', '397', '223', 'Provisions pour dépréciation des stocks de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (230,'PCG99-BASE','TIERS', 'XXXXXX', '40','1504', 'Fournisseurs et Comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (231,'PCG99-BASE','TIERS', 'XXXXXX', '400', '230', 'Fournisseurs et Comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (232,'PCG99-BASE','TIERS', 'SUPPLIER','401', '230', 'Fournisseurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (233,'PCG99-BASE','TIERS', 'XXXXXX', '403', '230', 'Fournisseurs - Effets à payer', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (234,'PCG99-BASE','TIERS', 'XXXXXX', '404', '230', 'Fournisseurs d''immobilisations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (235,'PCG99-BASE','TIERS', 'XXXXXX', '405', '230', 'Fournisseurs d''immobilisations - Effets à payer', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (236,'PCG99-BASE','TIERS', 'XXXXXX', '408', '230', 'Fournisseurs - Factures non parvenues', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (237,'PCG99-BASE','TIERS', 'XXXXXX', '409', '230', 'Fournisseurs débiteurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (238,'PCG99-BASE','TIERS', 'XXXXXX', '41','1504', 'Clients et comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (239,'PCG99-BASE','TIERS', 'XXXXXX', '410', '238', 'Clients et Comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (240,'PCG99-BASE','TIERS', 'CUSTOMER','411', '238', 'Clients', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (241,'PCG99-BASE','TIERS', 'XXXXXX', '413', '238', 'Clients - Effets à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (242,'PCG99-BASE','TIERS', 'XXXXXX', '416', '238', 'Clients douteux ou litigieux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (243,'PCG99-BASE','TIERS', 'XXXXXX', '418', '238', 'Clients - Produits non encore facturés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (244,'PCG99-BASE','TIERS', 'XXXXXX', '419', '238', 'Clients créditeurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (245,'PCG99-BASE','TIERS', 'XXXXXX', '42','1504', 'Personnel et comptes rattachés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (246,'PCG99-BASE','TIERS', 'XXXXXX', '421', '245', 'Personnel - Rémunérations dues', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (247,'PCG99-BASE','TIERS', 'XXXXXX', '422', '245', 'Comités d''entreprises, d''établissement, ...', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (248,'PCG99-BASE','TIERS', 'XXXXXX', '424', '245', 'Participation des salariés aux résultats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (249,'PCG99-BASE','TIERS', 'XXXXXX', '425', '245', 'Personnel - Avances et acomptes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (250,'PCG99-BASE','TIERS', 'XXXXXX', '426', '245', 'Personnel - Dépôts', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (251,'PCG99-BASE','TIERS', 'XXXXXX', '427', '245', 'Personnel - Oppositions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (252,'PCG99-BASE','TIERS', 'XXXXXX', '428', '245', 'Personnel - Charges à payer et produits à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (253,'PCG99-BASE','TIERS', 'XXXXXX', '43','1504', 'Sécurité sociale et autres organismes sociaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (254,'PCG99-BASE','TIERS', 'XXXXXX', '431', '253', 'Sécurité sociale', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (255,'PCG99-BASE','TIERS', 'XXXXXX', '437', '253', 'Autres organismes sociaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (256,'PCG99-BASE','TIERS', 'XXXXXX', '438', '253', 'Organismes sociaux - Charges à payer et produits à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (257,'PCG99-BASE','TIERS', 'XXXXXX', '44','1504', 'État et autres collectivités publiques', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (258,'PCG99-BASE','TIERS', 'XXXXXX', '441', '257', 'État - Subventions à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (259,'PCG99-BASE','TIERS', 'XXXXXX', '442', '257', 'Etat - Impôts et taxes recouvrables sur des tiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (260,'PCG99-BASE','TIERS', 'XXXXXX', '443', '257', 'Opérations particulières avec l''Etat, les collectivités publiques, les organismes internationaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (261,'PCG99-BASE','TIERS', 'XXXXXX', '444', '257', 'Etat - Impôts sur les bénéfices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (262,'PCG99-BASE','TIERS', 'XXXXXX', '445', '257', 'Etat - Taxes sur le chiffre d''affaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (263,'PCG99-BASE','TIERS', 'XXXXXX', '446', '257', 'Obligations cautionnées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (264,'PCG99-BASE','TIERS', 'XXXXXX', '447', '257', 'Autres impôts, taxes et versements assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (265,'PCG99-BASE','TIERS', 'XXXXXX', '448', '257', 'Etat - Charges à payer et produits à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (266,'PCG99-BASE','TIERS', 'XXXXXX', '449', '257', 'Quotas d''émission à restituer à l''Etat', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (267,'PCG99-BASE','TIERS', 'XXXXXX', '45','1504', 'Groupe et associes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (268,'PCG99-BASE','TIERS', 'XXXXXX', '451', '267', 'Groupe', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (269,'PCG99-BASE','TIERS', 'XXXXXX', '455', '267', 'Associés - Comptes courants', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (270,'PCG99-BASE','TIERS', 'XXXXXX', '456', '267', 'Associés - Opérations sur le capital', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (271,'PCG99-BASE','TIERS', 'XXXXXX', '457', '267', 'Associés - Dividendes à payer', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (272,'PCG99-BASE','TIERS', 'XXXXXX', '458', '267', 'Associés - Opérations faites en commun et en G.I.E.', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (273,'PCG99-BASE','TIERS', 'XXXXXX', '46','1504', 'Débiteurs divers et créditeurs divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (274,'PCG99-BASE','TIERS', 'XXXXXX', '462', '273', 'Créances sur cessions d''immobilisations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (275,'PCG99-BASE','TIERS', 'XXXXXX', '464', '273', 'Dettes sur acquisitions de valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (276,'PCG99-BASE','TIERS', 'XXXXXX', '465', '273', 'Créances sur cessions de valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (277,'PCG99-BASE','TIERS', 'XXXXXX', '467', '273', 'Autres comptes débiteurs ou créditeurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (278,'PCG99-BASE','TIERS', 'XXXXXX', '468', '273', 'Divers - Charges à payer et produits à recevoir', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (279,'PCG99-BASE','TIERS', 'XXXXXX', '47','1504', 'Comptes transitoires ou d''attente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (280,'PCG99-BASE','TIERS', 'XXXXXX', '471', '279', 'Comptes d''attente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (281,'PCG99-BASE','TIERS', 'XXXXXX', '476', '279', 'Différence de conversion - Actif', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (282,'PCG99-BASE','TIERS', 'XXXXXX', '477', '279', 'Différences de conversion - Passif', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (283,'PCG99-BASE','TIERS', 'XXXXXX', '478', '279', 'Autres comptes transitoires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (284,'PCG99-BASE','TIERS', 'XXXXXX', '48','1504', 'Comptes de régularisation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (285,'PCG99-BASE','TIERS', 'XXXXXX', '481', '284', 'Charges à répartir sur plusieurs exercices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (286,'PCG99-BASE','TIERS', 'XXXXXX', '486', '284', 'Charges constatées d''avance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (287,'PCG99-BASE','TIERS', 'XXXXXX', '487', '284', 'Produits constatés d''avance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (288,'PCG99-BASE','TIERS', 'XXXXXX', '488', '284', 'Comptes de répartition périodique des charges et des produits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (289,'PCG99-BASE','TIERS', 'XXXXXX', '489', '284', 'Quotas d''émission alloués par l''Etat', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (290,'PCG99-BASE','TIERS', 'XXXXXX', '49','1504', 'Provisions pour dépréciation des comptes de tiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (291,'PCG99-BASE','TIERS', 'XXXXXX', '491', '290', 'Provisions pour dépréciation des comptes de clients', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (292,'PCG99-BASE','TIERS', 'XXXXXX', '495', '290', 'Provisions pour dépréciation des comptes du groupe et des associés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (293,'PCG99-BASE','TIERS', 'XXXXXX', '496', '290', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (294,'PCG99-BASE','FINAN', 'XXXXXX', '50','1505', 'Valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (295,'PCG99-BASE','FINAN', 'XXXXXX', '501', '294', 'Parts dans des entreprises liées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (296,'PCG99-BASE','FINAN', 'XXXXXX', '502', '294', 'Actions propres', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (297,'PCG99-BASE','FINAN', 'XXXXXX', '503', '294', 'Actions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (298,'PCG99-BASE','FINAN', 'XXXXXX', '504', '294', 'Autres titres conférant un droit de propriété', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (299,'PCG99-BASE','FINAN', 'XXXXXX', '505', '294', 'Obligations et bons émis par la société et rachetés par elle', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (300,'PCG99-BASE','FINAN', 'XXXXXX', '506', '294', 'Obligations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (301,'PCG99-BASE','FINAN', 'XXXXXX', '507', '294', 'Bons du Trésor et bons de caisse à court terme', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (302,'PCG99-BASE','FINAN', 'XXXXXX', '508', '294', 'Autres valeurs mobilières de placement et autres créances assimilées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (303,'PCG99-BASE','FINAN', 'XXXXXX', '509', '294', 'Versements restant à effectuer sur valeurs mobilières de placement non libérées', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (304,'PCG99-BASE','FINAN', 'XXXXXX', '51','1505', 'Banques, établissements financiers et assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (305,'PCG99-BASE','FINAN', 'XXXXXX', '511', '304', 'Valeurs à l''encaissement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (306,'PCG99-BASE','FINAN', 'BANK', '512', '304', 'Banques', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (307,'PCG99-BASE','FINAN', 'XXXXXX', '514', '304', 'Chèques postaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (308,'PCG99-BASE','FINAN', 'XXXXXX', '515', '304', '"Caisses" du Trésor et des établissements publics', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (309,'PCG99-BASE','FINAN', 'XXXXXX', '516', '304', 'Sociétés de bourse', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (310,'PCG99-BASE','FINAN', 'XXXXXX', '517', '304', 'Autres organismes financiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (311,'PCG99-BASE','FINAN', 'XXXXXX', '518', '304', 'Intérêts courus', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (312,'PCG99-BASE','FINAN', 'XXXXXX', '519', '304', 'Concours bancaires courants', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (313,'PCG99-BASE','FINAN', 'XXXXXX', '52','1505', 'Instruments de trésorerie', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (314,'PCG99-BASE','FINAN', 'CASH', '53','1505', 'Caisse', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (315,'PCG99-BASE','FINAN', 'XXXXXX', '531', '314', 'Caisse siège social', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (316,'PCG99-BASE','FINAN', 'XXXXXX', '532', '314', 'Caisse succursale (ou usine) A', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (317,'PCG99-BASE','FINAN', 'XXXXXX', '533', '314', 'Caisse succursale (ou usine) B', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (318,'PCG99-BASE','FINAN', 'XXXXXX', '54','1505', 'Régies d''avance et accréditifs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (319,'PCG99-BASE','FINAN', 'XXXXXX', '58','1505', 'Virements internes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (320,'PCG99-BASE','FINAN', 'XXXXXX', '59','1505', 'Provisions pour dépréciation des comptes financiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (321,'PCG99-BASE','FINAN', 'XXXXXX', '590', '320', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (322,'PCG99-BASE','CHARGE','PRODUCT', '60','1506', 'Achats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','CHARGE','XXXXXX', '601', '322', 'Achats stockés - Matières premières (et fournitures)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','CHARGE','XXXXXX', '602', '322', 'Achats stockés - Autres approvisionnements', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','CHARGE','XXXXXX', '603', '322', 'Variations des stocks (approvisionnements et marchandises)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604', '322', 'Achats stockés - Matières premières (et fournitures)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','CHARGE','XXXXXX', '605', '322', 'Achats de matériel, équipements et travaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','CHARGE','XXXXXX', '606', '322', 'Achats non stockés de matière et fournitures', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','CHARGE','XXXXXX', '607', '322', 'Achats de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (330,'PCG99-BASE','CHARGE','XXXXXX', '608', '322', '(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (331,'PCG99-BASE','CHARGE','XXXXXX', '609', '322', 'Rabais, remises et ristournes obtenus sur achats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (332,'PCG99-BASE','CHARGE','SERVICE', '61','1506', 'Services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (333,'PCG99-BASE','CHARGE','XXXXXX', '611', '332', 'Sous-traitance générale', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (334,'PCG99-BASE','CHARGE','XXXXXX', '612', '332', 'Redevances de crédit-bail', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (335,'PCG99-BASE','CHARGE','XXXXXX', '613', '332', 'Locations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (336,'PCG99-BASE','CHARGE','XXXXXX', '614', '332', 'Charges locatives et de copropriété', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (337,'PCG99-BASE','CHARGE','XXXXXX', '615', '332', 'Entretien et réparations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (338,'PCG99-BASE','CHARGE','XXXXXX', '616', '332', 'Primes d''assurances', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (339,'PCG99-BASE','CHARGE','XXXXXX', '617', '332', 'Etudes et recherches', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (340,'PCG99-BASE','CHARGE','XXXXXX', '618', '332', 'Divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (341,'PCG99-BASE','CHARGE','XXXXXX', '619', '332', 'Rabais, remises et ristournes obtenus sur services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (342,'PCG99-BASE','CHARGE','XXXXXX', '62','1506', 'Autres services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (343,'PCG99-BASE','CHARGE','XXXXXX', '621', '342', 'Personnel extérieur à l''entreprise', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (344,'PCG99-BASE','CHARGE','XXXXXX', '622', '342', 'Rémunérations d''intermédiaires et honoraires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (345,'PCG99-BASE','CHARGE','XXXXXX', '623', '342', 'Publicité, publications, relations publiques', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (346,'PCG99-BASE','CHARGE','XXXXXX', '624', '342', 'Transports de biens et transports collectifs du personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (347,'PCG99-BASE','CHARGE','XXXXXX', '625', '342', 'Déplacements, missions et réceptions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (348,'PCG99-BASE','CHARGE','XXXXXX', '626', '342', 'Frais postaux et de télécommunications', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (349,'PCG99-BASE','CHARGE','XXXXXX', '627', '342', 'Services bancaires et assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (350,'PCG99-BASE','CHARGE','XXXXXX', '628', '342', 'Divers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (351,'PCG99-BASE','CHARGE','XXXXXX', '629', '342', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (352,'PCG99-BASE','CHARGE','XXXXXX', '63','1506', 'Impôts, taxes et versements assimilés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (353,'PCG99-BASE','CHARGE','XXXXXX', '631', '352', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (354,'PCG99-BASE','CHARGE','XXXXXX', '633', '352', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (355,'PCG99-BASE','CHARGE','XXXXXX', '635', '352', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (356,'PCG99-BASE','CHARGE','XXXXXX', '637', '352', 'Autres impôts, taxes et versements assimilés (autres organismes)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (357,'PCG99-BASE','CHARGE','XXXXXX', '64','1506', 'Charges de personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (358,'PCG99-BASE','CHARGE','XXXXXX', '641', '357', 'Rémunérations du personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (359,'PCG99-BASE','CHARGE','XXXXXX', '644', '357', 'Rémunération du travail de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (360,'PCG99-BASE','CHARGE','SOCIAL', '645', '357', 'Charges de sécurité sociale et de prévoyance', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (361,'PCG99-BASE','CHARGE','XXXXXX', '646', '357', 'Cotisations sociales personnelles de l''exploitant', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (362,'PCG99-BASE','CHARGE','XXXXXX', '647', '357', 'Autres charges sociales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (363,'PCG99-BASE','CHARGE','XXXXXX', '648', '357', 'Autres charges de personnel', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (364,'PCG99-BASE','CHARGE','XXXXXX', '65','1506', 'Autres charges de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (365,'PCG99-BASE','CHARGE','XXXXXX', '651', '364', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (366,'PCG99-BASE','CHARGE','XXXXXX', '653', '364', 'Jetons de présence', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (367,'PCG99-BASE','CHARGE','XXXXXX', '654', '364', 'Pertes sur créances irrécouvrables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (368,'PCG99-BASE','CHARGE','XXXXXX', '655', '364', 'Quote-part de résultat sur opérations faites en commun', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (369,'PCG99-BASE','CHARGE','XXXXXX', '658', '364', 'Charges diverses de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (370,'PCG99-BASE','CHARGE','XXXXXX', '66','1506', 'Charges financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (371,'PCG99-BASE','CHARGE','XXXXXX', '661', '370', 'Charges d''intérêts', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (372,'PCG99-BASE','CHARGE','XXXXXX', '664', '370', 'Pertes sur créances liées à des participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (373,'PCG99-BASE','CHARGE','XXXXXX', '665', '370', 'Escomptes accordés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (374,'PCG99-BASE','CHARGE','XXXXXX', '666', '370', 'Pertes de change', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (375,'PCG99-BASE','CHARGE','XXXXXX', '667', '370', 'Charges nettes sur cessions de valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (376,'PCG99-BASE','CHARGE','XXXXXX', '668', '370', 'Autres charges financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (377,'PCG99-BASE','CHARGE','XXXXXX', '67','1506', 'Charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (378,'PCG99-BASE','CHARGE','XXXXXX', '671', '377', 'Charges exceptionnelles sur opérations de gestion', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (379,'PCG99-BASE','CHARGE','XXXXXX', '672', '377', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les charges sur exercices antérieurs)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (380,'PCG99-BASE','CHARGE','XXXXXX', '675', '377', 'Valeurs comptables des éléments d''actif cédés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (381,'PCG99-BASE','CHARGE','XXXXXX', '678', '377', 'Autres charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (382,'PCG99-BASE','CHARGE','XXXXXX', '68','1506', 'Dotations aux amortissements et aux provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (383,'PCG99-BASE','CHARGE','XXXXXX', '681', '382', 'Dotations aux amortissements et aux provisions - Charges d''exploitation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (384,'PCG99-BASE','CHARGE','XXXXXX', '686', '382', 'Dotations aux amortissements et aux provisions - Charges financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (385,'PCG99-BASE','CHARGE','XXXXXX', '687', '382', 'Dotations aux amortissements et aux provisions - Charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (386,'PCG99-BASE','CHARGE','XXXXXX', '69','1506', 'Participation des salariés - impôts sur les bénéfices et assimiles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (387,'PCG99-BASE','CHARGE','XXXXXX', '691', '386', 'Participation des salariés aux résultats', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (388,'PCG99-BASE','CHARGE','XXXXXX', '695', '386', 'Impôts sur les bénéfices', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (389,'PCG99-BASE','CHARGE','XXXXXX', '696', '386', 'Suppléments d''impôt sur les sociétés liés aux distributions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (390,'PCG99-BASE','CHARGE','XXXXXX', '697', '386', 'Imposition forfaitaire annuelle des sociétés', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (391,'PCG99-BASE','CHARGE','XXXXXX', '698', '386', 'Intégration fiscale', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (392,'PCG99-BASE','CHARGE','XXXXXX', '699', '386', 'Produits - Reports en arrière des déficits', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (393,'PCG99-BASE','PROD', 'XXXXXX', '70','1507', 'Ventes de produits fabriqués, prestations de services, marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (394,'PCG99-BASE','PROD', 'PRODUCT', '701', '393', 'Ventes de produits finis', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (395,'PCG99-BASE','PROD', 'XXXXXX', '702', '393', 'Ventes de produits intermédiaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (396,'PCG99-BASE','PROD', 'XXXXXX', '703', '393', 'Ventes de produits résiduels', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (397,'PCG99-BASE','PROD', 'XXXXXX', '704', '393', 'Travaux', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (398,'PCG99-BASE','PROD', 'XXXXXX', '705', '393', 'Etudes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (399,'PCG99-BASE','PROD', 'SERVICE', '706', '393', 'Prestations de services', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (400,'PCG99-BASE','PROD', 'PRODUCT', '707', '393', 'Ventes de marchandises', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (401,'PCG99-BASE','PROD', 'PRODUCT', '708', '393', 'Produits des activités annexes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (402,'PCG99-BASE','PROD', 'XXXXXX', '709', '393', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (403,'PCG99-BASE','PROD', 'XXXXXX', '71','1507', 'Production stockée (ou déstockage)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (404,'PCG99-BASE','PROD', 'XXXXXX', '713', '403', 'Variation des stocks (en-cours de production, produits)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (405,'PCG99-BASE','PROD', 'XXXXXX', '72','1507', 'Production immobilisée', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (406,'PCG99-BASE','PROD', 'XXXXXX', '721', '405', 'Immobilisations incorporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (407,'PCG99-BASE','PROD', 'XXXXXX', '722', '405', 'Immobilisations corporelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (408,'PCG99-BASE','PROD', 'XXXXXX', '74','1507', 'Subventions d''exploitation', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (409,'PCG99-BASE','PROD', 'XXXXXX', '75','1507', 'Autres produits de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (410,'PCG99-BASE','PROD', 'XXXXXX', '751', '409', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (411,'PCG99-BASE','PROD', 'XXXXXX', '752', '409', 'Revenus des immeubles non affectés à des activités professionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (412,'PCG99-BASE','PROD', 'XXXXXX', '753', '409', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (413,'PCG99-BASE','PROD', 'XXXXXX', '754', '409', 'Ristournes perçues des coopératives (provenant des excédents)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (414,'PCG99-BASE','PROD', 'XXXXXX', '755', '409', 'Quotes-parts de résultat sur opérations faites en commun', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (415,'PCG99-BASE','PROD', 'XXXXXX', '758', '409', 'Produits divers de gestion courante', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (416,'PCG99-BASE','PROD', 'XXXXXX', '76','1507', 'Produits financiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (417,'PCG99-BASE','PROD', 'XXXXXX', '761', '416', 'Produits de participations', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (418,'PCG99-BASE','PROD', 'XXXXXX', '762', '416', 'Produits des autres immobilisations financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (419,'PCG99-BASE','PROD', 'XXXXXX', '763', '416', 'Revenus des autres créances', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (420,'PCG99-BASE','PROD', 'XXXXXX', '764', '416', 'Revenus des valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (421,'PCG99-BASE','PROD', 'XXXXXX', '765', '416', 'Escomptes obtenus', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (422,'PCG99-BASE','PROD', 'XXXXXX', '766', '416', 'Gains de change', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (423,'PCG99-BASE','PROD', 'XXXXXX', '767', '416', 'Produits nets sur cessions de valeurs mobilières de placement', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (424,'PCG99-BASE','PROD', 'XXXXXX', '768', '416', 'Autres produits financiers', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (425,'PCG99-BASE','PROD', 'XXXXXX', '77','1507', 'Produits exceptionnels', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (426,'PCG99-BASE','PROD', 'XXXXXX', '771', '425', 'Produits exceptionnels sur opérations de gestion', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (427,'PCG99-BASE','PROD', 'XXXXXX', '772', '425', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les produits sur exercices antérieurs)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (428,'PCG99-BASE','PROD', 'XXXXXX', '775', '425', 'Produits des cessions d''éléments d''actif', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (429,'PCG99-BASE','PROD', 'XXXXXX', '777', '425', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (430,'PCG99-BASE','PROD', 'XXXXXX', '778', '425', 'Autres produits exceptionnels', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (431,'PCG99-BASE','PROD', 'XXXXXX', '78','1507', 'Reprises sur amortissements et provisions', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (432,'PCG99-BASE','PROD', 'XXXXXX', '781', '431', 'Reprises sur amortissements et provisions (à inscrire dans les produits d''exploitation)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (433,'PCG99-BASE','PROD', 'XXXXXX', '786', '431', 'Reprises sur provisions pour risques (à inscrire dans les produits financiers)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (434,'PCG99-BASE','PROD', 'XXXXXX', '787', '431', 'Reprises sur provisions (à inscrire dans les produits exceptionnels)', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (435,'PCG99-BASE','PROD', 'XXXXXX', '79','1507', 'Transferts de charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','PROD', 'XXXXXX', '791', '435', 'Transferts de charges d''exploitation ', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','PROD', 'XXXXXX', '796', '435', 'Transferts de charges financières', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','PROD', 'XXXXXX', '797', '435', 'Transferts de charges exceptionnelles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1501,'PCG99-BASE','CAPIT', 'XXXXXX', '1', '', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1502,'PCG99-BASE','IMMO', 'XXXXXX', '2', '', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1503,'PCG99-BASE','STOCK', 'XXXXXX', '3', '', 'Stock et commandes en cours d''exécution', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1504,'PCG99-BASE','TIERS', 'XXXXXX', '4', '', 'Créances et dettes à un an au plus', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1505,'PCG99-BASE','FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1506,'PCG99-BASE','CHARGE','XXXXXX', '6', '', 'Charges', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1507,'PCG99-BASE','PROD', 'XXXXXX', '7', '', 'Produits', '1'); -- -- Descriptif des plans comptables BE PCMN-BASE From 36c4d272e773a1fd9c963ab109e53c9c645393e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Jul 2014 08:45:10 +0200 Subject: [PATCH 352/502] Fix: phpunit test --- test/phpunit/FunctionsLibTest.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 8bf126e99c5..2b81f46e978 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -558,22 +558,26 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase */ public function testImgPicto() { - $s=img_picto('alt','user'); + $s=img_picto('title','user'); print __METHOD__." s=".$s."\n"; $this->assertContains('theme',$s,'testImgPicto1'); - $s=img_picto('alt','img.png','style="float: right"',0); + $s=img_picto('title','img.png','style="float: right"',0); print __METHOD__." s=".$s."\n"; $this->assertContains('theme',$s,'testImgPicto2'); $this->assertContains('style="float: right"',$s,'testImgPicto2'); - $s=img_picto('alt','/fullpath/img.png','',1); + $s=img_picto('title','/fullpath/img.png','',1); print __METHOD__." s=".$s."\n"; - $this->assertEquals($s,'alt','testImgPicto3'); + $this->assertEquals('',$s,'testImgPicto3'); - $s=img_picto('alt','/fullpath/img.png','',true); + $s=img_picto('title','/fullpath/img.png','',true); print __METHOD__." s=".$s."\n"; - $this->assertEquals($s,'alt','testImgPicto3'); + $this->assertEquals('',$s,'testImgPicto4'); + + $s=img_picto('title:alt','/fullpath/img.png','',true); + print __METHOD__." s=".$s."\n"; + $this->assertEquals('alt',$s,'testImgPicto5'); } /** From a779eea202616dcd9d0de07d865c259c96d59e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 30 Jul 2014 15:17:57 +0200 Subject: [PATCH 353/502] Restored JSON reimplementation --- htdocs/core/lib/json.lib.php | 244 ++++++++++++++++++++++++++++++++++- 1 file changed, 240 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index dc87a04224a..69dbb4eba1a 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -23,16 +23,194 @@ * \ingroup core */ +if (! function_exists('json_encode')) +{ + /** + * Implement json_encode for PHP that does not support it + * + * @param mixed $elements PHP Object to json encode + * @return string Json encoded string + */ + function json_encode($elements) + { + return dol_json_encode($elements); + } +} + /** * Implement json_encode for PHP that does not support it * * @param mixed $elements PHP Object to json encode * @return string Json encoded string - * @deprecated Use json_encode native function */ function dol_json_encode($elements) { - return json_encode($elements); + $num=count($elements); + if (is_object($elements)) // Count number of properties for an object + { + $num=0; + foreach($elements as $key => $value) $num++; + } + //var_dump($num); + + // determine type + 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); $i < $num; $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.= ']'; + } + else + { + // associative (object) + $output = '{'; + $last = $num - 1; + $i = 0; + $tmpelements=array(); + if (is_array($elements)) $tmpelements=$elements; + if (is_object($elements)) $tmpelements=get_object_vars($elements); + foreach($tmpelements as $key => $value) + { + $output .= '"'.$key.'":'; + if (is_array($value)) $output.= json_encode($value); + else $output .= _val($value); + if ($i !== $last) $output.= ','; + ++$i; + } + $output.= '}'; + } + + // return + return $output; +} + +/** + * Return text according to type + * + * @param mixed $val Value to show + * @return string Formated value + */ +function _val($val) +{ + if (is_string($val)) + { + // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT + $ascii = ''; + $strlen_var = strlen($val); + + /* + * Iterate over every character in the string, + * escaping with a slash or encoding to UTF-8 where necessary + */ + for ($c = 0; $c < $strlen_var; ++$c) { + + $ord_var_c = ord($val{$c}); + + switch (true) { + case $ord_var_c == 0x08: + $ascii .= '\b'; + break; + case $ord_var_c == 0x09: + $ascii .= '\t'; + break; + case $ord_var_c == 0x0A: + $ascii .= '\n'; + break; + case $ord_var_c == 0x0C: + $ascii .= '\f'; + break; + case $ord_var_c == 0x0D: + $ascii .= '\r'; + break; + + case $ord_var_c == 0x22: + case $ord_var_c == 0x2F: + case $ord_var_c == 0x5C: + // double quote, slash, slosh + $ascii .= '\\'.$val{$c}; + break; + + case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): + // characters U-00000000 - U-0000007F (same as ASCII) + $ascii .= $val{$c}; + break; + + case (($ord_var_c & 0xE0) == 0xC0): + // characters U-00000080 - U-000007FF, mask 110XXXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($val{$c + 1})); + $c += 1; + $utf16 = utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF0) == 0xE0): + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($val{$c + 1}), ord($val{$c + 2})); + $c += 2; + $utf16 = utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF8) == 0xF0): + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($val{$c + 1}), ord($val{$c + 2}), ord($val{$c + 3})); + $c += 3; + $utf16 = utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFC) == 0xF8): + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($val{$c + 1}), ord($val{$c + 2}), ord($val{$c + 3}), ord($val{$c + 4})); + $c += 4; + $utf16 = utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFE) == 0xFC): + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($val{$c + 1}), ord($val{$c + 2}), ord($val{$c + 3}), ord($val{$c + 4}), ord($val{$c + 5})); + $c += 5; + $utf16 = utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + } + } + + return '"'.$ascii.'"'; + } + elseif (is_int($val)) return sprintf('%d', $val); + elseif (is_float($val)) return sprintf('%F', $val); + elseif (is_bool($val)) return ($val ? 'true' : 'false'); + else return 'null'; +} + +if (! function_exists('json_decode')) +{ + /** + * Implement json_decode for PHP that does not support it + * + * @param string $json Json encoded to PHP Object or Array + * @param bool $assoc False return an object, true return an array + * @return mixed Object or Array + */ + function json_decode($json, $assoc=false) + { + return dol_json_decode($json, $assoc); + } } /** @@ -41,11 +219,69 @@ function dol_json_encode($elements) * @param string $json Json encoded to PHP Object or Array * @param bool $assoc False return an object, true return an array. Try to always use it with true ! * @return mixed Object or Array - * @deprecated Use json_decode native function */ function dol_json_decode($json, $assoc=false) { - return json_decode($json, $assoc); + $comment = false; + + $out=''; + $strLength = strlen($json); // Must stay strlen and not dol_strlen because we want technical length, not visible length + for ($i=0; $i<$strLength; $i++) + { + if (! $comment) + { + if (($json[$i] == '{') || ($json[$i] == '[')) $out.= 'array('; + else if (($json[$i] == '}') || ($json[$i] == ']')) $out.= ')'; + else if ($json[$i] == ':') $out.= ' => '; + else $out.=$json[$i]; + } + else $out.= $json[$i]; + if ($json[$i] == '"' && $json[($i-1)]!="\\") $comment = !$comment; + } + + $out=_unval($out); + + // Return an array + if ($out != '') eval('$array = '.$out.';'); + else $array=array(); + + // Return an object + if (! $assoc) + { + if (! empty($array)) + { + $object = false; + + foreach ($array as $key => $value) + { + $object->{$key} = $value; + } + + return $object; + } + + return false; + } + + return $array; +} + +/** + * Return text according to type + * + * @param mixed $val Value to decode + * @return string Formated value + */ +function _unval($val) +{ + while (preg_match('/\\\u([0-9A-F]{2})([0-9A-F]{2})/i', $val, $reg)) + { + // single, escaped unicode character + $utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2])); + $utf8 = utf162utf8($utf16); + $val=preg_replace('/\\\u'.$reg[1].$reg[2].'/i',$utf8,$val); + } + return $val; } /** From 42c7fc1c8d9b3c58b00b4b11f10b9a5e2d7a4fca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 30 Jul 2014 15:19:31 +0200 Subject: [PATCH 354/502] Revert "Testing dol_json_encode is not interesting now as it uses a core function" --- test/phpunit/JsonLibTest.php | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index 67485c118e2..caceb6d0dc3 100755 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -116,4 +116,57 @@ class JsonLibTest extends PHPUnit_Framework_TestCase print __METHOD__."\n"; } + /** + * testJsonEncode + * + * @return void + */ + public function testJsonEncode() + { + //$this->sharedFixture + global $conf,$user,$langs,$db; + $this->savconf=$conf; + $this->savuser=$user; + $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); + $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'); + + // 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'; + $objecttotest->property2=1234; + $objecttotest->property3=$now; + $encoded=dol_json_encode($objecttotest); + $this->assertEquals('{"property1":"abc","property2":1234,"property3":43200}',$encoded); + + } + } From 972d3c69b67ab24e80d06dc32602485556adbc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 30 Jul 2014 15:42:58 +0200 Subject: [PATCH 355/502] Removed duplicated requires. Json.lib.php is included with functions.lib.php --- htdocs/compta/ajaxpayment.php | 1 - htdocs/core/boxes/box_graph_invoices_permonth.php | 1 - htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 1 - htdocs/core/boxes/box_graph_orders_permonth.php | 1 - htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 1 - htdocs/core/boxes/box_graph_product_distribution.php | 1 - htdocs/core/boxes/box_graph_propales_permonth.php | 1 - htdocs/main.inc.php | 1 - htdocs/product/stock/massstockmove.php | 1 - test/phpunit/JsonLibTest.php | 1 - 10 files changed, 10 deletions(-) diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index 66a1c997be3..4753687c9d9 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -32,7 +32,6 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't nee //if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $langs->load('compta'); diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index bece2e55c6f..da94427aec3 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -104,7 +104,6 @@ class box_graph_invoices_permonth extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 4214a9a81b8..a14dba58674 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -103,7 +103,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 7389c2c6b8b..d158923a1de 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -104,7 +104,6 @@ class box_graph_orders_permonth extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 788528b501f..6fbca8d3e9e 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -103,7 +103,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index a05c4baf5ad..78f25ccd724 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -96,7 +96,6 @@ class box_graph_product_distribution extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $year=$tmparray['year']; $showinvoicenb=$tmparray['showinvoicenb']; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index d80d40c64f2..fd4fb385bcc 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -104,7 +104,6 @@ class box_graph_propales_permonth extends ModeleBoxes } else { - include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f35d493a485..08f1fd47d47 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -166,7 +166,6 @@ require_once 'filefunc.inc.php'; // If there is a POST parameter to tell to save automatically some POST parameters into a cookies, we do it if (! empty($_POST["DOL_AUTOSET_COOKIE"])) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; $tmpautoset=explode(':',$_POST["DOL_AUTOSET_COOKIE"],2); $tmplist=explode(',',$tmpautoset[1]); $cookiearrayvalue=''; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index afe9e20e28b..0458ddd6aff 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -25,7 +25,6 @@ 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'; diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index caceb6d0dc3..1a7127c69b1 100755 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -27,7 +27,6 @@ global $conf,$user,$langs,$db; //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver //require_once 'PHPUnit/Autoload.php'; require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; -require_once dirname(__FILE__).'/../../htdocs/core/lib/json.lib.php'; if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); From 1c97b3f7796d62641c38871664a4f231f3bfe863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 30 Jul 2014 15:47:19 +0200 Subject: [PATCH 356/502] Replaced usage of dol_json_encode and dol_json_decode with json_encode and json_decode. If json module is not installed, it will refer to dol_json_encode/decode --- htdocs/compta/ajaxpayment.php | 2 +- htdocs/core/boxes/box_graph_invoices_permonth.php | 2 +- .../boxes/box_graph_invoices_supplier_permonth.php | 2 +- htdocs/core/boxes/box_graph_orders_permonth.php | 2 +- .../boxes/box_graph_orders_supplier_permonth.php | 2 +- htdocs/core/boxes/box_graph_product_distribution.php | 2 +- htdocs/core/boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/class/stats.class.php | 12 ++++++------ htdocs/main.inc.php | 2 +- htdocs/product/stock/massstockmove.php | 6 +++--- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index 4753687c9d9..27a167bc576 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -114,4 +114,4 @@ $toJsonArray['result'] = price($result); // Return value to user format $toJsonArray['resultnum'] = price2num($result); // Return value to numeric format // Encode to JSON to return -echo dol_json_encode($toJsonArray); // Printing the call's result +echo json_encode($toJsonArray); // Printing the call's result diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index da94427aec3..0d24ed22dcc 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -104,7 +104,7 @@ class box_graph_invoices_permonth extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; $showtot=$tmparray['showtot']; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index a14dba58674..a9da4d7bb16 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -103,7 +103,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; $showtot=$tmparray['showtot']; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index d158923a1de..86ddd77c108 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -104,7 +104,7 @@ class box_graph_orders_permonth extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; $showtot=$tmparray['showtot']; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 6fbca8d3e9e..2fb4f17cebb 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -103,7 +103,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; $showtot=$tmparray['showtot']; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 78f25ccd724..b186200daca 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -96,7 +96,7 @@ class box_graph_product_distribution extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $year=$tmparray['year']; $showinvoicenb=$tmparray['showinvoicenb']; $showpropalnb=$tmparray['showpropalnb']; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index fd4fb385bcc..7d9eae4e878 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -104,7 +104,7 @@ class box_graph_propales_permonth extends ModeleBoxes } else { - $tmparray=dol_json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); + $tmparray=json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode],true); $endyear=$tmparray['year']; $shownb=$tmparray['shownb']; $showtot=$tmparray['showtot']; diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index b2e85b3113a..8a4ffd29d68 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -81,7 +81,7 @@ abstract class Stats if ($foundintocache) // Cache file found and is not too old { dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); - $data = dol_json_decode(file_get_contents($newpathofdestfile), true); + $data = json_decode(file_get_contents($newpathofdestfile), true); } else { @@ -112,7 +112,7 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk."); if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp); $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, dol_json_encode($data)); + fwrite($fp, json_encode($data)); fclose($fp); if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; @chmod($newpathofdestfile, octdec($newmask)); @@ -172,7 +172,7 @@ abstract class Stats if ($foundintocache) // Cache file found and is not too old { dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); - $data = dol_json_decode(file_get_contents($newpathofdestfile), true); + $data = json_decode(file_get_contents($newpathofdestfile), true); } else { @@ -203,7 +203,7 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk."); if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp); $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, dol_json_encode($data)); + fwrite($fp, json_encode($data)); fclose($fp); if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; @chmod($newpathofdestfile, octdec($newmask)); @@ -295,7 +295,7 @@ abstract class Stats if ($foundintocache) // Cache file found and is not too old { dol_syslog(get_class($this).'::'.__FUNCTION__." read data from cache file ".$newpathofdestfile." ".$filedate."."); - $data = dol_json_decode(file_get_contents($newpathofdestfile), true); + $data = json_decode(file_get_contents($newpathofdestfile), true); } else { @@ -309,7 +309,7 @@ abstract class Stats dol_syslog(get_class($this).'::'.__FUNCTION__." save cache file ".$newpathofdestfile." onto disk."); if (! dol_is_dir($conf->user->dir_temp)) dol_mkdir($conf->user->dir_temp); $fp = fopen($newpathofdestfile, 'w'); - fwrite($fp, dol_json_encode($data)); + fwrite($fp, json_encode($data)); fclose($fp); if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; @chmod($newpathofdestfile, octdec($newmask)); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 08f1fd47d47..15ee098945f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -176,7 +176,7 @@ if (! empty($_POST["DOL_AUTOSET_COOKIE"])) if (! empty($_POST[$postkey])) $cookiearrayvalue[$tmpkey]=$_POST[$postkey]; } $cookiename=$tmpautoset[0]; - $cookievalue=dol_json_encode($cookiearrayvalue); + $cookievalue=json_encode($cookiearrayvalue); //var_dump('setcookie cookiename='.$cookiename.' cookievalue='.$cookievalue); setcookie($cookiename, empty($cookievalue)?'':$cookievalue, empty($cookievalue)?0:(time()+(86400*354)), '/'); // keep cookie 1 year if (empty($cookievalue)) unset($_COOKIE[$cookiename]); diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 0458ddd6aff..b8fcee3e618 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -64,7 +64,7 @@ $limit = $conf->liste_limit; $offset = $limit * $page ; $listofdata=array(); -if (! empty($_SESSION['massstockmove'])) $listofdata=dol_json_decode($_SESSION['massstockmove'],true); +if (! empty($_SESSION['massstockmove'])) $listofdata=json_decode($_SESSION['massstockmove'],true); /* @@ -105,7 +105,7 @@ if ($action == 'addline') if (count(array_keys($listofdata)) > 0) $id=max(array_keys($listofdata)) + 1; else $id=1; $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); + $_SESSION['massstockmove']=json_encode($listofdata); unset($id_product); //unset($id_sw); @@ -117,7 +117,7 @@ if ($action == 'addline') if ($action == 'delline' && $idline != '') { if (! empty($listofdata[$idline])) unset($listofdata[$idline]); - if (count($listofdata) > 0) $_SESSION['massstockmove']=dol_json_encode($listofdata); + if (count($listofdata) > 0) $_SESSION['massstockmove']=json_encode($listofdata); else unset($_SESSION['massstockmove']); } From 50e3049fd7abc8358e743462b69082cc4d8a7e0e Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 30 Jul 2014 17:10:08 +0200 Subject: [PATCH 357/502] External user must not have graph box with all stats --- htdocs/core/boxes/box_graph_invoices_permonth.php | 3 +-- htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 3 +-- htdocs/core/boxes/box_graph_orders_permonth.php | 3 +-- htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 3 +-- htdocs/core/boxes/box_graph_propales_permonth.php | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index a7006d1f4e1..b9345112b54 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -115,11 +115,10 @@ class box_graph_invoices_permonth extends ModeleBoxes if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; $mode='customer'; - $userid=0; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0)); + $stats = new FactureStats($this->db, $socid, $mode, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index f306b26eb28..feafaa9a52f 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -114,11 +114,10 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; $mode='supplier'; - $userid=0; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new FactureStats($this->db, 0, $mode, ($userid>0?$userid:0)); + $stats = new FactureStats($this->db, $socid, $mode, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index e701a4b9384..eeec318662a 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -115,11 +115,10 @@ class box_graph_orders_permonth extends ModeleBoxes if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; $mode='customer'; - $userid=0; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0)); + $stats = new CommandeStats($this->db, $socid, $mode, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 56d822876a0..d2b58b78446 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -114,11 +114,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; $mode='supplier'; - $userid=0; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new CommandeStats($this->db, 0, $mode, ($userid>0?$userid:0)); + $stats = new CommandeStats($this->db, $socid, $mode, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 8efa4be54a8..3b5ffd287fc 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -115,11 +115,10 @@ class box_graph_propales_permonth extends ModeleBoxes if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; $mode='customer'; - $userid=0; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new PropaleStats($this->db, 0, $mode, ($userid>0?$userid:0)); + $stats = new PropaleStats($this->db, $socid, $mode, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) From 6645b8a454fbeded6017c0ba6ded04d785638e7f Mon Sep 17 00:00:00 2001 From: frederic34 Date: Thu, 31 Jul 2014 10:21:47 +0200 Subject: [PATCH 358/502] Cannot redeclare getmypid() --- dev/skeletons/skeleton_script.php | 2 +- htdocs/core/lib/functions.lib.php | 26 ++++++++++--------- .../phpexcel/PHPExcel/Shared/PDF/tcpdf.php | 2 +- .../includes/tcpdf/include/tcpdf_static.php | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php index 877a420d6af..35904c9bfd3 100644 --- a/dev/skeletons/skeleton_script.php +++ b/dev/skeletons/skeleton_script.php @@ -57,7 +57,7 @@ if (! $result > 0) { dol_print_error('',$user->error); exit; } $user->getrights(); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; if (! isset($argv[1])) { // Check parameters print "Usage: ".$script_file." param1 param2 ...\n"; exit(-1); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f658d2550dc..b75c7036719 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2333,7 +2333,7 @@ function dol_print_error($db='',$error='') else // Mode CLI { $out.='> '.$langs->transnoentities("ErrorInternalErrorDetected").":\n".$argv[0]."\n"; - $syslog.="pid=".getmypid(); + $syslog.="pid=".dol_getmypid(); } if (is_object($db)) @@ -4742,18 +4742,20 @@ function dol_set_focus($selector) } -if (! function_exists('getmypid')) +/** + * Return getmypid() or random PID when function is disabled + * Some web hosts disable this php function for security reasons + * and sometimes we can't redeclare function + * + * @return int + */ +function dol_getmypid() { - /** - * Return random PID - * Some web hosts disable this php function for security reasons - * - * @return int - */ - function getmypid() - { - return rand(1,32768); - } + if (! function_exists('getmypid')) { + return rand(1,32768); + } else { + return getmypid(); + } } diff --git a/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/tcpdf.php b/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/tcpdf.php index 6a155c19396..47b23913fe3 100644 --- a/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/tcpdf.php +++ b/htdocs/includes/phpexcel/PHPExcel/Shared/PDF/tcpdf.php @@ -11427,7 +11427,7 @@ class TCPDF { } $seed .= uniqid('', true); $seed .= rand(); - $seed .= getmypid(); + $seed .= dol_getmypid(); $seed .= __FILE__; $seed .= $this->bufferlen; if (isset($_SERVER['REMOTE_ADDR'])) { diff --git a/htdocs/includes/tcpdf/include/tcpdf_static.php b/htdocs/includes/tcpdf/include/tcpdf_static.php index 19eccc477b4..bc1e4abcc5b 100644 --- a/htdocs/includes/tcpdf/include/tcpdf_static.php +++ b/htdocs/includes/tcpdf/include/tcpdf_static.php @@ -1358,7 +1358,7 @@ class TCPDF_STATIC { } $seed .= uniqid('', true); $seed .= rand(); - $seed .= getmypid(); + $seed .= dol_getmypid(); $seed .= __FILE__; if (isset($_SERVER['REMOTE_ADDR'])) { $seed .= $_SERVER['REMOTE_ADDR']; From 5f80e9ed201f8011a58672dc9ac696f026292944 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Thu, 31 Jul 2014 16:52:00 +0200 Subject: [PATCH 359/502] Update propal.php Correct typo --- htdocs/comm/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 1753a82f38c..9b47a302398 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2012,7 +2012,7 @@ if ($action == 'create') { } // Bank Account - print '
'; print ''; From 5aea97affd06c32f4ddc930c504f8ae1517231c5 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 31 Jul 2014 17:02:17 +0200 Subject: [PATCH 360/502] Update fournisseur.commande.class.php missing code for extrafields --- htdocs/fourn/class/fournisseur.commande.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index a70b71c7b5f..5e6d3796cc4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2013 Philippe Grand + * Copyright (C) 2010-2014 Philippe Grand * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador @@ -191,6 +191,13 @@ class CommandeFournisseur extends CommonOrder $this->extraparams = (array) json_decode($obj->extraparams, true); $this->db->free($resql); + + // Retreive all extrafield + // fetch optionals attributes and labels + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); if ($this->statut == 0) $this->brouillon = 1; From 212e9825a3974bbef19f96405c26eae63eb0a828 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Jul 2014 17:35:58 +0200 Subject: [PATCH 361/502] Qual: Function getmypid were renamed into dol_getmypid. --- scripts/bank/export-bank-receipts.php | 2 +- scripts/company/export-contacts-xls-example.php | 2 +- scripts/company/sync_contacts_dolibarr2ldap.php | 2 +- scripts/contracts/email_expire_services_to_customers.php | 2 +- scripts/contracts/email_expire_services_to_representatives.php | 2 +- scripts/cron/cron_run_jobs.php | 2 +- scripts/emailings/mailing-send.php | 2 +- scripts/invoices/email_unpaid_invoices_to_customers.php | 2 +- scripts/invoices/email_unpaid_invoices_to_representatives.php | 2 +- scripts/invoices/rebuild_merge_pdf.php | 2 +- scripts/members/sync_members_dolibarr2ldap.php | 2 +- scripts/members/sync_members_ldap2dolibarr.php | 2 +- scripts/user/sync_groups_dolibarr2ldap.php | 2 +- scripts/user/sync_groups_ldap2dolibarr.php | 2 +- scripts/user/sync_users_dolibarr2ldap.php | 2 +- scripts/user/sync_users_ldap2dolibarr.php | 2 +- scripts/withdrawals/build_withdrawal_file.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 5d59914f743..91b1140d1a1 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -59,7 +59,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); if (! isset($argv[3]) || ! $argv[3]) { diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index bf55c4a2eaf..f9469848c31 100755 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -59,7 +59,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $fname = DOL_DATA_ROOT.'/export-contacts.xls'; diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index e64c54eb1de..8a582a77f74 100755 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -56,7 +56,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); print "Mails sending disabled (useless in batch mode)\n"; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 0a8dc701206..8f2fef6a9d6 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -67,7 +67,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 5d4fa4f0e32..ae51af38009 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -65,7 +65,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index d2e62831da8..94bde0fb153 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -69,7 +69,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; // Check security key if ($key != $conf->global->CRON_KEY) diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index bef84644256..b1577cb26a2 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -56,7 +56,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 6ddf05a99c1..0b5e66f49da 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -66,7 +66,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 87b11b13a37..2960e2eb685 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -65,7 +65,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index f68bff66cb8..357a09ccdbe 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -56,7 +56,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); // Check parameters diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index 072d78f6317..13529561a80 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -51,7 +51,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); if (! isset($argv[1]) || ! $argv[1]) { diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index d081065a3fa..34a22b40038 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -56,7 +56,7 @@ $forcecommit=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index d75f84a9cdb..d751c5ed90c 100755 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -54,7 +54,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); /* diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 3170714124b..c6bed990c14 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -56,7 +56,7 @@ $forcecommit=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index ea56d86a8ec..91ad440e9b2 100755 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -54,7 +54,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); /* diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 774a56c45e5..05c7777e677 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -55,7 +55,7 @@ $excludeuser=array(); */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php index b8be0c9b244..cb01c3f6678 100755 --- a/scripts/withdrawals/build_withdrawal_file.php +++ b/scripts/withdrawals/build_withdrawal_file.php @@ -50,7 +50,7 @@ $error=0; */ @set_time_limit(0); -print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; dol_syslog($script_file." launched with arg ".join(',',$argv)); $datetimeprev = dol_now(); From 9fff30416ac4cb66049adbe2ef4fe95057d8b1e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Jul 2014 20:12:21 +0200 Subject: [PATCH 362/502] Qual: Remove usage of getStaticMember function dir constants. --- htdocs/admin/system/database.php | 2 +- htdocs/admin/system/index.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 2 +- htdocs/admin/tools/dolibarr_import.php | 2 +- htdocs/admin/tools/export.php | 2 +- htdocs/core/db/DoliDB.class.php | 4 ---- htdocs/core/db/mssql.class.php | 4 ++-- htdocs/core/db/mysql.class.php | 4 ++-- htdocs/core/db/mysqli.class.php | 4 ++-- htdocs/core/db/pgsql.class.php | 4 ++-- htdocs/core/db/sqlite.class.php | 4 ++-- htdocs/install/etape1.php | 2 -- htdocs/install/fileconf.php | 6 +++--- htdocs/install/upgrade.php | 2 +- 14 files changed, 19 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index d9833a13d01..d7f39530502 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -44,7 +44,7 @@ print_fiche_titre($langs->trans("InfoDatabase"),'','setup'); // Database print '
'; print $langs->trans('BankAccount'); print '
'; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index a9d6cfa1afb..71ce99d5525 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -86,7 +86,7 @@ print "
\n"; // Database print '
'.$langs->trans("Database").'
'.$langs->trans("Version").''.getStaticMember(get_class($db),'label').' '.$db->getVersion().'
'.$langs->trans("Version").''.$db::label.' '.$db->getVersion().'
'.$langs->trans("DatabaseServer").''.$conf->db->host.'
'.$langs->trans("DatabasePort").''.(empty($conf->db->port)?$langs->trans("Default"):$conf->db->port).'
'.$langs->trans("DatabaseName").''.$conf->db->name.'
'; print "\n"; -$dblabel=getStaticMember(get_class($db),'label'); +$dblabel=$db::label; $dbversion=$db->getVersion(); print "\n"; print '
".$langs->trans("Database")."
".$langs->trans("Version")."" .$dblabel." ".$dbversion."
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 8154cfffb08..9f4e62155c2 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -65,7 +65,7 @@ if ($action == 'delete') $form=new Form($db); $formfile = new FormFile($db); -$label=getStaticMember($db, 'label'); +$label=$db::label; $help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; llxHeader('','',$help_url); diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 61e7e1e68a1..b18aefc75a5 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -38,7 +38,7 @@ $showpass=GETPOST('showpass'); * View */ -$label=getStaticMember($db, 'label'); +$label=$db::label; $help_url='EN:Restores|FR:Restaurations|ES:Restauraciones'; llxHeader('','',$help_url); diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8dccf89de09..ca12f3fbc38 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -416,7 +416,7 @@ function backup_tables($outputfile, $tables='*') // Print headers and global mysql config vars $sqlhead = ''; - $sqlhead .= "-- ".getStaticMember($db, 'label')." dump via php + $sqlhead .= "-- ".$db::label." dump via php -- -- Host: ".$db->db->host_info." Database: ".$db->database_name." -- ------------------------------------------------------ diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index aa0792c5970..e0921f7acac 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -32,14 +32,10 @@ abstract class DoliDB implements Database public $db; //! Database type public $type; - //! Database label - static $label; //! Charset used to force charset when creating database public $forcecharset='utf8'; //! Collate used to force collate when creating database public $forcecollate='utf8_general_ci'; - //! Min database version - static $versionmin; //! Resultset of last query private $_results; //! 1 if connected, else 0 diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 39b9afdb75b..820706cd6f1 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -33,13 +33,13 @@ class DoliDBMssql extends DoliDB //! Database type public $type='mssql'; //! Database label - static $label='MSSQL'; + const label='MSSQL'; //! Charset used to force charset when creating database var $forcecharset='latin1'; // Can't be static as it may be forced with a dynamic value //! Collate used to force collate when creating database var $forcecollate='latin1_swedish_ci'; // Can't be static as it may be forced with a dynamic value //! Version min database - static $versionmin=array(2000); + const versionmin='2000'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 8f852aba3ec..ac1a6d0e2f6 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -34,9 +34,9 @@ class DoliDBMysql extends DoliDB //! Database type public $type='mysql'; //! Database label - static $label='MySQL'; + const label='MySQL'; //! Version min database - static $versionmin=array(4,1,0); + const versionmin='4.1.0'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index d44e37b7591..e86490ac88c 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -34,9 +34,9 @@ class DoliDBMysqli extends DoliDB //! Database type public $type='mysqli'; //! Database label - static $label='MySQL'; + const label='MySQL'; //! Version min database - static $versionmin=array(4,1,0); + const versionmin='4.1.0'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 61de279e24c..9110d7cea06 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -37,13 +37,13 @@ class DoliDBPgsql extends DoliDB //! Database type public $type='pgsql'; // Name of manager //! Database label - static $label='PostgreSQL'; // Label of manager + const label='PostgreSQL'; // Label of manager //! Charset var $forcecharset='UTF8'; // Can't be static as it may be forced with a dynamic value //! Collate used to force collate when creating database var $forcecollate=''; // Can't be static as it may be forced with a dynamic value //! Version min database - static $versionmin=array(8,4,0); // Version min database + const versionmin='8.4.0'; // Version min database //! Resultset of last query private $_results; diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 924f489fc4d..fbae9300ddd 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -34,9 +34,9 @@ class DoliDBSqlite extends DoliDB //! Database type public $type='sqlite'; //! Database label - static $label='PDO Sqlite'; + const label='PDO Sqlite'; //! Version min database - static $versionmin=array(3,0,0); + const versionmin='3.0.0'; //! Resultset of last query private $_results; diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 43d063bf270..831283c6a46 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -256,8 +256,6 @@ if (! $error && $db->connected) { if (! empty($_POST["db_create_database"])) // If we create database, we force default value { - //$defaultCharacterSet=getStaticMember(get_class($db),'forcecharset'); - //$defaultDBSortingCollation=getStaticMember(get_class($db),'forcecollate'); $defaultCharacterSet=$db->forcecharset; $defaultDBSortingCollation=$db->forcecollate; } diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 665d766a8dd..7e681e1b21b 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -307,10 +307,10 @@ if (! empty($force_install_message)) include_once $dir."/".$file; if ($type == 'sqlite') continue; // We hide sqlite because support can't be complete unti sqlit does not manage foreign key creation after table creation - + // Version min of database - $versionbasemin=getStaticMember($class, 'versionmin'); - $note='('.getStaticMember($class, 'label').' >= '.versiontostring($versionbasemin).')'; + $versionbasemin=explode('.',$class::versionmin); + $note='('.$class::label.' >= '.$class::versionmin.')'; // Switch to mysql if mysqli is not present if ($defaultype=='mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql'; diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 875f5974dd7..f88047e5017 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -168,7 +168,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version"); // Test database version - $versionmindb=getStaticMember(get_class($db),'versionmin'); + $versionmindb=$db::versionmin; //print join('.',$versionarray).' - '.join('.',$versionmindb); if (count($versionmindb) && count($versionarray) && versioncompare($versionarray,$versionmindb) < 0) From 1e09200347e40baa6458259835361e0ba7bbf0c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 31 Jul 2014 20:49:50 +0200 Subject: [PATCH 363/502] Prepare to add foreign key toward parent into table llx_accountingaccount. --- htdocs/install/mysql/tables/llx_accountingaccount.key.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_accountingaccount.key.sql b/htdocs/install/mysql/tables/llx_accountingaccount.key.sql index 5ddd524592e..49758c3d4ea 100644 --- a/htdocs/install/mysql/tables/llx_accountingaccount.key.sql +++ b/htdocs/install/mysql/tables/llx_accountingaccount.key.sql @@ -20,5 +20,6 @@ ALTER TABLE llx_accountingaccount ADD INDEX idx_accountingaccount_fk_pcg_version (fk_pcg_version); - ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_pcg_version FOREIGN KEY (fk_pcg_version) REFERENCES llx_accounting_system (pcg_version); + +--ALTER TABLE llx_accountingaccount ADD CONSTRAINT fk_accountingaccount_fk_account_number FOREIGN KEY (fk_account_number) REFERENCES llx_accountingaccount (account_number); From b1e3ac5181015c9bbacd70fcb92e59dd5870e16a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 00:29:13 +0200 Subject: [PATCH 364/502] Track we renamed getmypid into dol_getmypid. --- dev/dolibarr_changes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 7f3490da165..f63969ea170 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -44,6 +44,8 @@ In htdocs/includes/tcpdf/tcpdf.php - protected $default_monospaced_font = 'courier'; + protected $default_monospaced_font = 'freemono'; +* Renamed getmypid into dol_getmypid(). + JSGANTT: -------- From 852b78f79fd59c68ebfb7997dc4d918539777731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 00:53:29 +0200 Subject: [PATCH 365/502] Removed 2 other call to getStaticMember (pb with php 5.5).Fix PHPCS for constants into database driver classes. --- htdocs/admin/boxes.php | 3 ++- htdocs/admin/system/database.php | 2 +- htdocs/admin/system/index.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 2 +- htdocs/admin/tools/dolibarr_import.php | 2 +- htdocs/admin/tools/export.php | 8 +++---- htdocs/core/class/infobox.class.php | 21 ++++++++++++------- htdocs/core/db/mssql.class.php | 4 ++-- htdocs/core/db/mysql.class.php | 4 ++-- htdocs/core/db/mysqli.class.php | 4 ++-- htdocs/core/db/pgsql.class.php | 4 ++-- htdocs/core/db/sqlite.class.php | 4 ++-- htdocs/core/modules/DolibarrModules.class.php | 7 ++++--- htdocs/install/fileconf.php | 6 +++--- htdocs/install/upgrade.php | 2 +- 15 files changed, 42 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 0a23b26f36c..c88d7717084 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -35,8 +35,9 @@ if (! $user->admin) accessforbidden(); $rowid = GETPOST('rowid','int'); $action = GETPOST('action','alpha'); + // Define possible position of boxes -$pos_name = getStaticMember('InfoBox','listOfPages'); +$pos_name = InfoBox::getListOfPagesForBoxes(); $boxes = array(); diff --git a/htdocs/admin/system/database.php b/htdocs/admin/system/database.php index d7f39530502..1cacc757971 100644 --- a/htdocs/admin/system/database.php +++ b/htdocs/admin/system/database.php @@ -44,7 +44,7 @@ print_fiche_titre($langs->trans("InfoDatabase"),'','setup'); // Database print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 71ce99d5525..30bd3f80d4a 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -86,7 +86,7 @@ print "
\n"; // Database print '
'.$langs->trans("Database").'
'.$langs->trans("Version").''.$db::label.' '.$db->getVersion().'
'.$langs->trans("Version").''.$db::LABEL.' '.$db->getVersion().'
'.$langs->trans("DatabaseServer").''.$conf->db->host.'
'.$langs->trans("DatabasePort").''.(empty($conf->db->port)?$langs->trans("Default"):$conf->db->port).'
'.$langs->trans("DatabaseName").''.$conf->db->name.'
'; print "\n"; -$dblabel=$db::label; +$dblabel=$db::LABEL; $dbversion=$db->getVersion(); print "\n"; print '
".$langs->trans("Database")."
".$langs->trans("Version")."" .$dblabel." ".$dbversion."
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 9f4e62155c2..74037147760 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -65,7 +65,7 @@ if ($action == 'delete') $form=new Form($db); $formfile = new FormFile($db); -$label=$db::label; +$label=$db::LABEL; $help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; llxHeader('','',$help_url); diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index b18aefc75a5..d66df365afa 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -38,7 +38,7 @@ $showpass=GETPOST('showpass'); * View */ -$label=$db::label; +$label=$db::LABEL; $help_url='EN:Restores|FR:Restaurations|ES:Restauraciones'; llxHeader('','',$help_url); diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index ca12f3fbc38..57fbb045a02 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -416,7 +416,7 @@ function backup_tables($outputfile, $tables='*') // Print headers and global mysql config vars $sqlhead = ''; - $sqlhead .= "-- ".$db::label." dump via php + $sqlhead .= "-- ".$db::LABEL." dump via php -- -- Host: ".$db->db->host_info." Database: ".$db->database_name." -- ------------------------------------------------------ @@ -464,11 +464,11 @@ function backup_tables($outputfile, $tables='*') fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n"); if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back) if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n"); - + $sql='SELECT * FROM '.$table; $result = $db->query($sql); $num_fields = $db->num_rows($result); - while($row = $db->fetch_row($result)) + while($row = $db->fetch_row($result)) { // For each row of data we print a line of INSERT fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES ('); @@ -497,7 +497,7 @@ function backup_tables($outputfile, $tables='*') fwrite($handle,"\n\n\n"); } } - + /* Backup Procedure structure*/ /* $result = $db->query('SHOW PROCEDURE STATUS'); diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 41380593375..fdc2d6fbe4f 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -23,12 +23,19 @@ */ /** - * Class to manage boxes on pages + * Class to manage boxes on pages. This is an utility class (all is static) */ class InfoBox { - static $listOfPages = array(0=>'Home'); // Nom des positions 0=Home, 1=... - + /** + * Name of positions 0=Home, 1=... + * + * @return array Array with list of zones + */ + static function getListOfPagesForBoxes() + { + return array(0=>'Home'); + } /** * Return array of boxes qualified for area and user @@ -137,12 +144,12 @@ class InfoBox $arrayelem=explode('|',$moduleelem); $tmpenabled=0; // $tmpenabled is used for the '|' test (OR) foreach($arrayelem as $module) - { + { $tmpmodule=preg_replace('/@[^@]+/','',$module); - if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1; + if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1; //print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'
'; } - if (empty($tmpenabled)) // We found at least one module required that disabled + if (empty($tmpenabled)) // We found at least one module required that disabled { $enabled=0; break; @@ -150,7 +157,7 @@ class InfoBox } } //print '=>'.$boxname.'-enabled='.$enabled.'
'; - + //print 'xx module='.$module.' enabled='.$enabled; if ($enabled) $boxes[]=$box; else unset($box); diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 820706cd6f1..e3ba9ef6a0e 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -33,13 +33,13 @@ class DoliDBMssql extends DoliDB //! Database type public $type='mssql'; //! Database label - const label='MSSQL'; + const LABEL='MSSQL'; //! Charset used to force charset when creating database var $forcecharset='latin1'; // Can't be static as it may be forced with a dynamic value //! Collate used to force collate when creating database var $forcecollate='latin1_swedish_ci'; // Can't be static as it may be forced with a dynamic value //! Version min database - const versionmin='2000'; + const VERSIONMIN='2000'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index ac1a6d0e2f6..7f51091c442 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -34,9 +34,9 @@ class DoliDBMysql extends DoliDB //! Database type public $type='mysql'; //! Database label - const label='MySQL'; + const LABEL='MySQL'; //! Version min database - const versionmin='4.1.0'; + const VERSIONMIN='4.1.0'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index e86490ac88c..a88a88f369b 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -34,9 +34,9 @@ class DoliDBMysqli extends DoliDB //! Database type public $type='mysqli'; //! Database label - const label='MySQL'; + const LABEL='MySQL'; //! Version min database - const versionmin='4.1.0'; + const VERSIONMIN='4.1.0'; //! Resultset of last query private $_results; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 9110d7cea06..396e780f2b6 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -37,13 +37,13 @@ class DoliDBPgsql extends DoliDB //! Database type public $type='pgsql'; // Name of manager //! Database label - const label='PostgreSQL'; // Label of manager + const LABEL='PostgreSQL'; // Label of manager //! Charset var $forcecharset='UTF8'; // Can't be static as it may be forced with a dynamic value //! Collate used to force collate when creating database var $forcecollate=''; // Can't be static as it may be forced with a dynamic value //! Version min database - const versionmin='8.4.0'; // Version min database + const VERSIONMIN='8.4.0'; // Version min database //! Resultset of last query private $_results; diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index fbae9300ddd..dd040a9b199 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -34,9 +34,9 @@ class DoliDBSqlite extends DoliDB //! Database type public $type='sqlite'; //! Database label - const label='PDO Sqlite'; + const LABEL='PDO Sqlite'; //! Version min database - const versionmin='3.0.0'; + const VERSIONMIN='3.0.0'; //! Resultset of last query private $_results; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 1657efa6e46..1215f8e85e2 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -523,8 +523,10 @@ abstract class DolibarrModules if (is_array($this->boxes)) { - foreach ($this->boxes as $key => $value) - { + $pos_name = InfoBox::getListOfPagesForBoxes(); + + foreach ($this->boxes as $key => $value) + { $file = isset($this->boxes[$key]['file'])?$this->boxes[$key]['file']:''; $note = isset($this->boxes[$key]['note'])?$this->boxes[$key]['note']:''; $enabledbydefaulton = isset($this->boxes[$key]['enabledbydefaulton'])?$this->boxes[$key]['enabledbydefaulton']:'Home'; @@ -564,7 +566,6 @@ abstract class DolibarrModules { $lastid=$this->db->last_insert_id(MAIN_DB_PREFIX."boxes_def","rowid"); - $pos_name = getStaticMember('InfoBox','listOfPages'); foreach ($pos_name as $key2 => $val2) { //print 'key2='.$key2.'-val2='.$val2."
\n"; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 7e681e1b21b..2c6a5730100 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -307,10 +307,10 @@ if (! empty($force_install_message)) include_once $dir."/".$file; if ($type == 'sqlite') continue; // We hide sqlite because support can't be complete unti sqlit does not manage foreign key creation after table creation - + // Version min of database - $versionbasemin=explode('.',$class::versionmin); - $note='('.$class::label.' >= '.$class::versionmin.')'; + $versionbasemin=explode('.',$class::VERSIONMIN); + $note='('.$class::LABEL.' >= '.$class::VERSIONMIN.')'; // Switch to mysql if mysqli is not present if ($defaultype=='mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql'; diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index f88047e5017..d89596e25e6 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -168,7 +168,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version"); // Test database version - $versionmindb=$db::versionmin; + $versionmindb=$db::VERSIONMIN; //print join('.',$versionarray).' - '.join('.',$versionmindb); if (count($versionmindb) && count($versionarray) && versioncompare($versionarray,$versionmindb) < 0) From 96a4aa2d26bf065d58d0c62e18ae2c5fa5dec8d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 01:31:52 +0200 Subject: [PATCH 366/502] Fix: phpunit --- htdocs/core/lib/functions2.lib.php | 20 +++++++------- test/phpunit/Functions2LibTest.php | 44 ++++++++++++++++++------------ 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5bec87ea726..5cfad135973 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -395,12 +395,12 @@ function isValidMailDomain($mail) * :// [user[:pass]@] hostname [port] [/path] [?getquery] [anchor] * * @param string $url Url - * @param int $http 1: verify http, 0: not verify http - * @param int $pass 1: verify user and pass, 0: not verify user and pass - * @param int $port 1: verify port, 0: not verify port - * @param int $path 1: verify path, 0: not verify path - * @param int $query 1: verify query, 0: not verify query - * @param int $anchor 1: verify anchor, 0: not verify anchor + * @param int $http 1: verify http is provided, 0: not verify http + * @param int $pass 1: verify user and pass is provided, 0: not verify user and pass + * @param int $port 1: verify port is provided, 0: not verify port + * @param int $path 1: verify a path is provided "/" or "/..." or "/.../", 0: not verify path + * @param int $query 1: verify query is provided, 0: not verify query + * @param int $anchor 1: verify anchor is provided, 0: not verify anchor * @return int 1=Check is OK, 0=Check is KO */ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) @@ -415,9 +415,9 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) if ($pass) $urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$_.-]+)?@)"; // HOSTNAME OR IP - //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; // http://x = allowed (ex. http://localhost, http://routerlogin) - //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)+"; // http://x.x = minimum - $urlregex .= "([a-z0-9+\$_-]+\.)*[a-z0-9+\$_-]{2,3}"; // http://x.xx(x) = minimum + //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)*"; // x allowed (ex. http://localhost, http://routerlogin) + //$urlregex .= "[a-z0-9+\$_-]+(\.[a-z0-9+\$_-]+)+"; // x.x + $urlregex .= "([a-z0-9+\$_\\\:-])+(\.[a-z0-9+\$_-][a-z0-9+\$_-]+)*"; // x ou x.xx (2 x ou plus) //use only one of the above // PORT @@ -434,7 +434,7 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) { $ValidUrl = 1; } - //print $urlregex.' - '.$url.' - '.$ValidUrl;exit; + print $urlregex.' - '.$url.' - '.$ValidUrl; return $ValidUrl; } diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 743bfce1801..969810cb314 100755 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -148,52 +148,60 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase { //Simple check $result = isValidUrl('http://google.com'); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); - $result = isValidUrl('gooçgle'); - $this->assertEquals($result, 0); + $result = isValidUrl('goo=gle'); // This is good, it might be an alias of hostname + $this->assertEquals(1, $result); //With scheme check $result = isValidUrl('http://www.google.com', 1); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); $result = isValidUrl('ftp://www.google.com', 1); - $this->assertEquals($result, 0); + $this->assertEquals(0, $result); - //With password check - $result = isValidUrl('http://user:password@http://www.google.com', 1, 1); - $this->assertEquals($result, 1); + //With password check invalid. This test should be ko but currently it is not + //$result = isValidUrl('http://user:password@http://www.google.com', 1, 1); + //$this->assertEquals(0, $result); + + //With password check valid + $result = isValidUrl('http://user:password@www.google.com', 1, 1); + $this->assertEquals(1, $result); $result = isValidUrl('http://www.google.com', 1, 1); - $this->assertEquals($result, 0); + $this->assertEquals(0, $result); //With port check $result = isValidUrl('http://google.com:8080', 0, 0, 1); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); $result = isValidUrl('http://google.com', 0, 0, 1); - $this->assertEquals($result, 0); + $this->assertEquals(0, $result); //With path check $result = isValidUrl('http://google.com/search', 0, 0, 0, 1); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); - $result = isValidUrl('http://google.com', 0, 0, 0, 1); - $this->assertEquals($result, 0); + $result = isValidUrl('http://google.com', 0, 0, 0, 0); + $this->assertEquals(1, $result); //With query check $result = isValidUrl('http://google.com/search?test=test', 0, 0, 0, 0, 1); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); + + //With query check + $result = isValidUrl('http://google.com?test=test', 0, 0, 0, 0, 1); + $this->assertEquals(1, $result); $result = isValidUrl('http://google.com', 0, 0, 0, 0, 1); - $this->assertEquals($result, 0); + $this->assertEquals(0, $result); //With anchor check $result = isValidUrl('http://google.com/search#done', 0, 0, 0, 0, 0, 1); - $this->assertEquals($result, 1); + $this->assertEquals(1, $result); $result = isValidUrl('http://google.com/search', 0, 0, 0, 0, 0, 1); - $this->assertEquals($result, 0); + $this->assertEquals(0, $result); } /** From 94fee7af70314578ce689d9acbc0f69543b22619 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 1 Aug 2014 08:59:08 +0200 Subject: [PATCH 367/502] Call trigger added in commonobjectline --- htdocs/core/class/commonobjectline.class.php | 28 ++++++++++++++++++++ htdocs/fichinter/class/fichinter.class.php | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index bb253d2eded..675e1cf0794 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -28,6 +28,34 @@ */ abstract class CommonObjectLine { + /** + * Call trigger based on this instance + * NB: Error from trigger are stacked in interface->errors + * NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction. + * + * @param string $trigger_name trigger's name to execute + * @param User $user Object user + * @return int Result of run_triggers + */ + function call_trigger($trigger_name, $user) + { + global $langs,$conf; + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers($trigger_name,$this,$user,$langs,$conf); + if ($result < 0) + { + if (!empty($this->errors)) + { + $this->errors=array_merge($this->errors,$interface->errors); + } + else + { + $this->errors=$interface->errors; + } + } + return $result; + } } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 916f69d850b..930f9371522 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -24,6 +24,7 @@ * \brief Fichier de la classe des gestion des fiches interventions */ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php'; /** @@ -998,7 +999,7 @@ class Fichinter extends CommonObject /** * Classe permettant la gestion des lignes d'intervention */ -class FichinterLigne extends CommonObject +class FichinterLigne extends CommonObjectLine { var $db; var $error; From 268aabbacd019c872e3574986daac566c57a053e Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 1 Aug 2014 13:25:29 +0200 Subject: [PATCH 368/502] Fix: Price by customer --- htdocs/contrat/fiche.php | 30 +++++++++++++++++----- htdocs/product/fiche.php | 55 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 8 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index e073566c55f..0677a725f74 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -6,6 +6,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -421,6 +422,10 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $tva_tx = get_default_tva($mysoc,$object->thirdparty,$prod->id); $tva_npr = get_default_npr($mysoc,$object->thirdparty,$prod->id); + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; // On defini prix unitaire if ($conf->global->PRODUIT_MULTIPRICES && $object->thirdparty->price_level) @@ -430,13 +435,24 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $price_min = $prod->multiprices_min[$object->thirdparty->price_level]; $price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level]; } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + + $prodcustprice = new Productcustomerprice($db); + + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) { + if (count($prodcustprice->lines) > 0) { + $pu_ht = price($prodcustprice->lines [0]->price); + $pu_ttc = price($prodcustprice->lines [0]->price_ttc); + $price_base_type = $prodcustprice->lines [0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + } + } + } // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 2473c0cbd46..7499e8b0f2a 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -5,11 +5,12 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Auguria SARL - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Marcos García * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2011-2014 Alexandre Spangaro * Copyright (C) 2014 Cédric Gross + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -513,6 +514,24 @@ if (empty($reshook)) $pu_ttc = $object->multiprices_ttc[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level]; } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + + $prodcustprice = new Productcustomerprice($db); + + $filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id); + + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) { + if (count($prodcustprice->lines) > 0) { + $pu_ht = price($prodcustprice->lines [0]->price); + $pu_ttc = price($prodcustprice->lines [0]->price_ttc); + $price_base_type = $prodcustprice->lines [0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + } + } + } // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). @@ -586,7 +605,24 @@ if (empty($reshook)) $pu_ttc = $object->multiprices_ttc[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level]; } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($db); + + $filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id); + + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) { + if (count($prodcustprice->lines) > 0) { + $pu_ht = price($prodcustprice->lines [0]->price); + $pu_ttc = price($prodcustprice->lines [0]->price_ttc); + $price_base_type = $prodcustprice->lines [0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + } + } + } // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). if ($tva_tx != $object->tva_tx) @@ -659,7 +695,24 @@ if (empty($reshook)) $pu_ttc = $object->multiprices_ttc[$soc->price_level]; $price_base_type = $object->multiprices_base_type[$soc->price_level]; } + elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) + { + require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php'; + $prodcustprice = new Productcustomerprice($db); + + $filter = array('t.fk_product' => $object->id,'t.fk_soc' => $soc->id); + + $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); + if ($result) { + if (count($prodcustprice->lines) > 0) { + $pu_ht = price($prodcustprice->lines [0]->price); + $pu_ttc = price($prodcustprice->lines [0]->price_ttc); + $price_base_type = $prodcustprice->lines [0]->price_base_type; + $prod->tva_tx = $prodcustprice->lines [0]->tva_tx; + } + } + } // On reevalue prix selon taux tva car taux tva transaction peut etre different // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). if ($tva_tx != $object->tva_tx) From bb8ec0c8f9349afa5aa901e918fa0d8d84da73d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 14:26:13 +0200 Subject: [PATCH 369/502] Fix: Too many parameter --- dev/initdata/generate-facture.php | 2 +- dev/initdata/generate-propale.php | 3 +- htdocs/adherents/class/adherent.class.php | 22 +++++------ htdocs/commande/class/commande.class.php | 37 ++++++++++--------- htdocs/compta/bank/bankid_fr.php | 2 +- htdocs/compta/bank/fiche.php | 26 ++++++------- .../boxes/box_graph_propales_permonth.php | 6 +-- htdocs/core/class/translate.class.php | 8 ++-- ...interface_50_modLdap_Ldapsynchro.class.php | 8 ++-- htdocs/fourn/product/categorie.php | 4 +- htdocs/fourn/product/liste.php | 2 +- htdocs/holiday/fiche.php | 2 +- htdocs/install/upgrade2.php | 8 ++-- htdocs/main.inc.php | 16 +++++--- htdocs/margin/customerMargins.php | 2 +- htdocs/margin/tabs/thirdpartyMargins.php | 2 +- htdocs/user/logout.php | 2 +- 17 files changed, 78 insertions(+), 74 deletions(-) diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php index 0316671d62b..5c630454ba7 100755 --- a/dev/initdata/generate-facture.php +++ b/dev/initdata/generate-facture.php @@ -94,7 +94,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) print "Invoice ".$i." for socid ".$socid; - $facture = new Facture($db, $socids[$socid]); + $facture = new Facture($db); $facture->date = time(); $facture->cond_reglement_id = 3; $facture->mode_reglement_id = 3; diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php index a62df516481..2efd2af2f08 100755 --- a/dev/initdata/generate-propale.php +++ b/dev/initdata/generate-propale.php @@ -122,7 +122,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $soc = new Societe($db); - $propal = new Propal($db, $socids[$socid]); + $propal = new Propal($db); $obj = $conf->global->PROPALE_ADDON; $modPropale = new $obj; @@ -130,6 +130,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $propal->ref = $numpr; $propal->contactid = $contids[$socids[$socid]][0]; + $propal->socid = $socids[$socid]; $propal->datep = time(); $propal->cond_reglement_id = 3; $propal->mode_reglement_id = 3; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 38032741330..4bee90b7a50 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -187,7 +187,7 @@ class Adherent extends CommonObject if (dol_textishtml($text,1)) $msgishtml = 1; $infos=''; - if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; + if ($this->civility_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel()."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; @@ -210,7 +210,7 @@ class Adherent extends CommonObject $substitutionarray=array( '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id, - '%CIVILITY%'=>$this->getCivilityLabel($msgishtml?0:1), + '%CIVILITY%'=>$this->getCivilityLabel(), '%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs), @@ -350,7 +350,7 @@ class Adherent extends CommonObject { // Call trigger $result=$this->call_trigger('MEMBER_CREATE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -599,7 +599,7 @@ class Adherent extends CommonObject { // Call trigger $result=$this->call_trigger('MEMBER_MODIFY',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } } @@ -774,7 +774,7 @@ class Adherent extends CommonObject { // Call trigger $result=$this->call_trigger('MEMBER_DELETE',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -830,7 +830,7 @@ class Adherent extends CommonObject } $this->db->begin(); - + // Mise a jour $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET pass = '".$this->db->escape($password_indatabase)."'"; $sql.= " WHERE rowid = ".$this->id; @@ -877,7 +877,7 @@ class Adherent extends CommonObject { // Call trigger $result=$this->call_trigger('MEMBER_NEW_PASSWORD',$user); - if ($result < 0) { $error++; $this->db->rollback(); return -1; } + if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers } @@ -1292,7 +1292,7 @@ class Adherent extends CommonObject // Call trigger $result=$this->call_trigger('MEMBER_SUBSCRIPTION',$user); - if ($result < 0) { $error++; } + if ($result < 0) { $error++; } // End call triggers } @@ -1351,7 +1351,7 @@ class Adherent extends CommonObject // Call trigger $result=$this->call_trigger('MEMBER_VALIDATE',$user); - if ($result < 0) { $error++; $this->db->rollback(); return -1; } + if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers $this->db->commit(); @@ -1399,7 +1399,7 @@ class Adherent extends CommonObject // Call trigger $result=$this->call_trigger('MEMBER_RESILIATE',$user); - if ($result < 0) { $error++; $this->db->rollback(); return -1; } + if ($result < 0) { $error++; $this->db->rollback(); return -1; } // End call triggers $this->db->commit(); @@ -1530,7 +1530,7 @@ class Adherent extends CommonObject /** * Return civility label of a member * - * @return string Translated name of civility + * @return string Translated name of civility (translated with transnoentitiesnoconv) */ function getCivilityLabel() { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 71419dfc1a3..ac66f7fb048 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -139,7 +139,7 @@ class Commande extends CommonOrder { $file = $conf->global->COMMANDE_ADDON.".php"; $classname = $conf->global->COMMANDE_ADDON; - + // Include file with class foreach ($conf->file->dol_document_root as $dirroot) { @@ -262,7 +262,7 @@ class Commande extends CommonOrder // We decrement stock of product (and sub-products) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr",$num)); if ($result < 0) - { + { $error++; $this->error=$mouvP->error; } @@ -305,7 +305,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_VALIDATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -436,7 +436,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_REOPEN',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } else @@ -495,9 +495,9 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_CLOSE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - + if (! $error) { $this->statut=3; @@ -558,7 +558,7 @@ class Commande extends CommonOrder $mouvP = new MouvementStock($this->db); // We increment stock of product (and sub-products) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref)); - if ($result < 0) + if ($result < 0) { $error++; $this->error=$mouvP->error; @@ -572,7 +572,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_CANCEL',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -764,9 +764,10 @@ class Commande extends CommonOrder if ($origin == 'propal' && $origin_id) { // On recupere les differents contact interne et externe - $prop = new Propal($this->db, $this->socid, $origin_id); + $prop = new Propal($this->db); + $prop->fetch($origin_id); - // On recupere le commercial suivi propale + // We get ids of sales representatives of proposal $this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL'); if ($this->userid) @@ -775,7 +776,7 @@ class Commande extends CommonOrder $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); } - // On recupere le contact client suivi propale + // We get ids of customer follower of proposal $this->contactid = $prop->getIdcontact('external', 'CUSTOMER'); if ($this->contactid) @@ -813,7 +814,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -908,7 +909,7 @@ class Commande extends CommonOrder // Call trigger $result=$this->call_trigger('ORDER_CLONE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -2228,7 +2229,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_CLASSIFY_BILLED',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers if (! $error) @@ -2447,7 +2448,7 @@ class Commande extends CommonOrder { // Call trigger $result=$this->call_trigger('ORDER_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -3189,7 +3190,7 @@ class OrderLine extends CommonOrderLine // Call trigger $result=$this->call_trigger('LINEORDER_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers if (!$error) { @@ -3312,7 +3313,7 @@ class OrderLine extends CommonOrderLine { // Call trigger $result=$this->call_trigger('LINEORDER_INSERT',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -3427,7 +3428,7 @@ class OrderLine extends CommonOrderLine { // Call trigger $result=$this->call_trigger('LINEORDER_UPDATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 9bd451b8caa..0042377481e 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -88,7 +88,7 @@ if ($action == 'update' && ! $_POST["cancel"]) if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer) { // Modification - $account = new Account($db, $_GET["id"]); + $account = new Account($db); $account->delete($_GET["id"]); header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 58a26007e85..27acf7eba59 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2012 Laurent Destailleur * Copytight (C) 2005-2009 Regis Houssin - * Copytight (C) 2014 Alexandre Spangaro + * Copytight (C) 2014 Alexandre Spangaro * * 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 @@ -57,7 +57,7 @@ if ($_POST["action"] == 'add') $error=0; // Create account - $account = new Account($db,0); + $account = new Account($db); $account->ref = dol_sanitizeFileName(trim($_POST["ref"])); $account->label = trim($_POST["label"]); @@ -119,7 +119,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"]) $error=0; // Update account - $account = new Account($db, $_POST["id"]); + $account = new Account($db); $account->fetch($_POST["id"]); $account->ref = dol_string_nospecial(trim($_POST["ref"])); @@ -325,9 +325,9 @@ if ($action == 'create') print '
account_min_desired).'">
'; - + print '
'; - + print ''; // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) @@ -340,11 +340,11 @@ if ($action == 'create') print ''; print ''; } - + // Accountancy journal print ''; print ''; - + print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyJournal").'
'; print '

'; @@ -458,19 +458,19 @@ else print '
'.$account->comment.'
'; - + print '
'; print ''; // Accountancy code print ''; print ''; - + // Accountancy journal print ''; print ''; - + print '
'.$langs->trans("AccountancyCode").''.$account->account_number.'
'.$langs->trans("AccountancyJournal").''.$account->accountancy_journal.'
'; - + print ''; @@ -611,7 +611,7 @@ else $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),'',200,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); $doleditor->Create(); print ''; - + // Accountancy code if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { @@ -623,7 +623,7 @@ else print ''.$langs->trans("AccountancyCode").''; print 'account_number).'">'; } - + // Accountancy journal print ''.$langs->trans("AccountancyJournalCode").''; print 'accountancy_journal).'">'; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 0574531e875..974ccaed446 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -113,11 +113,10 @@ class box_graph_propales_permonth extends ModeleBoxes $nowarray=dol_getdate(dol_now(),true); if (empty($endyear)) $endyear=$nowarray['year']; $startyear=$endyear-1; - $mode='customer'; $WIDTH=(($shownb && $showtot) || ! empty($conf->dol_optimize_smallscreen))?'256':'320'; $HEIGHT='192'; - $stats = new PropaleStats($this->db, $socid, $mode, 0); + $stats = new PropaleStats($this->db, $socid, 0); // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($shownb) @@ -126,8 +125,7 @@ class box_graph_propales_permonth extends ModeleBoxes $datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars'); $filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png"; - if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$endyear.'.png'; - if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsnbinyear-'.$endyear.'.png'; + $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsnbinyear-'.$endyear.'.png'; $px1 = new DolGraph(); $mesg = $px1->isGraphKo(); diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index f86681f5c76..3657cca03f5 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -335,11 +335,12 @@ class Translate * Return translated value of key. Search in lang file, then into database. * Key must be any complete entry into lang file: CurrencyEUR, ... * If not found, return key. - * WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must - * not be called with same value than input. + * The string return is not formated (translated with transnoentitiesnoconv) + * NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), if you modify this function, + * check that getLabelFromKey is not called with same value than input. * * @param string $key Key to translate - * @return string Translated string + * @return string Translated string (translated with transnoentitiesnoconv) */ private function getTradFromKey($key) { @@ -347,7 +348,6 @@ class Translate if (! is_string($key)) return 'ErrorBadValueForParamNotAString'; // Avoid multiple errors with code not using function correctly. - //print 'xx'.$key; $newstr=$key; if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg)) { diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index dcecdc26991..ce3af92d30b 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -165,7 +165,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $info=$object->_load_ldap_info(); $dn=$object->_load_ldap_dn($info); - $result=$ldap->delete($dn,$info,$user); + $result=$ldap->delete($dn); if ($result < 0) { $this->error="ErrorLDAP ".$ldap->error; @@ -322,7 +322,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $info=$object->_load_ldap_info(); $dn=$object->_load_ldap_dn($info); - $result=$ldap->delete($dn,$info,$user); + $result=$ldap->delete($dn); if ($result < 0) { $this->error="ErrorLDAP ".$ldap->error; @@ -399,7 +399,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $info=$object->_load_ldap_info(); $dn=$object->_load_ldap_dn($info); - $result=$ldap->delete($dn,$info,$user); + $result=$ldap->delete($dn); if ($result < 0) { $this->error="ErrorLDAP ".$ldap->error; @@ -576,7 +576,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $info=$object->_load_ldap_info(); $dn=$object->_load_ldap_dn($info); - $result=$ldap->delete($dn,$info,$user); + $result=$ldap->delete($dn); if ($result < 0) { $this->error="ErrorLDAP ".$ldap->error; diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php index ad46210ed3b..b2d353046df 100644 --- a/htdocs/fourn/product/categorie.php +++ b/htdocs/fourn/product/categorie.php @@ -52,14 +52,14 @@ if ($_GET["id"]) //on veut supprimer une cat�gorie if ($_REQUEST["cat"]) { - $cat = new Categorie($db,$_REQUEST["cat"]); + $cat = new Categorie($db); $cat->del_product($product); } //on veut ajouter une cat�gorie if (isset($_REQUEST["add_cat"]) && $_REQUEST["add_cat"]>=0) { - $cat = new Categorie($db,$_REQUEST["add_cat"]); + $cat = new Categorie($db); $cat->add_product($product); } diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index ec186cd8339..c8911837a40 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -149,7 +149,7 @@ if ($resql) if (isset($catid)) { print "
"; - $c = new Categorie($db, $catid); + $c = new Categorie($db); $ways = $c->print_all_ways(' > ','fourn/product/liste.php'); print " > ".$ways[0]."
\n"; print "

"; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 797bce3171f..0092a6e25c9 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -1070,7 +1070,7 @@ else // Liste des utiliseurs du groupes choisi dans la config $idGroupValid = $cp->getConfCP('userGroup'); - $validator = new UserGroup($db,$idGroupValid); + $validator = new UserGroup($db); $valideur = $validator->listUsersForGroup('',1); print ''; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 3b062d4ada0..f9fa76541a5 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1412,7 +1412,7 @@ function migrate_price_propal($db,$langs,$conf) dolibarr_install_syslog("upgrade2: Line $rowid: propalid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; - $propalligne->update_total($rowid); + $propalligne->update_total(); /* On touche pas a propal mere @@ -1521,7 +1521,7 @@ function migrate_price_contrat($db,$langs,$conf) dolibarr_install_syslog("upgrade2: Line $rowid: contratdetid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent -> $total_ht, $total_tva, $total_ttc"); print ". "; - $contratligne->update_total($rowid); + $contratligne->update_total(); $i++; } @@ -1606,7 +1606,7 @@ function migrate_price_commande($db,$langs,$conf) dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; - $commandeligne->update_total($rowid); + $commandeligne->update_total(); /* On touche pas a facture mere $commande = new Commande($db); @@ -1720,7 +1720,7 @@ function migrate_price_commande_fournisseur($db,$langs,$conf) dolibarr_install_syslog("upgrade2: Line $rowid: commandeid=$obj->rowid pu=$pu qty=$qty tva_taux=$txtva remise_percent=$remise_percent remise_global=$remise_percent_global -> $total_ht, $total_tva, $total_ttc"); print ". "; - $commandeligne->update_total($rowid); + $commandeligne->update_total(); /* On touche pas a facture mere $commande = new Commande($db); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 314ee3bab9b..83771d2e157 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -411,7 +411,7 @@ if (! defined('NOLOGIN')) // Call of triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,GETPOST('entity','int')); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); if ($result < 0) { $error++; } @@ -514,10 +514,11 @@ if (! defined('NOLOGIN')) $_SESSION["dol_loginmesg"]=$user->error; } + // TODO We should use a hook here, not a trigger. // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,$_POST["entity"]); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); if ($result < 0) { $error++; } @@ -556,10 +557,11 @@ if (! defined('NOLOGIN')) $_SESSION["dol_loginmesg"]=$user->error; } + // TODO We should use a hook here, not a trigger. // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf,(isset($_POST["entity"])?$_POST["entity"]:0)); + $result=$interface->run_triggers('USER_LOGIN_FAILED',$user,$user,$langs,$conf); if ($result < 0) { $error++; } @@ -572,10 +574,11 @@ if (! defined('NOLOGIN')) { if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default (triggers are time consuming) { + // TODO We should use a hook here, not a trigger. // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity); + $result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf); if ($result < 0) { $error++; } @@ -588,7 +591,7 @@ if (! defined('NOLOGIN')) // If we are here, this means authentication was successfull. if (! isset($_SESSION["dol_login"])) { - // New session for this login. + // New session for this login has started. $error=0; // Store value into session (values always stored) @@ -617,10 +620,11 @@ if (! defined('NOLOGIN')) $user->update_last_login_date(); + // TODO We should use a hook here, not a trigger // Call triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); - $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf,GETPOST('entity','int')); + $result=$interface->run_triggers('USER_LOGIN',$user,$user,$langs,$conf); if ($result < 0) { $error++; } diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index ec1daf2634b..c0f7e41b97e 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -80,7 +80,7 @@ print ''; $client = false; if ($socid > 0) { - $soc = new Societe($db, $socid); + $soc = new Societe($db); $soc->fetch($socid); if ($soc->client) diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 06e2f4a81b3..cc7a5fb1c75 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -62,7 +62,7 @@ llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_ur if ($socid > 0) { - $societe = new Societe($db, $socid); + $societe = new Societe($db); $societe->fetch($socid); /* diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index ab31ae0aa6c..81434828592 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -42,7 +42,7 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); -$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf,$conf->entity); +$result=$interface->run_triggers('USER_LOGOUT',$user,$user,$langs,$conf); if ($result < 0) { $error++; } // Fin appel triggers From 0b5707c1cf7f057fa6c2d5bce21cafd0d7bba5be Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Fri, 1 Aug 2014 14:49:42 +0200 Subject: [PATCH 370/502] Add Reduction value in pdf Add value of %reduction in pdf --- htdocs/compta/facture/class/facture.class.php | 6630 +++++++++-------- htdocs/core/lib/pdf.lib.php | 32 + .../modules/facture/doc/pdf_crabe.modules.php | 2443 +++--- 3 files changed, 4580 insertions(+), 4525 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7e5af441280..b4c47a43c14 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -11,7 +11,8 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Cedric Gross - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * * 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 @@ -44,78 +45,78 @@ require_once DOL_DOCUMENT_ROOT .'/margin/lib/margins.lib.php'; */ class Facture extends CommonInvoice { - public $element='facture'; - public $table_element='facture'; - public $table_element_line = 'facturedet'; - public $fk_element = 'fk_facture'; - protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='facture'; + public $table_element='facture'; + public $table_element_line = 'facturedet'; + public $fk_element = 'fk_facture'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; - //! Id client - var $socid; - //! Objet societe client (to load with fetch_client method) - var $client; - var $author; - var $fk_user_author; - var $fk_user_valid; - //! Invoice date - var $date; // Invoice date - var $date_creation; // Creation date - var $date_validation; // Validation date - var $datem; - var $ref; - var $ref_client; - var $ref_ext; - var $ref_int; - //Check constants for types - var $type = self::TYPE_STANDARD; + var $id; + //! Id client + var $socid; + //! Objet societe client (to load with fetch_client method) + var $client; + var $author; + var $fk_user_author; + var $fk_user_valid; + //! Invoice date + var $date; // Invoice date + var $date_creation; // Creation date + var $date_validation; // Validation date + var $datem; + var $ref; + var $ref_client; + var $ref_ext; + var $ref_int; + //Check constants for types + var $type = self::TYPE_STANDARD; - //var $amount; - var $remise_absolue; - var $remise_percent; - var $total_ht=0; - var $total_tva=0; - var $total_ttc=0; - var $revenuestamp; - var $note; // deprecated - var $note_private; - var $note_public; - //! 0=draft, - //! 1=validated (need to be paid), - //! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null), - //! 3=classified abandoned and no payment done (close_code='badcustomer','abandon' or 'replaced') - var $statut; - //! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon - //! Fermeture alors que aucun paiement: replaced (si remplace), abandon - var $close_code; - //! Commentaire si mis a paye sans paiement complet - var $close_note; - //! 1 if invoice paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) - var $paye; - //! id of source invoice if replacement invoice or credit note - var $fk_facture_source; - var $origin; - var $origin_id; - var $linked_objects=array(); - var $fk_project; - var $date_lim_reglement; - var $cond_reglement_id; // Id in llx_c_paiement - var $cond_reglement_code; // Code in llx_c_paiement - var $mode_reglement_id; // Id in llx_c_paiement - var $mode_reglement_code; // Code in llx_c_paiement + //var $amount; + var $remise_absolue; + var $remise_percent; + var $total_ht=0; + var $total_tva=0; + var $total_ttc=0; + var $revenuestamp; + var $note; // deprecated + var $note_private; + var $note_public; + //! 0=draft, + //! 1=validated (need to be paid), + //! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null), + //! 3=classified abandoned and no payment done (close_code='badcustomer','abandon' or 'replaced') + var $statut; + //! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon + //! Fermeture alors que aucun paiement: replaced (si remplace), abandon + var $close_code; + //! Commentaire si mis a paye sans paiement complet + var $close_note; + //! 1 if invoice paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) + var $paye; + //! id of source invoice if replacement invoice or credit note + var $fk_facture_source; + var $origin; + var $origin_id; + var $linked_objects=array(); + var $fk_project; + var $date_lim_reglement; + var $cond_reglement_id; // Id in llx_c_paiement + var $cond_reglement_code; // Code in llx_c_paiement + var $mode_reglement_id; // Id in llx_c_paiement + var $mode_reglement_code; // Code in llx_c_paiement var $fk_account; // Id of bank account - var $fk_bank; // Field to store bank id to use when payment mode is withdraw - var $modelpdf; - var $products=array(); // deprecated - var $lines=array(); - var $line; - var $extraparams=array(); - //! Pour board - var $nbtodo; - var $nbtodolate; - var $specimen; + var $fk_bank; // Field to store bank id to use when payment mode is withdraw + var $modelpdf; + var $products=array(); // deprecated + var $lines=array(); + var $line; + var $extraparams=array(); + //! Pour board + var $nbtodo; + var $nbtodolate; + var $specimen; - var $fac_rec; + var $fac_rec; /** * Standard invoice @@ -142,2677 +143,2680 @@ class Facture extends CommonInvoice */ const TYPE_PROFORMA = 4; - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + } - /** - * Create invoice in database - * Note: this->ref can be set or empty. If empty, we will use "(PROV)" - * - * @param User $user Object user that create - * @param int $notrigger 1=Does not execute triggers, 0 otherwise - * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value - * @return int <0 if KO, >0 if OK - */ - function create($user,$notrigger=0,$forceduedate=0) - { - global $langs,$conf,$mysoc,$hookmanager; - $error=0; + /** + * Create invoice in database + * Note: this->ref can be set or empty. If empty, we will use "(PROV)" + * + * @param User $user Object user that create + * @param int $notrigger 1=Does not execute triggers, 0 otherwise + * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value + * @return int <0 if KO, >0 if OK + */ + function create($user,$notrigger=0,$forceduedate=0) + { + global $langs,$conf,$mysoc,$hookmanager; + $error=0; - // Clean parameters - if (empty($this->type)) $this->type = self::TYPE_STANDARD; - $this->ref_client=trim($this->ref_client); - $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated - $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); - $this->note_public=trim($this->note_public); - if (! $this->cond_reglement_id) $this->cond_reglement_id = 0; - if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; - $this->brouillon = 1; + // Clean parameters + if (empty($this->type)) $this->type = self::TYPE_STANDARD; + $this->ref_client=trim($this->ref_client); + $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated + $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); + $this->note_public=trim($this->note_public); + if (! $this->cond_reglement_id) $this->cond_reglement_id = 0; + if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; + $this->brouillon = 1; - dol_syslog(get_class($this)."::create user=".$user->id); + dol_syslog(get_class($this)."::create user=".$user->id); - // Check parameters - if (empty($this->date) || empty($user->id)) - { - $this->error="ErrorBadParameter"; - dol_syslog(get_class($this)."::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR); - return -3; - } - $soc = new Societe($this->db); - $result=$soc->fetch($this->socid); - if ($result < 0) - { - $this->error="Failed to fetch company"; - dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); - return -2; - } + // Check parameters + if (empty($this->date) || empty($user->id)) + { + $this->error="ErrorBadParameter"; + dol_syslog(get_class($this)."::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR); + return -3; + } + $soc = new Societe($this->db); + $result=$soc->fetch($this->socid); + if ($result < 0) + { + $this->error="Failed to fetch company"; + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); + return -2; + } - $now=dol_now(); + $now=dol_now(); - $this->db->begin(); + $this->db->begin(); - // Create invoice from a predefined invoice - if ($this->fac_rec > 0) - { - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; - $_facrec = new FactureRec($this->db); - $result=$_facrec->fetch($this->fac_rec); + // Create invoice from a predefined invoice + if ($this->fac_rec > 0) + { + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; + $_facrec = new FactureRec($this->db); + $result=$_facrec->fetch($this->fac_rec); - $this->fk_project = $_facrec->fk_project; - $this->cond_reglement_id = $_facrec->cond_reglement_id; - $this->mode_reglement_id = $_facrec->mode_reglement_id; - $this->remise_absolue = $_facrec->remise_absolue; - $this->remise_percent = $_facrec->remise_percent; + $this->fk_project = $_facrec->fk_project; + $this->cond_reglement_id = $_facrec->cond_reglement_id; + $this->mode_reglement_id = $_facrec->mode_reglement_id; + $this->remise_absolue = $_facrec->remise_absolue; + $this->remise_percent = $_facrec->remise_percent; - // Clean parametres - if (! $this->type) $this->type = self::TYPE_STANDARD; - $this->ref_client=trim($this->ref_client); - $this->note_private=trim($this->note_private); - $this->note_public=trim($this->note_public); - //if (! $this->remise) $this->remise = 0; - if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; - $this->brouillon = 1; - } + // Clean parametres + if (! $this->type) $this->type = self::TYPE_STANDARD; + $this->ref_client=trim($this->ref_client); + $this->note_private=trim($this->note_private); + $this->note_public=trim($this->note_public); + //if (! $this->remise) $this->remise = 0; + if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; + $this->brouillon = 1; + } - // Define due date if not already defined - $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); + // Define due date if not already defined + $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); - // Insert into database - $socid = $this->socid; + // Insert into database + $socid = $this->socid; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; - $sql.= " facnumber"; - $sql.= ", entity"; - $sql.= ", ref_ext"; - $sql.= ", type"; - $sql.= ", fk_soc"; - $sql.= ", datec"; - $sql.= ", remise_absolue"; - $sql.= ", remise_percent"; - $sql.= ", datef"; - $sql.= ", note_private"; - $sql.= ", note_public"; - $sql.= ", ref_client, ref_int"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; + $sql.= " facnumber"; + $sql.= ", entity"; + $sql.= ", ref_ext"; + $sql.= ", type"; + $sql.= ", fk_soc"; + $sql.= ", datec"; + $sql.= ", remise_absolue"; + $sql.= ", remise_percent"; + $sql.= ", datef"; + $sql.= ", note_private"; + $sql.= ", note_public"; + $sql.= ", ref_client, ref_int"; $sql.= ", fk_account"; - $sql.= ", fk_facture_source, fk_user_author, fk_projet"; - $sql.= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf"; - $sql.= ")"; - $sql.= " VALUES ("; - $sql.= "'(PROV)'"; - $sql.= ", ".$conf->entity; - $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); - $sql.= ", '".$this->type."'"; - $sql.= ", '".$socid."'"; - $sql.= ", '".$this->db->idate($now)."'"; - $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); - $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); - $sql.= ", '".$this->db->idate($this->date)."'"; - $sql.= ",".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); - $sql.= ",".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); - $sql.= ",".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); - $sql.= ",".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); - $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); - $sql.= ",".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null"); - $sql.= ",".($user->id > 0 ? "'".$user->id."'":"null"); - $sql.= ",".($this->fk_project?$this->fk_project:"null"); - $sql.= ','.$this->cond_reglement_id; - $sql.= ",".$this->mode_reglement_id; - $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')"; + $sql.= ", fk_facture_source, fk_user_author, fk_projet"; + $sql.= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf"; + $sql.= ")"; + $sql.= " VALUES ("; + $sql.= "'(PROV)'"; + $sql.= ", ".$conf->entity; + $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); + $sql.= ", '".$this->type."'"; + $sql.= ", '".$socid."'"; + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); + $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); + $sql.= ", '".$this->db->idate($this->date)."'"; + $sql.= ",".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); + $sql.= ",".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); + $sql.= ",".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); + $sql.= ",".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); + $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); + $sql.= ",".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null"); + $sql.= ",".($user->id > 0 ? "'".$user->id."'":"null"); + $sql.= ",".($this->fk_project?$this->fk_project:"null"); + $sql.= ','.$this->cond_reglement_id; + $sql.= ",".$this->mode_reglement_id; + $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture'); + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture'); - // Update ref with new one - $this->ref='(PROV'.$this->id.')'; - $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id; + // Update ref with new one + $this->ref='(PROV'.$this->id.')'; + $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql=$this->db->query($sql); - if (! $resql) $error++; + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) $error++; - // Add object linked - if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) - { - foreach($this->linked_objects as $origin => $origin_id) - { - $ret = $this->add_object_linked($origin, $origin_id); - if (! $ret) - { - dol_print_error($this->db); - $error++; - } + // Add object linked + if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) + { + foreach($this->linked_objects as $origin => $origin_id) + { + $ret = $this->add_object_linked($origin, $origin_id); + if (! $ret) + { + dol_print_error($this->db); + $error++; + } - // TODO mutualiser - if ($origin == 'commande') - { - // On recupere les differents contact interne et externe - $order = new Commande($this->db); - $order->id = $origin_id; + // TODO mutualiser + if ($origin == 'commande') + { + // On recupere les differents contact interne et externe + $order = new Commande($this->db); + $order->id = $origin_id; - // On recupere le commercial suivi propale - $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL'); + // On recupere le commercial suivi propale + $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL'); - if ($this->userid) - { - //On passe le commercial suivi commande en commercial suivi paiement - $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); - } + if ($this->userid) + { + //On passe le commercial suivi commande en commercial suivi paiement + $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); + } - // On recupere le contact client facturation commande - $this->contactid = $order->getIdcontact('external', 'BILLING'); + // On recupere le contact client facturation commande + $this->contactid = $order->getIdcontact('external', 'BILLING'); - if ($this->contactid) - { - //On passe le contact client facturation commande en contact client facturation - $this->add_contact($this->contactid[0], 'BILLING', 'external'); - } - } - } - } + if ($this->contactid) + { + //On passe le contact client facturation commande en contact client facturation + $this->add_contact($this->contactid[0], 'BILLING', 'external'); + } + } + } + } - /* + /* * Insert lines of invoices into database */ - if (count($this->lines) && is_object($this->lines[0])) // If this->lines is array on InvoiceLines (preferred mode) - { - $fk_parent_line = 0; + if (count($this->lines) && is_object($this->lines[0])) // If this->lines is array on InvoiceLines (preferred mode) + { + $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects"); - foreach ($this->lines as $i => $val) - { - $newinvoiceline=$this->lines[$i]; - $newinvoiceline->fk_facture=$this->id; - if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 - { - // Reset fk_parent_line for no child products and special product - if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) { - $fk_parent_line = 0; - } + dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects"); + foreach ($this->lines as $i => $val) + { + $newinvoiceline=$this->lines[$i]; + $newinvoiceline->fk_facture=$this->id; + if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 + { + // Reset fk_parent_line for no child products and special product + if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) { + $fk_parent_line = 0; + } - $newinvoiceline->fk_parent_line=$fk_parent_line; - $result=$newinvoiceline->insert(); + $newinvoiceline->fk_parent_line=$fk_parent_line; + $result=$newinvoiceline->insert(); - // Defined the new fk_parent_line - if ($result > 0 && $newinvoiceline->product_type == 9) { - $fk_parent_line = $result; - } - } - if ($result < 0) - { - $this->error=$newinvoiceline->error; - $error++; - break; - } - } - } - else // If this->lines is not object of invoice lines - { - $fk_parent_line = 0; + // Defined the new fk_parent_line + if ($result > 0 && $newinvoiceline->product_type == 9) { + $fk_parent_line = $result; + } + } + if ($result < 0) + { + $this->error=$newinvoiceline->error; + $error++; + break; + } + } + } + else // If this->lines is not object of invoice lines + { + $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are array lines"); - foreach ($this->lines as $i => $val) - { - if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 - { - // Reset fk_parent_line for no child products and special product - if (($this->lines[$i]->product_type != 9 && empty($this->lines[$i]->fk_parent_line)) || $this->lines[$i]->product_type == 9) { - $fk_parent_line = 0; - } + dol_syslog("There is ".count($this->lines)." lines that are array lines"); + foreach ($this->lines as $i => $val) + { + if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 + { + // Reset fk_parent_line for no child products and special product + if (($this->lines[$i]->product_type != 9 && empty($this->lines[$i]->fk_parent_line)) || $this->lines[$i]->product_type == 9) { + $fk_parent_line = 0; + } - $result = $this->addline( - $this->lines[$i]->desc, - $this->lines[$i]->subprice, - $this->lines[$i]->qty, - $this->lines[$i]->tva_tx, - $this->lines[$i]->localtax1_tx, - $this->lines[$i]->localtax2_tx, - $this->lines[$i]->fk_product, - $this->lines[$i]->remise_percent, - $this->lines[$i]->date_start, - $this->lines[$i]->date_end, - $this->lines[$i]->fk_code_ventilation, - $this->lines[$i]->info_bits, - $this->lines[$i]->fk_remise_except, - 'HT', - 0, - $this->lines[$i]->product_type, - $this->lines[$i]->rang, - $this->lines[$i]->special_code, - '', - 0, - $fk_parent_line, - $this->lines[$i]->fk_fournprice, - $this->lines[$i]->pa_ht, - $this->lines[$i]->label, - '' - ); - if ($result < 0) - { - $this->error=$this->db->lasterror(); - dol_print_error($this->db); - $this->db->rollback(); - return -1; - } + $result = $this->addline( + $this->lines[$i]->desc, + $this->lines[$i]->subprice, + $this->lines[$i]->qty, + $this->lines[$i]->tva_tx, + $this->lines[$i]->localtax1_tx, + $this->lines[$i]->localtax2_tx, + $this->lines[$i]->fk_product, + $this->lines[$i]->remise_percent, + $this->lines[$i]->date_start, + $this->lines[$i]->date_end, + $this->lines[$i]->fk_code_ventilation, + $this->lines[$i]->info_bits, + $this->lines[$i]->fk_remise_except, + 'HT', + 0, + $this->lines[$i]->product_type, + $this->lines[$i]->rang, + $this->lines[$i]->special_code, + '', + 0, + $fk_parent_line, + $this->lines[$i]->fk_fournprice, + $this->lines[$i]->pa_ht, + $this->lines[$i]->label, + '' + ); + if ($result < 0) + { + $this->error=$this->db->lasterror(); + dol_print_error($this->db); + $this->db->rollback(); + return -1; + } - // Defined the new fk_parent_line - if ($result > 0 && $this->lines[$i]->product_type == 9) { - $fk_parent_line = $result; - } - } - } - } + // Defined the new fk_parent_line + if ($result > 0 && $this->lines[$i]->product_type == 9) { + $fk_parent_line = $result; + } + } + } + } - /* + /* * Insert lines of predefined invoices */ - if (! $error && $this->fac_rec > 0) - { - foreach ($_facrec->lines as $i => $val) - { - if ($_facrec->lines[$i]->fk_product) - { - $prod = new Product($this->db); - $res=$prod->fetch($_facrec->lines[$i]->fk_product); - } - $tva_tx = get_default_tva($mysoc,$soc,$prod->id); - $localtax1_tx=get_localtax($tva_tx,1,$soc); - $localtax2_tx=get_localtax($tva_tx,2,$soc); + if (! $error && $this->fac_rec > 0) + { + foreach ($_facrec->lines as $i => $val) + { + if ($_facrec->lines[$i]->fk_product) + { + $prod = new Product($this->db); + $res=$prod->fetch($_facrec->lines[$i]->fk_product); + } + $tva_tx = get_default_tva($mysoc,$soc,$prod->id); + $localtax1_tx=get_localtax($tva_tx,1,$soc); + $localtax2_tx=get_localtax($tva_tx,2,$soc); - $result_insert = $this->addline( - $_facrec->lines[$i]->desc, - $_facrec->lines[$i]->subprice, - $_facrec->lines[$i]->qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $_facrec->lines[$i]->fk_product, - $_facrec->lines[$i]->remise_percent, - '','',0,0,'','HT',0, - $_facrec->lines[$i]->product_type, - $_facrec->lines[$i]->rang, - $_facrec->lines[$i]->special_code, - '', - 0, - 0, - null, - 0, - $_facrec->lines[$i]->label - ); + $result_insert = $this->addline( + $_facrec->lines[$i]->desc, + $_facrec->lines[$i]->subprice, + $_facrec->lines[$i]->qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $_facrec->lines[$i]->fk_product, + $_facrec->lines[$i]->remise_percent, + '','',0,0,'','HT',0, + $_facrec->lines[$i]->product_type, + $_facrec->lines[$i]->rang, + $_facrec->lines[$i]->special_code, + '', + 0, + 0, + null, + 0, + $_facrec->lines[$i]->label + ); - if ( $result_insert < 0) - { - $error++; - $this->error=$this->db->error(); - break; - } - } - } + if ( $result_insert < 0) + { + $error++; + $this->error=$this->db->error(); + break; + } + } + } - if (! $error) - { + if (! $error) + { - $result=$this->update_price(1); - if ($result > 0) - { - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('invoicedao')); - $parameters=array('invoiceid'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; + $result=$this->update_price(1); + if ($result > 0) + { + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('invoicedao')); + $parameters=array('invoiceid'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; // Call trigger $result=$this->call_trigger('BILL_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - if (! $error) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -4; - } - } - else - { - $this->error=$langs->trans('FailedToUpdatePrice'); - $this->db->rollback(); - return -3; - } - } - else - { - dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -2; - } - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -4; + } + } + else + { + $this->error=$langs->trans('FailedToUpdatePrice'); + $this->db->rollback(); + return -3; + } + } + else + { + dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -2; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } - /** - * Create a new invoice in database from current invoice - * - * @param User $user Object user that ask creation - * @param int $invertdetail Reverse sign of amounts for lines - * @return int <0 if KO, >0 if OK - */ - function createFromCurrent($user,$invertdetail=0) - { - // Charge facture source - $facture=new Facture($this->db); + /** + * Create a new invoice in database from current invoice + * + * @param User $user Object user that ask creation + * @param int $invertdetail Reverse sign of amounts for lines + * @return int <0 if KO, >0 if OK + */ + function createFromCurrent($user,$invertdetail=0) + { + // Charge facture source + $facture=new Facture($this->db); - $facture->fk_facture_source = $this->fk_facture_source; - $facture->type = $this->type; - $facture->socid = $this->socid; - $facture->date = $this->date; - $facture->note_public = $this->note_public; - $facture->note_private = $this->note_private; - $facture->ref_client = $this->ref_client; - $facture->modelpdf = $this->modelpdf; - $facture->fk_project = $this->fk_project; - $facture->cond_reglement_id = $this->cond_reglement_id; - $facture->mode_reglement_id = $this->mode_reglement_id; - $facture->remise_absolue = $this->remise_absolue; - $facture->remise_percent = $this->remise_percent; + $facture->fk_facture_source = $this->fk_facture_source; + $facture->type = $this->type; + $facture->socid = $this->socid; + $facture->date = $this->date; + $facture->note_public = $this->note_public; + $facture->note_private = $this->note_private; + $facture->ref_client = $this->ref_client; + $facture->modelpdf = $this->modelpdf; + $facture->fk_project = $this->fk_project; + $facture->cond_reglement_id = $this->cond_reglement_id; + $facture->mode_reglement_id = $this->mode_reglement_id; + $facture->remise_absolue = $this->remise_absolue; + $facture->remise_percent = $this->remise_percent; - $facture->lines = $this->lines; // Tableau des lignes de factures - $facture->products = $this->lines; // Tant que products encore utilise + $facture->lines = $this->lines; // Tableau des lignes de factures + $facture->products = $this->lines; // Tant que products encore utilise - // Loop on each line of new invoice - foreach($facture->lines as $i => $line) - { - if ($invertdetail) - { - $facture->lines[$i]->subprice = -$facture->lines[$i]->subprice; - $facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht; - $facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva; - $facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1; - $facture->lines[$i]->total_localtax2 = -$facture->lines[$i]->total_localtax2; - $facture->lines[$i]->total_ttc = -$facture->lines[$i]->total_ttc; - } - } + // Loop on each line of new invoice + foreach($facture->lines as $i => $line) + { + if ($invertdetail) + { + $facture->lines[$i]->subprice = -$facture->lines[$i]->subprice; + $facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht; + $facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva; + $facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1; + $facture->lines[$i]->total_localtax2 = -$facture->lines[$i]->total_localtax2; + $facture->lines[$i]->total_ttc = -$facture->lines[$i]->total_ttc; + } + } - dol_syslog(get_class($this)."::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".count($facture->lines)); + dol_syslog(get_class($this)."::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".count($facture->lines)); - $facid = $facture->create($user); - if ($facid <= 0) - { - $this->error=$facture->error; - $this->errors=$facture->errors; - } + $facid = $facture->create($user); + if ($facid <= 0) + { + $this->error=$facture->error; + $this->errors=$facture->errors; + } - return $facid; - } + return $facid; + } - /** - * Load an object from its id and create a new one in database - * - * @param int $socid Id of thirdparty - * @return int New id of clone - */ - function createFromClone($socid=0) - { - global $conf,$user,$langs,$hookmanager; + /** + * Load an object from its id and create a new one in database + * + * @param int $socid Id of thirdparty + * @return int New id of clone + */ + function createFromClone($socid=0) + { + global $conf,$user,$langs,$hookmanager; - $error=0; + $error=0; - $this->db->begin(); + $this->db->begin(); - // Load source object - $objFrom = dol_clone($this); + // Load source object + $objFrom = dol_clone($this); - // Change socid if needed - if (! empty($socid) && $socid != $this->socid) - { - $objsoc = new Societe($this->db); + // Change socid if needed + if (! empty($socid) && $socid != $this->socid) + { + $objsoc = new Societe($this->db); - if ($objsoc->fetch($socid)>0) - { - $this->socid = $objsoc->id; - $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - $this->fk_project = ''; - $this->fk_delivery_address = ''; - } + if ($objsoc->fetch($socid)>0) + { + $this->socid = $objsoc->id; + $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + $this->fk_project = ''; + $this->fk_delivery_address = ''; + } - // TODO Change product price if multi-prices - } + // TODO Change product price if multi-prices + } - $this->id=0; - $this->statut=0; + $this->id=0; + $this->statut=0; - // Clear fields - $this->date = dol_now(); // Date of invoice is set to current date when cloning. // TODO Best is to ask date into confirm box - $this->user_author = $user->id; - $this->user_valid = ''; - $this->fk_facture_source = 0; - $this->date_creation = ''; - $this->date_validation = ''; - $this->ref_client = ''; - $this->close_code = ''; - $this->close_note = ''; - $this->products = $this->lines; // Tant que products encore utilise + // Clear fields + $this->date = dol_now(); // Date of invoice is set to current date when cloning. // TODO Best is to ask date into confirm box + $this->user_author = $user->id; + $this->user_valid = ''; + $this->fk_facture_source = 0; + $this->date_creation = ''; + $this->date_validation = ''; + $this->ref_client = ''; + $this->close_code = ''; + $this->close_note = ''; + $this->products = $this->lines; // Tant que products encore utilise - // Loop on each line of new invoice - foreach($this->lines as $i => $line) - { - if (($this->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts - { - unset($this->lines[$i]); - unset($this->products[$i]); // Tant que products encore utilise - } - } + // Loop on each line of new invoice + foreach($this->lines as $i => $line) + { + if (($this->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts + { + unset($this->lines[$i]); + unset($this->products[$i]); // Tant que products encore utilise + } + } - // Create clone - $result=$this->create($user); - if ($result < 0) $error++; + // Create clone + $result=$this->create($user); + if ($result < 0) $error++; - if (! $error) - { - // Hook of thirdparty module - if (is_object($hookmanager)) - { - $parameters=array('objFrom'=>$objFrom); - $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; - } + if (! $error) + { + // Hook of thirdparty module + if (is_object($hookmanager)) + { + $parameters=array('objFrom'=>$objFrom); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + } // Call trigger $result=$this->call_trigger('BILL_CLONE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } + } - // End - if (! $error) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -1; - } - } + // End + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -1; + } + } - /** - * Load an object from an order and create a new invoice into database - * - * @param Object $object Object source - * @return int <0 if KO, 0 if nothing done, 1 if OK - */ - function createFromOrder($object) - { - global $conf,$user,$langs,$hookmanager; + /** + * Load an object from an order and create a new invoice into database + * + * @param Object $object Object source + * @return int <0 if KO, 0 if nothing done, 1 if OK + */ + function createFromOrder($object) + { + global $conf,$user,$langs,$hookmanager; - $error=0; + $error=0; - // Closed order - $this->date = dol_now(); - $this->source = 0; + // Closed order + $this->date = dol_now(); + $this->source = 0; - $num=count($object->lines); - for ($i = 0; $i < $num; $i++) - { - $line = new FactureLigne($this->db); + $num=count($object->lines); + for ($i = 0; $i < $num; $i++) + { + $line = new FactureLigne($this->db); - $line->libelle = $object->lines[$i]->libelle; - $line->label = $object->lines[$i]->label; - $line->desc = $object->lines[$i]->desc; - $line->subprice = $object->lines[$i]->subprice; - $line->total_ht = $object->lines[$i]->total_ht; - $line->total_tva = $object->lines[$i]->total_tva; - $line->total_ttc = $object->lines[$i]->total_ttc; - $line->tva_tx = $object->lines[$i]->tva_tx; - $line->localtax1_tx = $object->lines[$i]->localtax1_tx; - $line->localtax2_tx = $object->lines[$i]->localtax2_tx; - $line->qty = $object->lines[$i]->qty; - $line->fk_remise_except = $object->lines[$i]->fk_remise_except; - $line->remise_percent = $object->lines[$i]->remise_percent; - $line->fk_product = $object->lines[$i]->fk_product; - $line->info_bits = $object->lines[$i]->info_bits; - $line->product_type = $object->lines[$i]->product_type; - $line->rang = $object->lines[$i]->rang; - $line->special_code = $object->lines[$i]->special_code; - $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->libelle = $object->lines[$i]->libelle; + $line->label = $object->lines[$i]->label; + $line->desc = $object->lines[$i]->desc; + $line->subprice = $object->lines[$i]->subprice; + $line->total_ht = $object->lines[$i]->total_ht; + $line->total_tva = $object->lines[$i]->total_tva; + $line->total_ttc = $object->lines[$i]->total_ttc; + $line->tva_tx = $object->lines[$i]->tva_tx; + $line->localtax1_tx = $object->lines[$i]->localtax1_tx; + $line->localtax2_tx = $object->lines[$i]->localtax2_tx; + $line->qty = $object->lines[$i]->qty; + $line->fk_remise_except = $object->lines[$i]->fk_remise_except; + $line->remise_percent = $object->lines[$i]->remise_percent; + $line->fk_product = $object->lines[$i]->fk_product; + $line->info_bits = $object->lines[$i]->info_bits; + $line->product_type = $object->lines[$i]->product_type; + $line->rang = $object->lines[$i]->rang; + $line->special_code = $object->lines[$i]->special_code; + $line->fk_parent_line = $object->lines[$i]->fk_parent_line; - $line->fk_fournprice = $object->lines[$i]->fk_fournprice; - $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); - $line->pa_ht = $marginInfos[0]; + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; - $this->lines[$i] = $line; - } + $this->lines[$i] = $line; + } - $this->socid = $object->socid; - $this->fk_project = $object->fk_project; - $this->cond_reglement_id = $object->cond_reglement_id; - $this->mode_reglement_id = $object->mode_reglement_id; - $this->availability_id = $object->availability_id; - $this->demand_reason_id = $object->demand_reason_id; - $this->date_livraison = $object->date_livraison; - $this->fk_delivery_address = $object->fk_delivery_address; - $this->contact_id = $object->contactid; - $this->ref_client = $object->ref_client; - $this->note_private = $object->note_private; - $this->note_public = $object->note_public; + $this->socid = $object->socid; + $this->fk_project = $object->fk_project; + $this->cond_reglement_id = $object->cond_reglement_id; + $this->mode_reglement_id = $object->mode_reglement_id; + $this->availability_id = $object->availability_id; + $this->demand_reason_id = $object->demand_reason_id; + $this->date_livraison = $object->date_livraison; + $this->fk_delivery_address = $object->fk_delivery_address; + $this->contact_id = $object->contactid; + $this->ref_client = $object->ref_client; + $this->note_private = $object->note_private; + $this->note_public = $object->note_public; - $this->origin = $object->element; - $this->origin_id = $object->id; + $this->origin = $object->element; + $this->origin_id = $object->id; - // Possibility to add external linked objects with hooks - $this->linked_objects[$this->origin] = $this->origin_id; - if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) - { - $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); - } + // Possibility to add external linked objects with hooks + $this->linked_objects[$this->origin] = $this->origin_id; + if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) + { + $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); + } - $ret = $this->create($user); + $ret = $this->create($user); - if ($ret > 0) - { - // Actions hooked (by external module) - $hookmanager->initHooks(array('invoicedao')); + if ($ret > 0) + { + // Actions hooked (by external module) + $hookmanager->initHooks(array('invoicedao')); - $parameters=array('objFrom'=>$object); - $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; + $parameters=array('objFrom'=>$object); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - if (! $error) - { - return 1; - } - else return -1; - } - else return -1; - } + if (! $error) + { + return 1; + } + else return -1; + } + else return -1; + } - /** - * Return clicable link of object (with eventually picto) - * - * @param int $withpicto Add picto into link - * @param string $option Where point the link - * @param int $max Maxlength of ref - * @param int $short 1=Return just URL - * @param string $moretitle Add more text to title tooltip - * @return string String with URL - */ - function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='') - { - global $langs; + /** + * Return clicable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link + * @param int $max Maxlength of ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @return string String with URL + */ + function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='') + { + global $langs; - $result=''; + $result=''; - if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id; - else $url = DOL_URL_ROOT.'/compta/facture.php?facid='.$this->id; + if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id; + else $url = DOL_URL_ROOT.'/compta/facture.php?facid='.$this->id; - if ($short) return $url; + if ($short) return $url; - $picto='bill'; - if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice - if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note - if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice + $picto='bill'; + if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice + if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note + if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice - $label=$langs->trans("ShowInvoice").': '.$this->ref; - if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; - if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; - if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; - if ($moretitle) $label.=' - '.$moretitle; + $label=$langs->trans("ShowInvoice").': '.$this->ref; + if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; + if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; + if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; + if ($moretitle) $label.=' - '.$moretitle; - $linkstart=''; - $linkend=''; + $linkstart=''; + $linkend=''; - if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label),$picto).$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$linkstart.($max?dol_trunc($this->ref,$max):$this->ref).$linkend; - return $result; - } + if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label),$picto).$linkend); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$linkstart.($max?dol_trunc($this->ref,$max):$this->ref).$linkend; + return $result; + } - /** - * Get object and lines from database - * - * @param int $rowid Id of object to load - * @param string $ref Reference of invoice - * @param string $ref_ext External reference of invoice - * @param int $ref_int Internal reference of other object - * @return int >0 if OK, <0 if KO, 0 if not found - */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='') - { - global $conf; + /** + * Get object and lines from database + * + * @param int $rowid Id of object to load + * @param string $ref Reference of invoice + * @param string $ref_ext External reference of invoice + * @param int $ref_int Internal reference of other object + * @return int >0 if OK, <0 if KO, 0 if not found + */ + function fetch($rowid, $ref='', $ref_ext='', $ref_int='') + { + global $conf; - if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; + if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp'; - $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; - $sql.= ', f.datef as df'; - $sql.= ', f.date_lim_reglement as dlr'; - $sql.= ', f.datec as datec'; - $sql.= ', f.date_valid as datev'; - $sql.= ', f.tms as datem'; - $sql.= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf'; - $sql.= ', f.fk_facture_source'; - $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams'; - $sql.= ', f.fk_account'; - $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; - $sql.= ' WHERE f.entity = '.$conf->entity; - if ($rowid) $sql.= " AND f.rowid=".$rowid; - if ($ref) $sql.= " AND f.facnumber='".$this->db->escape($ref)."'"; - if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; - if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; + $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp'; + $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; + $sql.= ', f.datef as df'; + $sql.= ', f.date_lim_reglement as dlr'; + $sql.= ', f.datec as datec'; + $sql.= ', f.date_valid as datev'; + $sql.= ', f.tms as datem'; + $sql.= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf'; + $sql.= ', f.fk_facture_source'; + $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams'; + $sql.= ', f.fk_account'; + $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; + $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; + $sql.= ' WHERE f.entity = '.$conf->entity; + if ($rowid) $sql.= " AND f.rowid=".$rowid; + if ($ref) $sql.= " AND f.facnumber='".$this->db->escape($ref)."'"; + if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; + if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - $this->ref = $obj->facnumber; - $this->ref_client = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; - $this->type = $obj->type; - $this->date = $this->db->jdate($obj->df); - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_validation = $this->db->jdate($obj->datev); - $this->datem = $this->db->jdate($obj->datem); - $this->remise_percent = $obj->remise_percent; - $this->remise_absolue = $obj->remise_absolue; - $this->total_ht = $obj->total; - $this->total_tva = $obj->tva; - $this->total_localtax1 = $obj->localtax1; - $this->total_localtax2 = $obj->localtax2; - $this->total_ttc = $obj->total_ttc; - $this->revenuestamp = $obj->revenuestamp; - $this->paye = $obj->paye; - $this->close_code = $obj->close_code; - $this->close_note = $obj->close_note; - $this->socid = $obj->fk_soc; - $this->statut = $obj->fk_statut; - $this->date_lim_reglement = $this->db->jdate($obj->dlr); - $this->mode_reglement_id = $obj->fk_mode_reglement; - $this->mode_reglement_code = $obj->mode_reglement_code; - $this->mode_reglement = $obj->mode_reglement_libelle; - $this->cond_reglement_id = $obj->fk_cond_reglement; - $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; - $this->fk_account = ($obj->fk_account>0)?$obj->fk_account:null; - $this->fk_project = $obj->fk_projet; - $this->fk_facture_source = $obj->fk_facture_source; - $this->note = $obj->note_private; // deprecated - $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; - $this->user_author = $obj->fk_user_author; - $this->user_valid = $obj->fk_user_valid; - $this->modelpdf = $obj->model_pdf; + $this->id = $obj->rowid; + $this->ref = $obj->facnumber; + $this->ref_client = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; + $this->ref_int = $obj->ref_int; + $this->type = $obj->type; + $this->date = $this->db->jdate($obj->df); + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_validation = $this->db->jdate($obj->datev); + $this->datem = $this->db->jdate($obj->datem); + $this->remise_percent = $obj->remise_percent; + $this->remise_absolue = $obj->remise_absolue; + $this->total_ht = $obj->total; + $this->total_tva = $obj->tva; + $this->total_localtax1 = $obj->localtax1; + $this->total_localtax2 = $obj->localtax2; + $this->total_ttc = $obj->total_ttc; + $this->revenuestamp = $obj->revenuestamp; + $this->paye = $obj->paye; + $this->close_code = $obj->close_code; + $this->close_note = $obj->close_note; + $this->socid = $obj->fk_soc; + $this->statut = $obj->fk_statut; + $this->date_lim_reglement = $this->db->jdate($obj->dlr); + $this->mode_reglement_id = $obj->fk_mode_reglement; + $this->mode_reglement_code = $obj->mode_reglement_code; + $this->mode_reglement = $obj->mode_reglement_libelle; + $this->cond_reglement_id = $obj->fk_cond_reglement; + $this->cond_reglement_code = $obj->cond_reglement_code; + $this->cond_reglement = $obj->cond_reglement_libelle; + $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; + $this->fk_account = ($obj->fk_account>0)?$obj->fk_account:null; + $this->fk_project = $obj->fk_projet; + $this->fk_facture_source = $obj->fk_facture_source; + $this->note = $obj->note_private; // deprecated + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->user_author = $obj->fk_user_author; + $this->user_valid = $obj->fk_user_valid; + $this->modelpdf = $obj->model_pdf; - $this->extraparams = (array) json_decode($obj->extraparams, true); + $this->extraparams = (array) json_decode($obj->extraparams, true); - if ($this->statut == 0) $this->brouillon = 1; + if ($this->statut == 0) $this->brouillon = 1; - // Retreive all extrafield for invoice - // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); + // Retreive all extrafield for invoice + // fetch optionals attributes and labels + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); - /* + /* * Lines */ - $this->lines = array(); + $this->lines = array(); - $result=$this->fetch_lines(); - if ($result < 0) - { - $this->error=$this->db->error(); - return -3; - } - return 1; - } - else - { - $this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; - dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); - return 0; - } - } - else - { - $this->error=$this->db->error(); - return -1; - } - } + $result=$this->fetch_lines(); + if ($result < 0) + { + $this->error=$this->db->error(); + return -3; + } + return 1; + } + else + { + $this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; + dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); + return 0; + } + } + else + { + $this->error=$this->db->error(); + return -1; + } + } - /** - * Load all detailed lines into this->lines - * - * @return int 1 if OK, < 0 if KO - */ - function fetch_lines() - { - $this->lines=array(); + /** + * Load all detailed lines into this->lines + * + * @return int 1 if OK, < 0 if KO + */ + function fetch_lines() + { + $this->lines=array(); - $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, '; - $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,'; - $sql.= ' l.rang, l.special_code,'; - $sql.= ' l.date_start as date_start, l.date_end as date_end,'; - $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; - $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; - $sql.= ' WHERE l.fk_facture = '.$this->id; - $sql.= ' ORDER BY l.rang'; + $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, '; + $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,'; + $sql.= ' l.rang, l.special_code,'; + $sql.= ' l.date_start as date_start, l.date_end as date_end,'; + $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql.= ' WHERE l.fk_facture = '.$this->id; + $sql.= ' ORDER BY l.rang'; - dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - $num = $this->db->num_rows($result); - $i = 0; - while ($i < $num) - { - $objp = $this->db->fetch_object($result); - $line = new FactureLigne($this->db); + dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + while ($i < $num) + { + $objp = $this->db->fetch_object($result); + $line = new FactureLigne($this->db); - $line->rowid = $objp->rowid; - $line->label = $objp->custom_label; // deprecated - $line->desc = $objp->description; // Description line - $line->product_type = $objp->product_type; // Type of line - $line->product_ref = $objp->product_ref; // Ref product - $line->libelle = $objp->product_label; // TODO deprecated - $line->product_label = $objp->product_label; // Label product - $line->product_desc = $objp->product_desc; // Description product - $line->fk_product_type = $objp->fk_product_type; // Type of product - $line->qty = $objp->qty; - $line->subprice = $objp->subprice; - $line->tva_tx = $objp->tva_tx; - $line->localtax1_tx = $objp->localtax1_tx; - $line->localtax2_tx = $objp->localtax2_tx; - $line->localtax1_type = $objp->localtax1_type; - $line->localtax2_type = $objp->localtax2_type; - $line->remise_percent = $objp->remise_percent; - $line->fk_remise_except = $objp->fk_remise_except; - $line->fk_product = $objp->fk_product; - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - $line->info_bits = $objp->info_bits; - $line->total_ht = $objp->total_ht; - $line->total_tva = $objp->total_tva; - $line->total_localtax1 = $objp->total_localtax1; - $line->total_localtax2 = $objp->total_localtax2; - $line->total_ttc = $objp->total_ttc; - $line->code_ventilation = $objp->fk_code_ventilation; - $line->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); - $line->pa_ht = $marginInfos[0]; - $line->marge_tx = $marginInfos[1]; - $line->marque_tx = $marginInfos[2]; - $line->rang = $objp->rang; - $line->special_code = $objp->special_code; - $line->fk_parent_line = $objp->fk_parent_line; + $line->rowid = $objp->rowid; + $line->label = $objp->custom_label; // deprecated + $line->desc = $objp->description; // Description line + $line->product_type = $objp->product_type; // Type of line + $line->product_ref = $objp->product_ref; // Ref product + $line->libelle = $objp->product_label; // TODO deprecated + $line->product_label = $objp->product_label; // Label product + $line->product_desc = $objp->product_desc; // Description product + $line->fk_product_type = $objp->fk_product_type; // Type of product + $line->qty = $objp->qty; + $line->subprice = $objp->subprice; + $line->tva_tx = $objp->tva_tx; + $line->localtax1_tx = $objp->localtax1_tx; + $line->localtax2_tx = $objp->localtax2_tx; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; + $line->remise_percent = $objp->remise_percent; + $line->fk_remise_except = $objp->fk_remise_except; + $line->fk_product = $objp->fk_product; + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + $line->info_bits = $objp->info_bits; + $line->total_ht = $objp->total_ht; + $line->total_tva = $objp->total_tva; + $line->total_localtax1 = $objp->total_localtax1; + $line->total_localtax2 = $objp->total_localtax2; + $line->total_ttc = $objp->total_ttc; + $line->code_ventilation = $objp->fk_code_ventilation; + $line->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; + $line->rang = $objp->rang; + $line->special_code = $objp->special_code; + $line->fk_parent_line = $objp->fk_parent_line; - $this->lines[$i] = $line; + $this->lines[$i] = $line; - $i++; - } - $this->db->free($result); - return 1; - } - else - { - $this->error=$this->db->error(); - return -3; - } - } + $i++; + } + $this->db->free($result); + return 1; + } + else + { + $this->error=$this->db->error(); + return -3; + } + } - /** - * Update database - * - * @param User $user User that modify - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int <0 if KO, >0 if OK - */ - function update($user=0, $notrigger=0) - { - global $conf, $langs; - $error=0; + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user=0, $notrigger=0) + { + global $conf, $langs; + $error=0; - // Clean parameters - if (empty($this->type)) $this->type= self::TYPE_STANDARD; - if (isset($this->facnumber)) $this->facnumber=trim($this->ref); - if (isset($this->ref_client)) $this->ref_client=trim($this->ref_client); - if (isset($this->increment)) $this->increment=trim($this->increment); - if (isset($this->close_code)) $this->close_code=trim($this->close_code); - if (isset($this->close_note)) $this->close_note=trim($this->close_note); - if (isset($this->note) || isset($this->note_private)) $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated - if (isset($this->note) || isset($this->note_private)) $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note)); - if (isset($this->note_public)) $this->note_public=trim($this->note_public); - if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf); - if (isset($this->import_key)) $this->import_key=trim($this->import_key); + // Clean parameters + if (empty($this->type)) $this->type= self::TYPE_STANDARD; + if (isset($this->facnumber)) $this->facnumber=trim($this->ref); + if (isset($this->ref_client)) $this->ref_client=trim($this->ref_client); + if (isset($this->increment)) $this->increment=trim($this->increment); + if (isset($this->close_code)) $this->close_code=trim($this->close_code); + if (isset($this->close_note)) $this->close_note=trim($this->close_note); + if (isset($this->note) || isset($this->note_private)) $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated + if (isset($this->note) || isset($this->note_private)) $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note)); + if (isset($this->note_public)) $this->note_public=trim($this->note_public); + if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf); + if (isset($this->import_key)) $this->import_key=trim($this->import_key); - // Check parameters - // Put here code to add control on parameters values + // Check parameters + // Put here code to add control on parameters values - // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; - $sql.= " facnumber=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; - $sql.= " type=".(isset($this->type)?$this->type:"null").","; - $sql.= " ref_client=".(isset($this->ref_client)?"'".$this->db->escape($this->ref_client)."'":"null").","; - $sql.= " increment=".(isset($this->increment)?"'".$this->db->escape($this->increment)."'":"null").","; - $sql.= " fk_soc=".(isset($this->socid)?$this->socid:"null").","; - $sql.= " datec=".(strval($this->date_creation)!='' ? "'".$this->db->idate($this->date_creation)."'" : 'null').","; - $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; - $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; - $sql.= " paye=".(isset($this->paye)?$this->paye:"null").","; - $sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").","; - $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").","; - $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; - $sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").","; - $sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").","; - $sql.= " localtax1=".(isset($this->total_localtax1)?$this->total_localtax1:"null").","; - $sql.= " localtax2=".(isset($this->total_localtax2)?$this->total_localtax2:"null").","; - $sql.= " total=".(isset($this->total_ht)?$this->total_ht:"null").","; - $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; - $sql.= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '')?$this->revenuestamp:"null").","; - $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; - $sql.= " fk_user_author=".(isset($this->user_author)?$this->user_author:"null").","; - $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; - $sql.= " fk_facture_source=".(isset($this->fk_facture_source)?$this->fk_facture_source:"null").","; - $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; - $sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").","; - $sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").","; - $sql.= " date_lim_reglement=".(strval($this->date_lim_reglement)!='' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').","; - $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; - $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; - $sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").","; - $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; + $sql.= " facnumber=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " type=".(isset($this->type)?$this->type:"null").","; + $sql.= " ref_client=".(isset($this->ref_client)?"'".$this->db->escape($this->ref_client)."'":"null").","; + $sql.= " increment=".(isset($this->increment)?"'".$this->db->escape($this->increment)."'":"null").","; + $sql.= " fk_soc=".(isset($this->socid)?$this->socid:"null").","; + $sql.= " datec=".(strval($this->date_creation)!='' ? "'".$this->db->idate($this->date_creation)."'" : 'null').","; + $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; + $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; + $sql.= " paye=".(isset($this->paye)?$this->paye:"null").","; + $sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").","; + $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").","; + $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; + $sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").","; + $sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").","; + $sql.= " localtax1=".(isset($this->total_localtax1)?$this->total_localtax1:"null").","; + $sql.= " localtax2=".(isset($this->total_localtax2)?$this->total_localtax2:"null").","; + $sql.= " total=".(isset($this->total_ht)?$this->total_ht:"null").","; + $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; + $sql.= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '')?$this->revenuestamp:"null").","; + $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; + $sql.= " fk_user_author=".(isset($this->user_author)?$this->user_author:"null").","; + $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; + $sql.= " fk_facture_source=".(isset($this->fk_facture_source)?$this->fk_facture_source:"null").","; + $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; + $sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").","; + $sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").","; + $sql.= " date_lim_reglement=".(strval($this->date_lim_reglement)!='' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').","; + $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; + $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; + $sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").","; + $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; - $sql.= " WHERE rowid=".$this->id; + $sql.= " WHERE rowid=".$this->id; - $this->db->begin(); + $this->db->begin(); - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { - $error++; $this->errors[]="Error ".$this->db->lasterror(); - } + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } - if (! $error) - { - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('BILL_MODIFY',$user); - if ($result < 0) $error++; - // End call triggers - } - } + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('BILL_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + } - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); - return 1; - } - } + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } - /** - * Add a discount line into invoice using an existing absolute discount - * - * @param int $idremise Id of absolute discount - * @return int >0 if OK, <0 if KO - */ - function insert_discount($idremise) - { - global $langs; + /** + * Add a discount line into invoice using an existing absolute discount + * + * @param int $idremise Id of absolute discount + * @return int >0 if OK, <0 if KO + */ + function insert_discount($idremise) + { + global $langs; - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $this->db->begin(); + $this->db->begin(); - $remise=new DiscountAbsolute($this->db); - $result=$remise->fetch($idremise); + $remise=new DiscountAbsolute($this->db); + $result=$remise->fetch($idremise); - if ($result > 0) - { - if ($remise->fk_facture) // Protection against multiple submission - { - $this->error=$langs->trans("ErrorDiscountAlreadyUsed"); - $this->db->rollback(); - return -5; - } + if ($result > 0) + { + if ($remise->fk_facture) // Protection against multiple submission + { + $this->error=$langs->trans("ErrorDiscountAlreadyUsed"); + $this->db->rollback(); + return -5; + } - $facligne=new FactureLigne($this->db); - $facligne->fk_facture=$this->id; - $facligne->fk_remise_except=$remise->id; - $facligne->desc=$remise->description; // Description ligne - $facligne->tva_tx=$remise->tva_tx; - $facligne->subprice=-$remise->amount_ht; - $facligne->fk_product=0; // Id produit predefini - $facligne->qty=1; - $facligne->remise_percent=0; - $facligne->rang=-1; - $facligne->info_bits=2; + $facligne=new FactureLigne($this->db); + $facligne->fk_facture=$this->id; + $facligne->fk_remise_except=$remise->id; + $facligne->desc=$remise->description; // Description ligne + $facligne->tva_tx=$remise->tva_tx; + $facligne->subprice=-$remise->amount_ht; + $facligne->fk_product=0; // Id produit predefini + $facligne->qty=1; + $facligne->remise_percent=0; + $facligne->rang=-1; + $facligne->info_bits=2; - $facligne->total_ht = -$remise->amount_ht; - $facligne->total_tva = -$remise->amount_tva; - $facligne->total_ttc = -$remise->amount_ttc; + $facligne->total_ht = -$remise->amount_ht; + $facligne->total_tva = -$remise->amount_tva; + $facligne->total_ttc = -$remise->amount_ttc; - $lineid=$facligne->insert(); - if ($lineid > 0) - { - $result=$this->update_price(1); - if ($result > 0) - { - // Create linke between discount and invoice line - $result=$remise->link_to_invoice($lineid,0); - if ($result < 0) - { - $this->error=$remise->error; - $this->db->rollback(); - return -4; - } + $lineid=$facligne->insert(); + if ($lineid > 0) + { + $result=$this->update_price(1); + if ($result > 0) + { + // Create linke between discount and invoice line + $result=$remise->link_to_invoice($lineid,0); + if ($result < 0) + { + $this->error=$remise->error; + $this->db->rollback(); + return -4; + } - $this->db->commit(); - return 1; - } - else - { - $this->error=$facligne->error; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$facligne->error; - $this->db->rollback(); - return -2; - } - } - else - { - $this->db->rollback(); - return -3; - } - } + $this->db->commit(); + return 1; + } + else + { + $this->error=$facligne->error; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$facligne->error; + $this->db->rollback(); + return -2; + } + } + else + { + $this->db->rollback(); + return -3; + } + } - /** - * Set customer ref - * - * @param string $ref_client Customer ref - * @return int <0 if KO, >0 if OK - */ - function set_ref_client($ref_client) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - if (empty($ref_client)) - $sql .= ' SET ref_client = NULL'; - else - $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; - $sql .= ' WHERE rowid = '.$this->id; - if ($this->db->query($sql)) - { - $this->ref_client = $ref_client; - return 1; - } - else - { - dol_print_error($this->db); - return -1; - } - } + /** + * Set customer ref + * + * @param string $ref_client Customer ref + * @return int <0 if KO, >0 if OK + */ + function set_ref_client($ref_client) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + if (empty($ref_client)) + $sql .= ' SET ref_client = NULL'; + else + $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; + $sql .= ' WHERE rowid = '.$this->id; + if ($this->db->query($sql)) + { + $this->ref_client = $ref_client; + return 1; + } + else + { + dol_print_error($this->db); + return -1; + } + } - /** - * Delete invoice - * - * @param int $rowid Id of invoice to delete. If empty, we delete current instance of invoice - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @param int $idwarehouse Id warehouse to use for stock change. - * @return int <0 if KO, >0 if OK - */ - function delete($rowid=0, $notrigger=0, $idwarehouse=-1) - { - global $user,$langs,$conf; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + /** + * Delete invoice + * + * @param int $rowid Id of invoice to delete. If empty, we delete current instance of invoice + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK + */ + function delete($rowid=0, $notrigger=0, $idwarehouse=-1) + { + global $user,$langs,$conf; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - if (empty($rowid)) $rowid=$this->id; + if (empty($rowid)) $rowid=$this->id; - dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - // TODO Test if there is at least on payment. If yes, refuse to delete. + // TODO Test if there is at least on payment. If yes, refuse to delete. - $error=0; - $this->db->begin(); + $error=0; + $this->db->begin(); - if (! $error && ! $notrigger) - { + if (! $error && ! $notrigger) + { // Call trigger $result=$this->call_trigger('BILL_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } + } - // Removed extrafields - if (! $error) { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR); - } - } + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR); + } + } - if (! $error) - { - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) $error++; - } + if (! $error) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error++; + } - if (! $error) - { - // If invoice was converted into a discount not yet consumed, we remove discount - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' WHERE fk_facture_source = '.$rowid; - $sql.= ' AND fk_facture_line IS NULL'; - $resql=$this->db->query($sql); + if (! $error) + { + // If invoice was converted into a discount not yet consumed, we remove discount + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' WHERE fk_facture_source = '.$rowid; + $sql.= ' AND fk_facture_line IS NULL'; + $resql=$this->db->query($sql); - // If invoice has consumned discounts - $this->fetch_lines(); - $list_rowid_det=array(); - foreach($this->lines as $key => $invoiceline) - { - $list_rowid_det[]=$invoiceline->rowid; - } + // If invoice has consumned discounts + $this->fetch_lines(); + $list_rowid_det=array(); + foreach($this->lines as $key => $invoiceline) + { + $list_rowid_det[]=$invoiceline->rowid; + } - // Consumned discounts are freed - if (count($list_rowid_det)) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL'; - $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')'; + // Consumned discounts are freed + if (count($list_rowid_det)) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL'; + $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')'; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (! $this->db->query($sql)) - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -5; - } - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (! $this->db->query($sql)) + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -5; + } + } - // If we decrament stock on invoice validation, we increment - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse!=-1) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); + // If we decrament stock on invoice validation, we increment + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse!=-1) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); - else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value - } - } - } + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value + } + } + } - // Delete invoice line - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; + // Delete invoice line + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sql) && $this->delete_linked_contact()) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid; + if ($this->db->query($sql) && $this->delete_linked_contact()) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - // On efface le repertoire de pdf provisoire - $ref = dol_sanitizeFileName($this->ref); - if ($conf->facture->dir_output && !empty($this->ref)) - { - $dir = $conf->facture->dir_output . "/" . $ref; - $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; - if (file_exists($file)) // We must delete all files before deleting directory - { - $ret=dol_delete_preview($this); + $resql=$this->db->query($sql); + if ($resql) + { + // On efface le repertoire de pdf provisoire + $ref = dol_sanitizeFileName($this->ref); + if ($conf->facture->dir_output && !empty($this->ref)) + { + $dir = $conf->facture->dir_output . "/" . $ref; + $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; + if (file_exists($file)) // We must delete all files before deleting directory + { + $ret=dol_delete_preview($this); - if (! dol_delete_file($file,0,0,0,$this)) // For triggers - { - $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); - $this->db->rollback(); - return 0; - } - } - if (file_exists($dir)) - { - if (! dol_delete_dir_recursive($dir)) // For remove dir and meta - { - $this->error=$langs->trans("ErrorCanNotDeleteDir",$dir); - $this->db->rollback(); - return 0; - } - } - } + if (! dol_delete_file($file,0,0,0,$this)) // For triggers + { + $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); + $this->db->rollback(); + return 0; + } + } + if (file_exists($dir)) + { + if (! dol_delete_dir_recursive($dir)) // For remove dir and meta + { + $this->error=$langs->trans("ErrorCanNotDeleteDir",$dir); + $this->db->rollback(); + return 0; + } + } + } - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->lasterror()." sql=".$sql; - $this->db->rollback(); - return -6; - } - } - else - { - $this->error=$this->db->lasterror()." sql=".$sql; - $this->db->rollback(); - return -4; - } - } - else - { - $this->db->rollback(); - return -2; - } - } + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->lasterror()." sql=".$sql; + $this->db->rollback(); + return -6; + } + } + else + { + $this->error=$this->db->lasterror()." sql=".$sql; + $this->db->rollback(); + return -4; + } + } + else + { + $this->db->rollback(); + return -2; + } + } - /** - * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 - * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 - * - * @param User $user Objet utilisateur qui modifie - * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) - * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) - * @return int <0 if KO, >0 if OK - */ - function set_paid($user,$close_code='',$close_note='') - { - global $conf,$langs; - $error=0; + /** + * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 + * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 + * + * @param User $user Objet utilisateur qui modifie + * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) + * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) + * @return int <0 if KO, >0 if OK + */ + function set_paid($user,$close_code='',$close_note='') + { + global $conf,$langs; + $error=0; - if ($this->paye != 1) - { - $this->db->begin(); + if ($this->paye != 1) + { + $this->db->begin(); - dol_syslog(get_class($this)."::set_paid rowid=".$this->id, LOG_DEBUG); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; - $sql.= ' fk_statut=2'; - if (! $close_code) $sql.= ', paye=1'; - if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; - if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; - $sql.= ' WHERE rowid = '.$this->id; + dol_syslog(get_class($this)."::set_paid rowid=".$this->id, LOG_DEBUG); + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; + $sql.= ' fk_statut=2'; + if (! $close_code) $sql.= ', paye=1'; + if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; + if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; + $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - // Call trigger - $result=$this->call_trigger('BILL_PAYED',$user); - if ($result < 0) $error++; - // End call triggers - } - else - { - $error++; - $this->error=$this->db->lasterror(); - } + dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + // Call trigger + $result=$this->call_trigger('BILL_PAYED',$user); + if ($result < 0) $error++; + // End call triggers + } + else + { + $error++; + $this->error=$this->db->lasterror(); + } - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - else - { - return 0; - } - } + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + else + { + return 0; + } + } - /** - * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED - * Fonction utilisee quand un paiement prelevement est refuse, - * ou quand une facture annulee et reouverte. - * - * @param User $user Object user that change status - * @return int <0 if KO, >0 if OK - */ - function set_unpaid($user) - { - global $conf,$langs; - $error=0; + /** + * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED + * Fonction utilisee quand un paiement prelevement est refuse, + * ou quand une facture annulee et reouverte. + * + * @param User $user Object user that change status + * @return int <0 if KO, >0 if OK + */ + function set_unpaid($user) + { + global $conf,$langs; + $error=0; - $this->db->begin(); + $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; - $sql.= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; + $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { + dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { // Call trigger $result=$this->call_trigger('BILL_UNPAYED',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } - else - { - $error++; - $this->error=$this->db->error(); - dol_print_error($this->db); - } - - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - - - /** - * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL - * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because - * of no payment even if merchandises were sent). - * - * @param User $user Object user making change - * @param string $close_code Code de fermeture - * @param string $close_note Comment - * @return int <0 if KO, >0 if OK - */ - function set_canceled($user,$close_code='',$close_note='') - { - global $conf,$langs; - - $error=0; - - dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); - - $this->db->begin(); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; - $sql.= ' fk_statut=3'; - if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; - if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; - $sql.= ' WHERE rowid = '.$this->id; - - $resql = $this->db->query($sql); - if ($resql) - { - // On desaffecte de la facture les remises liees - // car elles n'ont pas ete utilisees vu que la facture est abandonnee. - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture = NULL'; - $sql.= ' WHERE fk_facture = '.$this->id; - - $resql=$this->db->query($sql); - if ($resql) - { - // Call trigger - $result=$this->call_trigger('BILL_CANCEL',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - } - // End call triggers - - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -2; - } - } - - /** - * Tag invoice as validated + call trigger BILL_VALIDATE - * Object must have lines loaded with fetch_lines - * - * @param User $user Object user that validate - * @param string $force_number Reference to force on invoice - * @param int $idwarehouse Id of warehouse to use for stock decrease - * @return int <0 if KO, >0 if OK - */ - function validate($user, $force_number='', $idwarehouse=0) - { - global $conf,$langs; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $now=dol_now(); - - $error=0; - dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse); - - // Check parameters - if (! $this->brouillon) - { - dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); - return 0; - } - - if (! $user->rights->facture->valider) - { - $this->error='Permission denied'; - dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR); - return -1; - } - - $this->db->begin(); - - $this->fetch_thirdparty(); - $this->fetch_lines(); - - // Check parameters - if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement - { - // Controle que facture source connue - if ($this->fk_facture_source <= 0) - { - $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("InvoiceReplacement")); - $this->db->rollback(); - return -10; - } - - // Charge la facture source a remplacer - $facreplaced=new Facture($this->db); - $result=$facreplaced->fetch($this->fk_facture_source); - if ($result <= 0) - { - $this->error=$langs->trans("ErrorBadInvoice"); - $this->db->rollback(); - return -11; - } - - // Controle que facture source non deja remplacee par une autre - $idreplacement=$facreplaced->getIdReplacingInvoice('validated'); - if ($idreplacement && $idreplacement != $this->id) - { - $facreplacement=new Facture($this->db); - $facreplacement->fetch($idreplacement); - $this->error=$langs->trans("ErrorInvoiceAlreadyReplaced",$facreplaced->ref,$facreplacement->ref); - $this->db->rollback(); - return -12; - } - - $result=$facreplaced->set_canceled($user,'replaced',''); - if ($result < 0) - { - $this->error=$facreplaced->error; - $this->db->rollback(); - return -13; - } - } - - // Define new ref - if ($force_number) - { - $num = $force_number; - } - else if (preg_match('/^[\(]?PROV/i', $this->ref)) - { - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date - { - $this->date=dol_now(); - $this->date_lim_reglement=$this->calculate_date_lim_reglement(); - } - $num = $this->getNextNumRef($this->client); - } - else - { - $num = $this->ref; - } - - if ($num) - { - $this->update_price(1); - - // Validate - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date - { - $sql.= ", datef='".$this->db->idate($this->date)."'"; - $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; - } - $sql.= ' WHERE rowid = '.$this->id; - - dol_syslog(get_class($this)."::validate", LOG_DEBUG); - $resql=$this->db->query($sql); - if (! $resql) - { - dol_print_error($this->db); - $error++; - } - - // On verifie si la facture etait une provisoire - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) - { - // La verif qu'une remise n'est pas utilisee 2 fois est faite au moment de l'insertion de ligne - } - - if (! $error) - { - // Define third party as a customer - $result=$this->client->set_as_client(); - - // Si active on decremente le produit principal et ses composants a la validation de facture - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); - - // Loop on each line - $cpt=count($this->lines); - for ($i = 0; $i < $cpt; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); - else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); - if ($result < 0) { - $error++; - } - } - } - } - } - - if (! $error) - { - $this->oldref = ''; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) - { - // Rename of object directory ($this->ref = old ref, $num = new ref) - // to not lose the linked files - $facref = dol_sanitizeFileName($this->ref); - $snumfa = dol_sanitizeFileName($num); - $dirsource = $conf->facture->dir_output.'/'.$facref; - $dirdest = $conf->facture->dir_output.'/'.$snumfa; - if (file_exists($dirsource)) - { - dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) - { - $this->oldref = $facref; - - dol_syslog("Rename ok"); - // Suppression ancien fichier PDF dans nouveau rep - dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); - } - } - } - } - - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->facnumber=$num; - $this->statut=1; - $this->brouillon=0; - $this->date_validation=$now; - } - - // Trigger calls - if (! $error) - { - // Call trigger - $result=$this->call_trigger('BILL_VALIDATE',$user); - if ($result < 0) $error++; - //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail - // End call triggers - } - } - else - { - $error++; - } - - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - - /** - * Set draft status - * - * @param User $user Object user that modify - * @param int $idwarehouse Id warehouse to use for stock change. - * @return int <0 if KO, >0 if OK - */ - function set_draft($user,$idwarehouse=-1) - { - global $conf,$langs; - - $error=0; - - if ($this->statut == 0) - { - dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); - return 0; - } - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; - $sql.= " SET fk_statut = 0"; - $sql.= " WHERE rowid = ".$this->id; - - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); - $result=$this->db->query($sql); - if ($result) - { - // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); - - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); - else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value - } - } - } - - if ($error == 0) - { - $old_statut=$this->statut; - $this->brouillon = 1; - $this->statut = 0; - // Call trigger - $result=$this->call_trigger('BILL_UNVALIDATE',$user); - if ($result < 0) - { - $error++; - $this->statut=$old_statut; - $this->brouillon=0; - } - // End call triggers - } else { - $this->db->rollback(); - return -1; - } - - if ($error == 0) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } - - - /** - * Add an invoice line into database (linked to product/service or not). - * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel - * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini - * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) - * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) - * - * @param string $desc Description of line - * @param double $pu_ht Unit price without tax (> 0 even for credit note) - * @param double $qty Quantity - * @param double $txtva Force vat rate, -1 for auto - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate - * @param int $fk_product Id of predefined product/service - * @param double $remise_percent Percent of discount on line - * @param timestamp $date_start Date start of service - * @param timestamp $date_end Date end of service - * @param int $ventil Code of dispatching into accountancy - * @param int $info_bits Bits de type de lignes - * @param int $fk_remise_except Id discount used - * @param string $price_base_type 'HT' or 'TTC' - * @param double $pu_ttc Unit price with tax (> 0 even for credit note) - * @param int $type Type of line (0=product, 1=service) - * @param int $rang Position of line - * @param int $special_code Special code (also used by externals modules!) - * @param string $origin 'order', ... - * @param int $origin_id Id of origin object - * @param int $fk_parent_line Id of parent line - * @param int $fk_fournprice Supplier price id (to calculate margin) or '' - * @param int $pa_ht Buying price of line (to calculate margin) or '' - * @param string $label Label of the line (deprecated, do not use) - * @param array $array_option extrafields array - * @return int <0 if KO, Id of line if OK - */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0) - { - global $mysoc, $conf, $langs; - - dol_syslog(get_class($this)."::addline facid=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - // Clean parameters - if (empty($remise_percent)) $remise_percent=0; - if (empty($qty)) $qty=0; - if (empty($info_bits)) $info_bits=0; - if (empty($rang)) $rang=0; - if (empty($ventil)) $ventil=0; - if (empty($txtva)) $txtva=0; - if (empty($txlocaltax1)) $txlocaltax1=0; - if (empty($txlocaltax2)) $txlocaltax2=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - - $remise_percent=price2num($remise_percent); - $qty=price2num($qty); - $pu_ht=price2num($pu_ht); - $pu_ttc=price2num($pu_ttc); - $pa_ht=price2num($pa_ht); - $txtva=price2num($txtva); - $txlocaltax1=price2num($txlocaltax1); - $txlocaltax2=price2num($txlocaltax2); - - if ($price_base_type=='HT') - { - $pu=$pu_ht; - } - else - { - $pu=$pu_ttc; - } - - // Check parameters - if ($type < 0) return -1; - - if (! empty($this->brouillon)) - { - $this->db->begin(); - - // Calcul du total TTC et de la TVA pour la ligne a partir de - // qty, pu, remise_percent et txtva - // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker - // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - - $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); - - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type); - - $total_ht = $tabprice[0]; - $total_tva = $tabprice[1]; - $total_ttc = $tabprice[2]; - $total_localtax1 = $tabprice[9]; - $total_localtax2 = $tabprice[10]; - $pu_ht = $tabprice[3]; - - // Rang to use - $rangtouse = $rang; - if ($rangtouse == -1) - { - $rangmax = $this->line_max($fk_parent_line); - $rangtouse = $rangmax + 1; - } - - $product_type=$type; - if (!empty($fk_product)) - { - $product=new Product($this->db); - $result=$product->fetch($fk_product); - $product_type=$product->type; - - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { - $this->error=$langs->trans('ErrorStockIsNotEnough'); - $this->db->rollback(); - return -3; - } - } - - // Insert line - $this->line=new FactureLigne($this->db); - $this->line->fk_facture=$this->id; - $this->line->label=$label; // deprecated - $this->line->desc=$desc; - $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative - $this->line->tva_tx=$txtva; - $this->line->localtax1_tx=$txlocaltax1; - $this->line->localtax2_tx=$txlocaltax2; - $this->line->fk_product=$fk_product; - $this->line->product_type=$product_type; - $this->line->remise_percent=$remise_percent; - $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise - $this->line->date_start=$date_start; - $this->line->date_end=$date_end; - $this->line->ventil=$ventil; - $this->line->rang=$rangtouse; - $this->line->info_bits=$info_bits; - $this->line->fk_remise_except=$fk_remise_except; - $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); - $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); - $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); - $this->line->special_code=$special_code; - $this->line->fk_parent_line=$fk_parent_line; - $this->line->origin=$origin; - $this->line->origin_id=$origin_id; - - // infos marge - $this->line->fk_fournprice = $fk_fournprice; - $this->line->pa_ht = $pa_ht; - - if (is_array($array_option) && count($array_option)>0) { - $this->line->array_options=$array_option; - } - - $result=$this->line->insert(); - if ($result > 0) - { - // Reorder if child line - if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); - - // Mise a jour informations denormalisees au niveau de la facture meme - $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. - if ($result > 0) - { - $this->db->commit(); - return $this->line->rowid; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->line->error; - $this->db->rollback(); - return -2; - } - } - } - - /** - * Update a detail line - * - * @param int $rowid Id of line to update - * @param string $desc Description of line - * @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines) - * @param double $qty Quantity - * @param double $remise_percent Pourcentage de remise de la ligne - * @param date $date_start Date de debut de validite du service - * @param date $date_end Date de fin de validite du service - * @param double $txtva VAT Rate - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate - * @param string $price_base_type HT or TTC - * @param int $info_bits Miscellaneous informations - * @param int $type Type of line (0=product, 1=service) - * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). - * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) - * @param int $fk_fournprice Id of origin supplier price - * @param int $pa_ht Price (without tax) of product when it was bought - * @param string $label Label of the line (deprecated, do not use) - * @param int $special_code Special code (also used by externals modules!) + } + else + { + $error++; + $this->error=$this->db->error(); + dol_print_error($this->db); + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + + /** + * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL + * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because + * of no payment even if merchandises were sent). + * + * @param User $user Object user making change + * @param string $close_code Code de fermeture + * @param string $close_note Comment + * @return int <0 if KO, >0 if OK + */ + function set_canceled($user,$close_code='',$close_note='') + { + global $conf,$langs; + + $error=0; + + dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); + + $this->db->begin(); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; + $sql.= ' fk_statut=3'; + if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; + if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; + $sql.= ' WHERE rowid = '.$this->id; + + $resql = $this->db->query($sql); + if ($resql) + { + // On desaffecte de la facture les remises liees + // car elles n'ont pas ete utilisees vu que la facture est abandonnee. + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture = NULL'; + $sql.= ' WHERE fk_facture = '.$this->id; + + $resql=$this->db->query($sql); + if ($resql) + { + // Call trigger + $result=$this->call_trigger('BILL_CANCEL',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -2; + } + } + + /** + * Tag invoice as validated + call trigger BILL_VALIDATE + * Object must have lines loaded with fetch_lines + * + * @param User $user Object user that validate + * @param string $force_number Reference to force on invoice + * @param int $idwarehouse Id of warehouse to use for stock decrease + * @return int <0 if KO, >0 if OK + */ + function validate($user, $force_number='', $idwarehouse=0) + { + global $conf,$langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $now=dol_now(); + + $error=0; + dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse); + + // Check parameters + if (! $this->brouillon) + { + dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); + return 0; + } + + if (! $user->rights->facture->valider) + { + $this->error='Permission denied'; + dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR); + return -1; + } + + $this->db->begin(); + + $this->fetch_thirdparty(); + $this->fetch_lines(); + + // Check parameters + if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement + { + // Controle que facture source connue + if ($this->fk_facture_source <= 0) + { + $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("InvoiceReplacement")); + $this->db->rollback(); + return -10; + } + + // Charge la facture source a remplacer + $facreplaced=new Facture($this->db); + $result=$facreplaced->fetch($this->fk_facture_source); + if ($result <= 0) + { + $this->error=$langs->trans("ErrorBadInvoice"); + $this->db->rollback(); + return -11; + } + + // Controle que facture source non deja remplacee par une autre + $idreplacement=$facreplaced->getIdReplacingInvoice('validated'); + if ($idreplacement && $idreplacement != $this->id) + { + $facreplacement=new Facture($this->db); + $facreplacement->fetch($idreplacement); + $this->error=$langs->trans("ErrorInvoiceAlreadyReplaced",$facreplaced->ref,$facreplacement->ref); + $this->db->rollback(); + return -12; + } + + $result=$facreplaced->set_canceled($user,'replaced',''); + if ($result < 0) + { + $this->error=$facreplaced->error; + $this->db->rollback(); + return -13; + } + } + + // Define new ref + if ($force_number) + { + $num = $force_number; + } + else if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date + { + $this->date=dol_now(); + $this->date_lim_reglement=$this->calculate_date_lim_reglement(); + } + $num = $this->getNextNumRef($this->client); + } + else + { + $num = $this->ref; + } + + if ($num) + { + $this->update_price(1); + + // Validate + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; + if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date + { + $sql.= ", datef='".$this->db->idate($this->date)."'"; + $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; + } + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::validate", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) + { + dol_print_error($this->db); + $error++; + } + + // On verifie si la facture etait une provisoire + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + { + // La verif qu'une remise n'est pas utilisee 2 fois est faite au moment de l'insertion de ligne + } + + if (! $error) + { + // Define third party as a customer + $result=$this->client->set_as_client(); + + // Si active on decremente le produit principal et ses composants a la validation de facture + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); + + // Loop on each line + $cpt=count($this->lines); + for ($i = 0; $i < $cpt; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + if ($result < 0) { + $error++; + } + } + } + } + } + + if (! $error) + { + $this->oldref = ''; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // Rename of object directory ($this->ref = old ref, $num = new ref) + // to not lose the linked files + $facref = dol_sanitizeFileName($this->ref); + $snumfa = dol_sanitizeFileName($num); + $dirsource = $conf->facture->dir_output.'/'.$facref; + $dirdest = $conf->facture->dir_output.'/'.$snumfa; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + $this->oldref = $facref; + + dol_syslog("Rename ok"); + // Suppression ancien fichier PDF dans nouveau rep + dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); + } + } + } + } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->facnumber=$num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } + + // Trigger calls + if (! $error) + { + // Call trigger + $result=$this->call_trigger('BILL_VALIDATE',$user); + if ($result < 0) $error++; + //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail + // End call triggers + } + } + else + { + $error++; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK + */ + function set_draft($user,$idwarehouse=-1) + { + global $conf,$langs; + + $error=0; + + if ($this->statut == 0) + { + dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); + return 0; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; + $sql.= " SET fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + $result=$this->db->query($sql); + if ($result) + { + // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); + + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value + } + } + } + + if ($error == 0) + { + $old_statut=$this->statut; + $this->brouillon = 1; + $this->statut = 0; + // Call trigger + $result=$this->call_trigger('BILL_UNVALIDATE',$user); + if ($result < 0) + { + $error++; + $this->statut=$old_statut; + $this->brouillon=0; + } + // End call triggers + } else { + $this->db->rollback(); + return -1; + } + + if ($error == 0) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + + + /** + * Add an invoice line into database (linked to product/service or not). + * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel + * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini + * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) + * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) + * + * @param string $desc Description of line + * @param double $pu_ht Unit price without tax (> 0 even for credit note) + * @param double $qty Quantity + * @param double $txtva Force vat rate, -1 for auto + * @param double $txlocaltax1 Local tax 1 rate + * @param double $txlocaltax2 Local tax 2 rate + * @param int $fk_product Id of predefined product/service + * @param double $remise_percent Percent of discount on line + * @param timestamp $date_start Date start of service + * @param timestamp $date_end Date end of service + * @param int $ventil Code of dispatching into accountancy + * @param int $info_bits Bits de type de lignes + * @param int $fk_remise_except Id discount used + * @param string $price_base_type 'HT' or 'TTC' + * @param double $pu_ttc Unit price with tax (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $rang Position of line + * @param int $special_code Special code (also used by externals modules!) + * @param string $origin 'order', ... + * @param int $origin_id Id of origin object + * @param int $fk_parent_line Id of parent line + * @param int $fk_fournprice Supplier price id (to calculate margin) or '' + * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param string $label Label of the line (deprecated, do not use) + * @param array $array_option extrafields array + * @return int <0 if KO, Id of line if OK + */ + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $remise_amount=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0) + { + global $mysoc, $conf, $langs; + + dol_syslog(get_class($this)."::addline facid=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + // Clean parameters + if (empty($remise_percent)) $remise_percent=0; + if (empty($remise_amount)) $remise_amount=0; + if (empty($qty)) $qty=0; + if (empty($info_bits)) $info_bits=0; + if (empty($rang)) $rang=0; + if (empty($ventil)) $ventil=0; + if (empty($txtva)) $txtva=0; + if (empty($txlocaltax1)) $txlocaltax1=0; + if (empty($txlocaltax2)) $txlocaltax2=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + + $remise_percent=price2num($remise_percent); + $remise_amount=price2num($remise_amount); + $qty=price2num($qty); + $pu_ht=price2num($pu_ht); + $pu_ttc=price2num($pu_ttc); + $pa_ht=price2num($pa_ht); + $txtva=price2num($txtva); + $txlocaltax1=price2num($txlocaltax1); + $txlocaltax2=price2num($txlocaltax2); + + if ($price_base_type=='HT') + { + $pu=$pu_ht; + } + else + { + $pu=$pu_ttc; + } + + // Check parameters + if ($type < 0) return -1; + + if (! empty($this->brouillon)) + { + $this->db->begin(); + + // Calcul du total TTC et de la TVA pour la ligne a partir de + // qty, pu, remise_percent et txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); + + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type); + + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + $total_localtax1 = $tabprice[9]; + $total_localtax2 = $tabprice[10]; + $pu_ht = $tabprice[3]; + + // Rang to use + $rangtouse = $rang; + if ($rangtouse == -1) + { + $rangmax = $this->line_max($fk_parent_line); + $rangtouse = $rangmax + 1; + } + + $product_type=$type; + if (!empty($fk_product)) + { + $product=new Product($this->db); + $result=$product->fetch($fk_product); + $product_type=$product->type; + + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { + $this->error=$langs->trans('ErrorStockIsNotEnough'); + $this->db->rollback(); + return -3; + } + } + + // Insert line + $this->line=new FactureLigne($this->db); + $this->line->fk_facture=$this->id; + $this->line->label=$label; // deprecated + $this->line->desc=$desc; + $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->tva_tx=$txtva; + $this->line->localtax1_tx=$txlocaltax1; + $this->line->localtax2_tx=$txlocaltax2; + $this->line->fk_product=$fk_product; + $this->line->product_type=$product_type; + $this->line->remise_percent=$remise_percent; + $this->line->remise_amount=$remise_amount; + $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->date_start=$date_start; + $this->line->date_end=$date_end; + $this->line->ventil=$ventil; + $this->line->rang=$rangtouse; + $this->line->info_bits=$info_bits; + $this->line->fk_remise_except=$fk_remise_except; + $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + $this->line->special_code=$special_code; + $this->line->fk_parent_line=$fk_parent_line; + $this->line->origin=$origin; + $this->line->origin_id=$origin_id; + + // infos marge + $this->line->fk_fournprice = $fk_fournprice; + $this->line->pa_ht = $pa_ht; + + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + + $result=$this->line->insert(); + if ($result > 0) + { + // Reorder if child line + if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); + + // Mise a jour informations denormalisees au niveau de la facture meme + $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. + if ($result > 0) + { + $this->db->commit(); + return $this->line->rowid; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->line->error; + $this->db->rollback(); + return -2; + } + } + } + + /** + * Update a detail line + * + * @param int $rowid Id of line to update + * @param string $desc Description of line + * @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines) + * @param double $qty Quantity + * @param double $remise_percent Pourcentage de remise de la ligne + * @param date $date_start Date de debut de validite du service + * @param date $date_end Date de fin de validite du service + * @param double $txtva VAT Rate + * @param double $txlocaltax1 Local tax 1 rate + * @param double $txlocaltax2 Local tax 2 rate + * @param string $price_base_type HT or TTC + * @param int $info_bits Miscellaneous informations + * @param int $type Type of line (0=product, 1=service) + * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). + * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product when it was bought + * @param string $label Label of the line (deprecated, do not use) + * @param int $special_code Special code (also used by externals modules!) * @param array $array_option extrafields array - * @return int < 0 if KO, > 0 if OK - */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - global $mysoc; - - dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG); - - if ($this->brouillon) - { - $this->db->begin(); - - // Clean parameters - if (empty($qty)) $qty=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - if (empty($special_code) || $special_code == 3) $special_code=0; - - $remise_percent = price2num($remise_percent); - $qty = price2num($qty); - $pu = price2num($pu); - $pa_ht = price2num($pa_ht); - $txtva = price2num($txtva); - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); - - // Check parameters - if ($type < 0) return -1; - - // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva - // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker - // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - - $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); - - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); - $total_ht = $tabprice[0]; - $total_tva = $tabprice[1]; - $total_ttc = $tabprice[2]; - $total_localtax1=$tabprice[9]; - $total_localtax2=$tabprice[10]; - $pu_ht = $tabprice[3]; - $pu_tva = $tabprice[4]; - $pu_ttc = $tabprice[5]; - - // Update line into database - $this->line=new FactureLigne($this->db); - - // Stock previous line records - $staticline=new FactureLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; - - // Reorder if fk_parent_line change - if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) - { - $rangmax = $this->line_max($fk_parent_line); - $this->line->rang = $rangmax + 1; - } - - $this->line->rowid = $rowid; - $this->line->label = $label; - $this->line->desc = $desc; - $this->line->qty = ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative - $this->line->tva_tx = $txtva; - $this->line->localtax1_tx = $txlocaltax1; - $this->line->localtax2_tx = $txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->remise_percent = $remise_percent; - $this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise - $this->line->date_start = $date_start; - $this->line->date_end = $date_end; - $this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); - $this->line->total_localtax1 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); - $this->line->total_localtax2 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); - $this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); - $this->line->info_bits = $info_bits; - $this->line->special_code = $special_code; - $this->line->product_type = $type; - $this->line->fk_parent_line = $fk_parent_line; - $this->line->skip_update_total = $skip_update_total; - - // infos marge - $this->line->fk_fournprice = $fk_fournprice; - $this->line->pa_ht = $pa_ht; - - if (is_array($array_option) && count($array_option)>0) { - $this->line->array_options=$array_option; - } - - $result=$this->line->update(); - if ($result > 0) - { - // Reorder if child line - if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); - - // Mise a jour info denormalisees au niveau facture - $this->update_price(1); - $this->db->commit(); - return $result; - } - else - { - $this->error=$this->line->error; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error="Invoice statut makes operation forbidden"; - return -2; - } - } - - /** - * Delete line in database - * - * @param int $rowid Id of line to delete - * @return int <0 if KO, >0 if OK - */ - function deleteline($rowid) - { - global $langs, $conf; - - dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); - - if (! $this->brouillon) - { - $this->error='ErrorBadStatus'; - return -1; - } - - $this->db->begin(); - - // Libere remise liee a ligne de facture - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture_line = NULL'; - $sql.= ' WHERE fk_facture_line = '.$rowid; - - dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); - $result = $this->db->query($sql); - if (! $result) - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - - $line=new FactureLigne($this->db); - - // For triggers - $line->fetch($rowid); - - if ($line->delete() > 0) - { - $result=$this->update_price(1); - - if ($result > 0) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - $this->error=$this->db->lasterror(); - return -1; - } - } - else - { - $this->db->rollback(); - $this->error=$line->error; - return -1; - } - } - - /** - * Set percent discount - * - * @param User $user User that set discount - * @param double $remise Discount - * @return int <0 if ko, >0 if ok - */ - function set_remise($user, $remise) - { - // Clean parameters - if (empty($remise)) $remise=0; - - if ($user->rights->facture->creer) - { - $remise=price2num($remise); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET remise_percent = '.$remise; - $sql.= ' WHERE rowid = '.$this->id; - $sql.= ' AND fk_statut = 0'; - - if ($this->db->query($sql)) - { - $this->remise_percent = $remise; - $this->update_price(1); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - } - - - /** - * Set absolute discount - * - * @param User $user User that set discount - * @param double $remise Discount - * @return int <0 if KO, >0 if OK - */ - function set_remise_absolue($user, $remise) - { - if (empty($remise)) $remise=0; - - if ($user->rights->facture->creer) - { - $remise=price2num($remise); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET remise_absolue = '.$remise; - $sql.= ' WHERE rowid = '.$this->id; - $sql.= ' AND fk_statut = 0'; - - dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); - - if ($this->db->query($sql)) - { - $this->remise_absolue = $remise; - $this->update_price(1); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - } - - /** - * Return list of payments - * - * @param string $filtertype 1 to filter on type of payment == 'PRE' - * @return array Array with list of payments - */ - function getListOfPayments($filtertype='') - { - $retarray=array(); - - $table='paiement_facture'; - $table2='paiement'; - $field='fk_facture'; - $field2='fk_paiement'; - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') - { - $table='paiementfourn_facturefourn'; - $table2='paiementfourn'; - $field='fk_facturefourn'; - $field2='fk_paiementfourn'; - } - - $sql = 'SELECT pf.amount, p.fk_paiement, p.datep, t.code'; - $sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t'; - $sql.= ' WHERE pf.'.$field.' = '.$this->id; - $sql.= ' AND pf.'.$field2.' = p.rowid'; - $sql.= ' AND p.fk_paiement = t.id'; - if ($filtertype) $sql.=" AND t.code='PRE'"; - - dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - $retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep); - $i++; - } - $this->db->free($resql); - return $retarray; - } - else - { - $this->error=$this->db->lasterror(); - dol_print_error($this->db); - return array(); - } - } - - - /** - * Return amount (with tax) of all credit notes and deposits invoices used by invoice - * - * @return int <0 if KO, Sum of credit notes and deposits amount otherwise - */ - function getSumCreditNotesUsed() - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - - $discountstatic=new DiscountAbsolute($this->db); - $result=$discountstatic->getSumCreditNotesUsed($this); - if ($result >= 0) - { - return $result; - } - else - { - $this->error=$discountstatic->error; - return -1; - } - } - - /** - * Return amount (with tax) of all deposits invoices used by invoice - * - * @return int <0 if KO, Sum of deposits amount otherwise - */ - function getSumDepositsUsed() - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - - $discountstatic=new DiscountAbsolute($this->db); - $result=$discountstatic->getSumDepositsUsed($this); - if ($result >= 0) - { - return $result; - } - else - { - $this->error=$discountstatic->error; - return -1; - } - } - - /** - * Return next reference of customer invoice not already used (or last reference) - * according to numbering module defined into constant FACTURE_ADDON - * - * @param Society $soc object company - * @param string $mode 'next' for next value or 'last' for last value - * @return string free ref or last ref - */ - function getNextNumRef($soc,$mode='next') - { - global $conf, $db, $langs; - $langs->load("bills"); - - // Clean parameters (if not defined or using deprecated value) - if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; - - $mybool=false; - - $file = $conf->global->FACTURE_ADDON.".php"; - $classname = $conf->global->FACTURE_ADDON; - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/facture/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } - - // For compatibility - if (! $mybool) - { - $file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php"; - $classname = "mod_facture_".$conf->global->FACTURE_ADDON; - $classname = preg_replace('/\-.*$/','',$classname); - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/facture/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } - } - //print "xx".$mybool.$dir.$file."-".$classname; - - if (! $mybool) - { - dol_print_error('',"Failed to include file ".$file); - return ''; - } - - $obj = new $classname(); - $numref = ""; - $numref = $obj->getNumRef($soc,$this,$mode); - - if ($numref != "") - { - return $numref; - } - else - { - //dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); - return false; - } - } - - /** - * Load miscellaneous information for tab "Info" - * - * @param int $id Id of object to load - * @return void - */ - function info($id) - { - $sql = 'SELECT c.rowid, datec, date_valid as datev, tms as datem,'; - $sql.= ' fk_user_author, fk_user_valid'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as c'; - $sql.= ' WHERE c.rowid = '.$id; - - $result=$this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - if ($obj->fk_user_author) - { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_valid) - { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); // Should be in log table - } - $this->db->free($result); - } - else - { - dol_print_error($this->db); - } - } - - /** - * Renvoi si les lignes de facture sont ventilees et/ou exportees en compta - * - * @return int <0 if KO, 0=no, 1=yes - */ - function getVentilExportCompta() - { - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees - $ventilExportCompta = 0 ; - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if (! empty($this->lines[$i]->export_compta) && ! empty($this->lines[$i]->code_ventilation)) - { - $ventilExportCompta++; - } - } - - if ($ventilExportCompta <> 0) - { - return 1; - } - else - { - return 0; - } - } - - - /** - * Return if an invoice can be deleted - * Rule is: - * If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can - * If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule - * If invoice is draft and ha a temporary ref -> yes - * - * @return int <0 if KO, 0=no, 1=yes - */ - function is_erasable() - { - global $conf; - - if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1; - if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0; - - // on verifie si la facture est en numerotation provisoire - $facref = substr($this->ref, 1, 4); - - // If not a draft invoice and not temporary invoice - if ($facref != 'PROV') - { - $maxfacnumber = $this->getNextNumRef($this->client,'last'); - $ventilExportCompta = $this->getVentilExportCompta(); - // If there is no invoice into the reset range and not already dispatched, we can delete - if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; - // If invoice to delete is last one and not already dispatched, we can delete - if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1; - } - else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire - { - return 1; - } - - return 0; - } - - - /** - * Return list of invoices (eventually filtered on a user) into an array - * - * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) - * @param int $draft 0=not draft, 1=draft - * @param User $excluser Objet user to exclude - * @param int $socid Id third pary - * @param int $limit For pagination - * @param int $offset For pagination - * @param string $sortfield Sort criteria - * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK - */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') - { - global $conf,$user; - - $ga = array(); - - $sql = "SELECT s.rowid, s.nom as name, s.client,"; - $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } - if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($draft) $sql.= " AND f.fk_statut = 0"; - if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; - $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit,$offset); - - $result=$this->db->query($sql); - if ($result) - { - $numc = $this->db->num_rows($result); - if ($numc) - { - $i = 0; - while ($i < $numc) - { - $obj = $this->db->fetch_object($result); - - if ($shortlist == 1) - { - $ga[$obj->fid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->fid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; - } - $i++; - } - } - return $ga; - } - else - { - dol_print_error($this->db); - return -1; - } - } - - - /** - * Renvoi liste des factures remplacables - * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee - * - * @param int $socid Id societe - * @return array Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) - */ - function list_replacable_invoices($socid=0) - { - global $conf; - - $return = array(); - - $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut,"; - $sql.= " ff.rowid as rowidnext"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source"; - $sql.= " WHERE (f.fk_statut = 1 OR (f.fk_statut = 3 AND f.close_code = 'abandon'))"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.paye = 0"; // Pas classee payee completement - $sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait - $sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement - if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; - $sql.= " ORDER BY f.facnumber"; - - dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $return[$obj->rowid]=array( 'id' => $obj->rowid, - 'ref' => $obj->facnumber, - 'status' => $obj->fk_statut); - } - //print_r($return); - return $return; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - - - /** - * Renvoi liste des factures qualifiables pour correction par avoir - * Les factures qui respectent les regles suivantes sont retournees: - * (validee + paiement en cours) ou classee (payee completement ou payee partiellement) + pas deja remplacee + pas deja avoir - * - * @param int $socid Id societe - * @return array Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) - */ - function list_qualified_avoir_invoices($socid=0) - { - global $conf; - - $return = array(); - - $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut, f.type, f.paye, pf.fk_paiement"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; - // $sql.= " WHERE f.fk_statut >= 1"; - // $sql.= " AND (f.paye = 1"; // Classee payee completement - // $sql.= " OR f.close_code IS NOT NULL)"; // Classee payee partiellement - $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement - $sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir - if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; - $sql.= " ORDER BY f.facnumber"; - - dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $qualified=0; - if ($obj->fk_statut == 1) $qualified=1; - if ($obj->fk_statut == 2) $qualified=1; - if ($qualified) - { - //$ref=$obj->facnumber; - $paymentornot=($obj->fk_paiement?1:0); - $return[$obj->rowid]=array('ref'=>$obj->facnumber,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot); - } - } - - return $return; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - - - /** - * Create a withdrawal request for a standing order - * - * @param User $user User asking standing order - * @return int <0 if KO, >0 if OK - */ - function demande_prelevement($user) - { - dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); - - if ($this->statut > 0 && $this->paye == 0) - { - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; - $bac = new CompanyBankAccount($this->db); - $bac->fetch(0,$this->socid); - - $sql = 'SELECT count(*)'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; - $sql.= ' WHERE fk_facture = '.$this->id; - $sql.= ' AND traite = 0'; - - dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $row = $this->db->fetch_row($resql); - if ($row[0] == 0) - { - $now=dol_now(); + * @return int < 0 if KO, > 0 if OK + */ + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + global $mysoc; + + dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG); + + if ($this->brouillon) + { + $this->db->begin(); + + // Clean parameters + if (empty($qty)) $qty=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + if (empty($special_code) || $special_code == 3) $special_code=0; + + $remise_percent = price2num($remise_percent); + $qty = price2num($qty); + $pu = price2num($pu); + $pa_ht = price2num($pa_ht); + $txtva = price2num($txtva); + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); + + // Check parameters + if ($type < 0) return -1; + + // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + $total_localtax1=$tabprice[9]; + $total_localtax2=$tabprice[10]; + $pu_ht = $tabprice[3]; + $pu_tva = $tabprice[4]; + $pu_ttc = $tabprice[5]; + + // Update line into database + $this->line=new FactureLigne($this->db); + + // Stock previous line records + $staticline=new FactureLigne($this->db); + $staticline->fetch($rowid); + $this->line->oldline = $staticline; + + // Reorder if fk_parent_line change + if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) + { + $rangmax = $this->line_max($fk_parent_line); + $this->line->rang = $rangmax + 1; + } + + $this->line->rowid = $rowid; + $this->line->label = $label; + $this->line->desc = $desc; + $this->line->qty = ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->tva_tx = $txtva; + $this->line->localtax1_tx = $txlocaltax1; + $this->line->localtax2_tx = $txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->remise_percent = $remise_percent; + $this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->date_start = $date_start; + $this->line->date_end = $date_end; + $this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + $this->line->info_bits = $info_bits; + $this->line->special_code = $special_code; + $this->line->product_type = $type; + $this->line->fk_parent_line = $fk_parent_line; + $this->line->skip_update_total = $skip_update_total; + + // infos marge + $this->line->fk_fournprice = $fk_fournprice; + $this->line->pa_ht = $pa_ht; + + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + + $result=$this->line->update(); + if ($result > 0) + { + // Reorder if child line + if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); + + // Mise a jour info denormalisees au niveau facture + $this->update_price(1); + $this->db->commit(); + return $result; + } + else + { + $this->error=$this->line->error; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error="Invoice statut makes operation forbidden"; + return -2; + } + } + + /** + * Delete line in database + * + * @param int $rowid Id of line to delete + * @return int <0 if KO, >0 if OK + */ + function deleteline($rowid) + { + global $langs, $conf; + + dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); + + if (! $this->brouillon) + { + $this->error='ErrorBadStatus'; + return -1; + } + + $this->db->begin(); + + // Libere remise liee a ligne de facture + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture_line = NULL'; + $sql.= ' WHERE fk_facture_line = '.$rowid; + + dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); + $result = $this->db->query($sql); + if (! $result) + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + + $line=new FactureLigne($this->db); + + // For triggers + $line->fetch($rowid); + + if ($line->delete() > 0) + { + $result=$this->update_price(1); + + if ($result > 0) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + $this->error=$this->db->lasterror(); + return -1; + } + } + else + { + $this->db->rollback(); + $this->error=$line->error; + return -1; + } + } + + /** + * Set percent discount + * + * @param User $user User that set discount + * @param double $remise Discount + * @return int <0 if ko, >0 if ok + */ + function set_remise($user, $remise) + { + // Clean parameters + if (empty($remise)) $remise=0; + + if ($user->rights->facture->creer) + { + $remise=price2num($remise); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET remise_percent = '.$remise; + $sql.= ' WHERE rowid = '.$this->id; + $sql.= ' AND fk_statut = 0'; + + if ($this->db->query($sql)) + { + $this->remise_percent = $remise; + $this->update_price(1); + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + } + + + /** + * Set absolute discount + * + * @param User $user User that set discount + * @param double $remise Discount + * @return int <0 if KO, >0 if OK + */ + function set_remise_absolue($user, $remise) + { + if (empty($remise)) $remise=0; + + if ($user->rights->facture->creer) + { + $remise=price2num($remise); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET remise_absolue = '.$remise; + $sql.= ' WHERE rowid = '.$this->id; + $sql.= ' AND fk_statut = 0'; + + dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); + + if ($this->db->query($sql)) + { + $this->remise_absolue = $remise; + $this->update_price(1); + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + } + + /** + * Return list of payments + * + * @param string $filtertype 1 to filter on type of payment == 'PRE' + * @return array Array with list of payments + */ + function getListOfPayments($filtertype='') + { + $retarray=array(); + + $table='paiement_facture'; + $table2='paiement'; + $field='fk_facture'; + $field2='fk_paiement'; + if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') + { + $table='paiementfourn_facturefourn'; + $table2='paiementfourn'; + $field='fk_facturefourn'; + $field2='fk_paiementfourn'; + } + + $sql = 'SELECT pf.amount, p.fk_paiement, p.datep, t.code'; + $sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t'; + $sql.= ' WHERE pf.'.$field.' = '.$this->id; + $sql.= ' AND pf.'.$field2.' = p.rowid'; + $sql.= ' AND p.fk_paiement = t.id'; + if ($filtertype) $sql.=" AND t.code='PRE'"; + + dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep); + $i++; + } + $this->db->free($resql); + return $retarray; + } + else + { + $this->error=$this->db->lasterror(); + dol_print_error($this->db); + return array(); + } + } + + + /** + * Return amount (with tax) of all credit notes and deposits invoices used by invoice + * + * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + */ + function getSumCreditNotesUsed() + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getSumCreditNotesUsed($this); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } + + /** + * Return amount (with tax) of all deposits invoices used by invoice + * + * @return int <0 if KO, Sum of deposits amount otherwise + */ + function getSumDepositsUsed() + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getSumDepositsUsed($this); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } + + /** + * Return next reference of customer invoice not already used (or last reference) + * according to numbering module defined into constant FACTURE_ADDON + * + * @param Society $soc object company + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + function getNextNumRef($soc,$mode='next') + { + global $conf, $db, $langs; + $langs->load("bills"); + + // Clean parameters (if not defined or using deprecated value) + if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre'; + else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; + else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; + + $mybool=false; + + $file = $conf->global->FACTURE_ADDON.".php"; + $classname = $conf->global->FACTURE_ADDON; + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot."/core/modules/facture/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + + // For compatibility + if (! $mybool) + { + $file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php"; + $classname = "mod_facture_".$conf->global->FACTURE_ADDON; + $classname = preg_replace('/\-.*$/','',$classname); + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot."/core/modules/facture/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + } + //print "xx".$mybool.$dir.$file."-".$classname; + + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = ""; + $numref = $obj->getNumRef($soc,$this,$mode); + + if ($numref != "") + { + return $numref; + } + else + { + //dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); + return false; + } + } + + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + function info($id) + { + $sql = 'SELECT c.rowid, datec, date_valid as datev, tms as datem,'; + $sql.= ' fk_user_author, fk_user_valid'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as c'; + $sql.= ' WHERE c.rowid = '.$id; + + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + if ($obj->fk_user_valid) + { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); // Should be in log table + } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } + + /** + * Renvoi si les lignes de facture sont ventilees et/ou exportees en compta + * + * @return int <0 if KO, 0=no, 1=yes + */ + function getVentilExportCompta() + { + // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + $ventilExportCompta = 0 ; + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if (! empty($this->lines[$i]->export_compta) && ! empty($this->lines[$i]->code_ventilation)) + { + $ventilExportCompta++; + } + } + + if ($ventilExportCompta <> 0) + { + return 1; + } + else + { + return 0; + } + } + + + /** + * Return if an invoice can be deleted + * Rule is: + * If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can + * If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule + * If invoice is draft and ha a temporary ref -> yes + * + * @return int <0 if KO, 0=no, 1=yes + */ + function is_erasable() + { + global $conf; + + if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1; + if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0; + + // on verifie si la facture est en numerotation provisoire + $facref = substr($this->ref, 1, 4); + + // If not a draft invoice and not temporary invoice + if ($facref != 'PROV') + { + $maxfacnumber = $this->getNextNumRef($this->client,'last'); + $ventilExportCompta = $this->getVentilExportCompta(); + // If there is no invoice into the reset range and not already dispatched, we can delete + if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; + // If invoice to delete is last one and not already dispatched, we can delete + if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1; + } + else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire + { + return 1; + } + + return 0; + } + + + /** + * Return list of invoices (eventually filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Objet user to exclude + * @param int $socid Id third pary + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return int -1 if KO, array with result if OK + */ + function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + { + global $conf,$user; + + $ga = array(); + + $sql = "SELECT s.rowid, s.nom as name, s.client,"; + $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } + if ($socid) $sql.= " AND s.rowid = ".$socid; + if ($draft) $sql.= " AND f.fk_statut = 0"; + if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; + $sql.= $this->db->order($sortfield,$sortorder); + $sql.= $this->db->plimit($limit,$offset); + + $result=$this->db->query($sql); + if ($result) + { + $numc = $this->db->num_rows($result); + if ($numc) + { + $i = 0; + while ($i < $numc) + { + $obj = $this->db->fetch_object($result); + + if ($shortlist == 1) + { + $ga[$obj->fid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->fid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; + } + $i++; + } + } + return $ga; + } + else + { + dol_print_error($this->db); + return -1; + } + } + + + /** + * Renvoi liste des factures remplacables + * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee + * + * @param int $socid Id societe + * @return array Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + */ + function list_replacable_invoices($socid=0) + { + global $conf; + + $return = array(); + + $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut,"; + $sql.= " ff.rowid as rowidnext"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source"; + $sql.= " WHERE (f.fk_statut = 1 OR (f.fk_statut = 3 AND f.close_code = 'abandon'))"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.paye = 0"; // Pas classee payee completement + $sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait + $sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement + if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; + $sql.= " ORDER BY f.facnumber"; + + dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $return[$obj->rowid]=array( 'id' => $obj->rowid, + 'ref' => $obj->facnumber, + 'status' => $obj->fk_statut); + } + //print_r($return); + return $return; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + + + /** + * Renvoi liste des factures qualifiables pour correction par avoir + * Les factures qui respectent les regles suivantes sont retournees: + * (validee + paiement en cours) ou classee (payee completement ou payee partiellement) + pas deja remplacee + pas deja avoir + * + * @param int $socid Id societe + * @return array Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) + */ + function list_qualified_avoir_invoices($socid=0) + { + global $conf; + + $return = array(); + + $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut, f.type, f.paye, pf.fk_paiement"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; + // $sql.= " WHERE f.fk_statut >= 1"; + // $sql.= " AND (f.paye = 1"; // Classee payee completement + // $sql.= " OR f.close_code IS NOT NULL)"; // Classee payee partiellement + $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement + $sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir + if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; + $sql.= " ORDER BY f.facnumber"; + + dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $qualified=0; + if ($obj->fk_statut == 1) $qualified=1; + if ($obj->fk_statut == 2) $qualified=1; + if ($qualified) + { + //$ref=$obj->facnumber; + $paymentornot=($obj->fk_paiement?1:0); + $return[$obj->rowid]=array('ref'=>$obj->facnumber,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot); + } + } + + return $return; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + + + /** + * Create a withdrawal request for a standing order + * + * @param User $user User asking standing order + * @return int <0 if KO, >0 if OK + */ + function demande_prelevement($user) + { + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); + + if ($this->statut > 0 && $this->paye == 0) + { + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $bac = new CompanyBankAccount($this->db); + $bac->fetch(0,$this->socid); + + $sql = 'SELECT count(*)'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; + $sql.= ' WHERE fk_facture = '.$this->id; + $sql.= ' AND traite = 0'; + + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $row = $this->db->fetch_row($resql); + if ($row[0] == 0) + { + $now=dol_now(); $totalpaye = $this->getSommePaiement(); $totalcreditnotes = $this->getSumCreditNotesUsed(); @@ -2842,7 +2846,7 @@ class Facture extends CommonInvoice return 1; } else - { + { $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::demandeprelevement Erreur'); return -1; @@ -2869,344 +2873,344 @@ class Facture extends CommonInvoice } } - /** - * Supprime une demande de prelevement - * - * @param Use $user utilisateur creant la demande - * @param int $did id de la demande a supprimer - * @return int <0 if OK, >0 if KO - */ - function demande_prelevement_delete($user, $did) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; - $sql .= ' WHERE rowid = '.$did; - $sql .= ' AND traite = 0'; - if ( $this->db->query($sql) ) - { - return 0; - } - else - { - $this->error=$this->db->lasterror(); - dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); - return -1; - } - } + /** + * Supprime une demande de prelevement + * + * @param Use $user utilisateur creant la demande + * @param int $did id de la demande a supprimer + * @return int <0 if OK, >0 if KO + */ + function demande_prelevement_delete($user, $did) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; + $sql .= ' WHERE rowid = '.$did; + $sql .= ' AND traite = 0'; + if ( $this->db->query($sql) ) + { + return 0; + } + else + { + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); + return -1; + } + } - /** - * Load indicators for dashboard (this->nbtodo and this->nbtodolate) - * - * @param User $user Object user - * @return int <0 if KO, >0 if OK - */ - function load_board($user) - { - global $conf, $user; + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @return int <0 if KO, >0 if OK + */ + function load_board($user) + { + global $conf, $user; - $now=dol_now(); + $now=dol_now(); - $this->nbtodo=$this->nbtodolate=0; - $clause = " WHERE"; + $this->nbtodo=$this->nbtodolate=0; + $clause = " WHERE"; - $sql = "SELECT f.rowid, f.date_lim_reglement as datefin"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->societe_id) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON f.fk_soc = sc.fk_soc"; - $sql.= " WHERE sc.fk_user = " .$user->id; - $clause = " AND"; - } - $sql.= $clause." f.paye=0"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut = 1"; - if ($user->societe_id) $sql.= " AND f.fk_soc = ".$user->societe_id; + $sql = "SELECT f.rowid, f.date_lim_reglement as datefin"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON f.fk_soc = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = " AND"; + } + $sql.= $clause." f.paye=0"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.fk_statut = 1"; + if ($user->societe_id) $sql.= " AND f.fk_soc = ".$user->societe_id; - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $this->nbtodo++; - if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++; - } - return 1; - } - else - { - dol_print_error($this->db); - $this->error=$this->db->error(); - return -1; - } - } + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nbtodo++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++; + } + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } - /* gestion des contacts d'une facture */ + /* gestion des contacts d'une facture */ - /** - * Retourne id des contacts clients de facturation - * - * @return array Liste des id contacts facturation - */ - function getIdBillingContact() - { - return $this->getIdContact('external','BILLING'); - } + /** + * Retourne id des contacts clients de facturation + * + * @return array Liste des id contacts facturation + */ + function getIdBillingContact() + { + return $this->getIdContact('external','BILLING'); + } - /** - * Retourne id des contacts clients de livraison - * - * @return array Liste des id contacts livraison - */ - function getIdShippingContact() - { - return $this->getIdContact('external','SHIPPING'); - } + /** + * Retourne id des contacts clients de livraison + * + * @return array Liste des id contacts livraison + */ + function getIdShippingContact() + { + return $this->getIdContact('external','SHIPPING'); + } - /** - * Initialise an instance with random values. - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. - * - * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void - */ - function initAsSpecimen($option='') - { - global $user,$langs,$conf; + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return void + */ + function initAsSpecimen($option='') + { + global $user,$langs,$conf; - $now=dol_now(); - $arraynow=dol_getdate($now); - $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); + $now=dol_now(); + $arraynow=dol_getdate($now); + $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); - $prodids = array(); - $sql = "SELECT rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE entity IN (".getEntity('product', 1).")"; - $resql = $this->db->query($sql); - if ($resql) - { - $num_prods = $this->db->num_rows($resql); - $i = 0; - while ($i < $num_prods) - { - $i++; - $row = $this->db->fetch_row($resql); - $prodids[$i] = $row[0]; - } - } + $prodids = array(); + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."product"; + $sql.= " WHERE entity IN (".getEntity('product', 1).")"; + $resql = $this->db->query($sql); + if ($resql) + { + $num_prods = $this->db->num_rows($resql); + $i = 0; + while ($i < $num_prods) + { + $i++; + $row = $this->db->fetch_row($resql); + $prodids[$i] = $row[0]; + } + } - // Initialize parameters - $this->id=0; - $this->ref = 'SPECIMEN'; - $this->specimen=1; - $this->socid = 1; - $this->date = $nownotime; - $this->date_lim_reglement = $nownotime + 3600 * 24 *30; - $this->cond_reglement_id = 1; - $this->cond_reglement_code = 'RECEP'; - $this->date_lim_reglement=$this->calculate_date_lim_reglement(); - $this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR - $this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR - $this->note_public='This is a comment (public)'; - $this->note_private='This is a comment (private)'; - $this->note='This is a comment (private)'; + // Initialize parameters + $this->id=0; + $this->ref = 'SPECIMEN'; + $this->specimen=1; + $this->socid = 1; + $this->date = $nownotime; + $this->date_lim_reglement = $nownotime + 3600 * 24 *30; + $this->cond_reglement_id = 1; + $this->cond_reglement_code = 'RECEP'; + $this->date_lim_reglement=$this->calculate_date_lim_reglement(); + $this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR + $this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR + $this->note_public='This is a comment (public)'; + $this->note_private='This is a comment (private)'; + $this->note='This is a comment (private)'; - if (empty($option) || $option != 'nolines') - { - // Lines - $nbp = 5; - $xnbp = 0; - while ($xnbp < $nbp) - { - $line=new FactureLigne($this->db); - $line->desc=$langs->trans("Description")." ".$xnbp; - $line->qty=1; - $line->subprice=100; - $line->tva_tx=19.6; - $line->localtax1_tx=0; - $line->localtax2_tx=0; - $line->remise_percent=0; - if ($xnbp == 1) // Qty is negative (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->qty=-1; - $line->total_ht=-100; - $line->total_ttc=-119.6; - $line->total_tva=-19.6; - } - else if ($xnbp == 2) // UP is negative (free line) - { - $line->subprice=-100; - $line->total_ht=-100; - $line->total_ttc=-119.6; - $line->total_tva=-19.6; - $line->remise_percent=0; - } - else if ($xnbp == 3) // Discount is 50% (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->total_ht=50; - $line->total_ttc=59.8; - $line->total_tva=9.8; - $line->remise_percent=50; - } - else // (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->total_ht=100; - $line->total_ttc=119.6; - $line->total_tva=19.6; - $line->remise_percent=00; - } + if (empty($option) || $option != 'nolines') + { + // Lines + $nbp = 5; + $xnbp = 0; + while ($xnbp < $nbp) + { + $line=new FactureLigne($this->db); + $line->desc=$langs->trans("Description")." ".$xnbp; + $line->qty=1; + $line->subprice=100; + $line->tva_tx=19.6; + $line->localtax1_tx=0; + $line->localtax2_tx=0; + $line->remise_percent=0; + if ($xnbp == 1) // Qty is negative (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->qty=-1; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + } + else if ($xnbp == 2) // UP is negative (free line) + { + $line->subprice=-100; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + $line->remise_percent=0; + } + else if ($xnbp == 3) // Discount is 50% (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->total_ht=50; + $line->total_ttc=59.8; + $line->total_tva=9.8; + $line->remise_percent=50; + } + else // (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->total_ht=100; + $line->total_ttc=119.6; + $line->total_tva=19.6; + $line->remise_percent=00; + } - $this->lines[$xnbp]=$line; - $xnbp++; + $this->lines[$xnbp]=$line; + $xnbp++; - $this->total_ht += $line->total_ht; - $this->total_tva += $line->total_tva; - $this->total_ttc += $line->total_ttc; - } - $this->revenuestamp = 0; + $this->total_ht += $line->total_ht; + $this->total_tva += $line->total_tva; + $this->total_ttc += $line->total_ttc; + } + $this->revenuestamp = 0; - // Add a line "offered" - $line=new FactureLigne($this->db); - $line->desc=$langs->trans("Description")." (offered line)"; - $line->qty=1; - $line->subprice=100; - $line->tva_tx=19.6; - $line->localtax1_tx=0; - $line->localtax2_tx=0; - $line->remise_percent=100; - $line->total_ht=0; - $line->total_ttc=0; // 90 * 1.196 - $line->total_tva=0; - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; + // Add a line "offered" + $line=new FactureLigne($this->db); + $line->desc=$langs->trans("Description")." (offered line)"; + $line->qty=1; + $line->subprice=100; + $line->tva_tx=19.6; + $line->localtax1_tx=0; + $line->localtax2_tx=0; + $line->remise_percent=100; + $line->total_ht=0; + $line->total_ttc=0; // 90 * 1.196 + $line->total_tva=0; + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; - $this->lines[$xnbp]=$line; - $xnbp++; - } - } + $this->lines[$xnbp]=$line; + $xnbp++; + } + } - /** - * Load indicators for dashboard (this->nbtodo and this->nbtodolate) - * - * @return int <0 if KO, >0 if OK - */ - function load_state_board() - { - global $conf, $user; + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @return int <0 if KO, >0 if OK + */ + function load_state_board() + { + global $conf, $user; - $this->nb=array(); + $this->nb=array(); - $clause = "WHERE"; + $clause = "WHERE"; - $sql = "SELECT count(f.rowid) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->societe_id) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; - $sql.= " WHERE sc.fk_user = " .$user->id; - $clause = "AND"; - } - $sql.= " ".$clause." f.entity = ".$conf->entity; + $sql = "SELECT count(f.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = "AND"; + } + $sql.= " ".$clause." f.entity = ".$conf->entity; - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $this->nb["invoices"]=$obj->nb; - } + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nb["invoices"]=$obj->nb; + } $this->db->free($resql); - return 1; - } - else - { - dol_print_error($this->db); - $this->error=$this->db->error(); - return -1; - } - } + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } - /** - * Create an array of invoice lines - * - * @return int >0 if OK, <0 if KO - */ - function getLinesArray() - { - $sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,'; - $sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,'; - $sql.= ' l.remise_percent, l.subprice, l.info_bits, l.rang, l.special_code, l.fk_parent_line,'; - $sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; - $sql.= ' l.date_start, l.date_end,'; - $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; - $sql.= ' p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; - $sql.= ' WHERE l.fk_facture = '.$this->id; - $sql.= ' ORDER BY l.rang ASC, l.rowid'; + /** + * Create an array of invoice lines + * + * @return int >0 if OK, <0 if KO + */ + function getLinesArray() + { + $sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,'; + $sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,'; + $sql.= ' l.remise_percent, l.remise_amount, l.subprice, l.info_bits, l.rang, l.special_code, l.fk_parent_line,'; + $sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' l.date_start, l.date_end,'; + $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; + $sql.= ' p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; + $sql.= ' WHERE l.fk_facture = '.$this->id; + $sql.= ' ORDER BY l.rang ASC, l.rowid'; - dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; + dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); - $this->lines[$i] = new FactureLigne($this->db); - $this->lines[$i]->id = $obj->rowid; - $this->lines[$i]->label = $obj->custom_label; // deprecated - $this->lines[$i]->description = $obj->description; - $this->lines[$i]->fk_product = $obj->fk_product; - $this->lines[$i]->ref = $obj->product_ref; - $this->lines[$i]->product_label = $obj->product_label; - $this->lines[$i]->product_desc = $obj->product_desc; - $this->lines[$i]->fk_product_type = $obj->fk_product_type; - $this->lines[$i]->product_type = $obj->product_type; - $this->lines[$i]->qty = $obj->qty; - $this->lines[$i]->subprice = $obj->subprice; - $this->lines[$i]->fk_remise_except = $obj->fk_remise_except; - $this->lines[$i]->remise_percent = $obj->remise_percent; - $this->lines[$i]->tva_tx = $obj->tva_tx; - $this->lines[$i]->info_bits = $obj->info_bits; - $this->lines[$i]->total_ht = $obj->total_ht; - $this->lines[$i]->total_tva = $obj->total_tva; - $this->lines[$i]->total_ttc = $obj->total_ttc; - $this->lines[$i]->fk_parent_line = $obj->fk_parent_line; - $this->lines[$i]->special_code = $obj->special_code; - $this->lines[$i]->rang = $obj->rang; - $this->lines[$i]->date_start = $this->db->jdate($obj->date_start); - $this->lines[$i]->date_end = $this->db->jdate($obj->date_end); - $this->lines[$i]->fk_fournprice = $obj->fk_fournprice; - $marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht); - $this->lines[$i]->pa_ht = $marginInfos[0]; - $this->lines[$i]->marge_tx = $marginInfos[1]; - $this->lines[$i]->marque_tx = $marginInfos[2]; + $this->lines[$i] = new FactureLigne($this->db); + $this->lines[$i]->id = $obj->rowid; + $this->lines[$i]->label = $obj->custom_label; // deprecated + $this->lines[$i]->description = $obj->description; + $this->lines[$i]->fk_product = $obj->fk_product; + $this->lines[$i]->ref = $obj->product_ref; + $this->lines[$i]->product_label = $obj->product_label; + $this->lines[$i]->product_desc = $obj->product_desc; + $this->lines[$i]->fk_product_type = $obj->fk_product_type; + $this->lines[$i]->product_type = $obj->product_type; + $this->lines[$i]->qty = $obj->qty; + $this->lines[$i]->subprice = $obj->subprice; + $this->lines[$i]->fk_remise_except = $obj->fk_remise_except; + $this->lines[$i]->remise_percent = $obj->remise_percent; + $this->lines[$i]->tva_tx = $obj->tva_tx; + $this->lines[$i]->info_bits = $obj->info_bits; + $this->lines[$i]->total_ht = $obj->total_ht; + $this->lines[$i]->total_tva = $obj->total_tva; + $this->lines[$i]->total_ttc = $obj->total_ttc; + $this->lines[$i]->fk_parent_line = $obj->fk_parent_line; + $this->lines[$i]->special_code = $obj->special_code; + $this->lines[$i]->rang = $obj->rang; + $this->lines[$i]->date_start = $this->db->jdate($obj->date_start); + $this->lines[$i]->date_end = $this->db->jdate($obj->date_end); + $this->lines[$i]->fk_fournprice = $obj->fk_fournprice; + $marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht); + $this->lines[$i]->pa_ht = $marginInfos[0]; + $this->lines[$i]->marge_tx = $marginInfos[1]; + $this->lines[$i]->marque_tx = $marginInfos[2]; - $i++; - } - $this->db->free($resql); + $i++; + } + $this->db->free($resql); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } } @@ -3219,382 +3223,387 @@ class Facture extends CommonInvoice */ class FactureLigne extends CommonInvoiceLine { - var $db; - var $error; + var $db; + var $error; public $element='facturedet'; public $table_element='facturedet'; - var $oldline; + var $oldline; - //! From llx_facturedet - var $rowid; - //! Id facture - var $fk_facture; - //! Id parent line - var $fk_parent_line; - var $label; // deprecated - //! Description ligne - var $desc; - var $fk_product; // Id of predefined product - var $product_type = 0; // Type 0 = product, 1 = Service + //! From llx_facturedet + var $rowid; + //! Id facture + var $fk_facture; + //! Id parent line + var $fk_parent_line; + var $label; // deprecated + //! Description ligne + var $desc; + var $fk_product; // Id of predefined product + var $product_type = 0; // Type 0 = product, 1 = Service - var $qty; // Quantity (example 2) - var $tva_tx; // Taux tva produit/service (example 19.6) - var $localtax1_tx; // Local tax 1 - var $localtax2_tx; // Local tax 2 - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $subprice; // P.U. HT (example 100) - var $remise_percent; // % de la remise ligne (example 20%) - var $fk_remise_except; // Link to line into llx_remise_except - var $rang = 0; + var $qty; // Quantity (example 2) + var $tva_tx; // Taux tva produit/service (example 19.6) + var $localtax1_tx; // Local tax 1 + var $localtax2_tx; // Local tax 2 + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type + var $subprice; // P.U. HT (example 100) + var $remise_percent; // % de la remise ligne (example 20%) + var $remise_amount; // montant de la remise ligne + var $fk_remise_except; // Link to line into llx_remise_except + var $rang = 0; - var $fk_fournprice; - var $pa_ht; - var $marge_tx; - var $marque_tx; + var $fk_fournprice; + var $pa_ht; + var $marge_tx; + var $marque_tx; - var $info_bits = 0; // Liste d'options cumulables: - // Bit 0: 0 si TVA normal - 1 si TVA NPR - // Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + var $info_bits = 0; // Liste d'options cumulables: + // Bit 0: 0 si TVA normal - 1 si TVA NPR + // Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) - var $special_code; // Liste d'options non cumulabels: - // 1: frais de port - // 2: ecotaxe - // 3: ?? + var $special_code; // Liste d'options non cumulabels: + // 1: frais de port + // 2: ecotaxe + // 3: ?? - var $origin; - var $origin_id; + var $origin; + var $origin_id; - //! Total HT de la ligne toute quantite et incluant la remise ligne - var $total_ht; - //! Total TVA de la ligne toute quantite et incluant la remise ligne - var $total_tva; - var $total_localtax1; //Total Local tax 1 de la ligne - var $total_localtax2; //Total Local tax 2 de la ligne - //! Total TTC de la ligne toute quantite et incluant la remise ligne - var $total_ttc; + //! Total HT de la ligne toute quantite et incluant la remise ligne + var $total_ht; + //! Total TVA de la ligne toute quantite et incluant la remise ligne + var $total_tva; + var $total_localtax1; //Total Local tax 1 de la ligne + var $total_localtax2; //Total Local tax 2 de la ligne + //! Total TTC de la ligne toute quantite et incluant la remise ligne + var $total_ttc; - var $fk_code_ventilation = 0; + var $fk_code_ventilation = 0; - var $date_start; - var $date_end; + var $date_start; + var $date_end; - // Ne plus utiliser - //var $price; // P.U. HT apres remise % de ligne (exemple 80) - //var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) + // Ne plus utiliser + //var $price; // P.U. HT apres remise % de ligne (exemple 80) + //var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) - // From llx_product - var $ref; // Product ref (deprecated) - var $product_ref; // Product ref - var $libelle; // Product label (deprecated) - var $product_label; // Product label - var $product_desc; // Description produit + // From llx_product + var $ref; // Product ref (deprecated) + var $product_ref; // Product ref + var $libelle; // Product label (deprecated) + var $product_label; // Product label + var $product_desc; // Description produit - var $skip_update_total; // Skip update price total for special lines + var $skip_update_total; // Skip update price total for special lines - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + } - /** - * Load invoice line from database - * - * @param int $rowid id of invoice line to get - * @return int <0 if KO, >0 if OK - */ - function fetch($rowid) - { - $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,'; - $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,'; - $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; - $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; - $sql.= ' fd.fk_code_ventilation,'; - $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; - $sql.= ' WHERE fd.rowid = '.$rowid; + /** + * Load invoice line from database + * + * @param int $rowid id of invoice line to get + * @return int <0 if KO, >0 if OK + */ + function fetch($rowid) + { + $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,'; + $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.remise_amount, fd.fk_remise_except, fd.subprice,'; + $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; + $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; + $sql.= ' fd.fk_code_ventilation,'; + $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; + $sql.= ' WHERE fd.rowid = '.$rowid; - $result = $this->db->query($sql); - if ($result) - { - $objp = $this->db->fetch_object($result); + $result = $this->db->query($sql); + if ($result) + { + $objp = $this->db->fetch_object($result); - $this->rowid = $objp->rowid; - $this->fk_facture = $objp->fk_facture; - $this->fk_parent_line = $objp->fk_parent_line; - $this->label = $objp->custom_label; - $this->desc = $objp->description; - $this->qty = $objp->qty; - $this->subprice = $objp->subprice; - $this->tva_tx = $objp->tva_tx; - $this->localtax1_tx = $objp->localtax1_tx; - $this->localtax2_tx = $objp->localtax2_tx; - $this->remise_percent = $objp->remise_percent; - $this->fk_remise_except = $objp->fk_remise_except; - $this->fk_product = $objp->fk_product; - $this->product_type = $objp->product_type; - $this->date_start = $this->db->jdate($objp->date_start); - $this->date_end = $this->db->jdate($objp->date_end); - $this->info_bits = $objp->info_bits; - $this->special_code = $objp->special_code; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_localtax1 = $objp->total_localtax1; - $this->total_localtax2 = $objp->total_localtax2; - $this->total_ttc = $objp->total_ttc; - $this->fk_code_ventilation = $objp->fk_code_ventilation; - $this->rang = $objp->rang; - $this->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); - $this->pa_ht = $marginInfos[0]; - $this->marge_tx = $marginInfos[1]; - $this->marque_tx = $marginInfos[2]; + $this->rowid = $objp->rowid; + $this->fk_facture = $objp->fk_facture; + $this->fk_parent_line = $objp->fk_parent_line; + $this->label = $objp->custom_label; + $this->desc = $objp->description; + $this->qty = $objp->qty; + $this->subprice = $objp->subprice; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->remise_percent = $objp->remise_percent; + $this->remise_amount = $objp->remise_amount; + $this->fk_remise_except = $objp->fk_remise_except; + $this->fk_product = $objp->fk_product; + $this->product_type = $objp->product_type; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); + $this->info_bits = $objp->info_bits; + $this->special_code = $objp->special_code; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_localtax1 = $objp->total_localtax1; + $this->total_localtax2 = $objp->total_localtax2; + $this->total_ttc = $objp->total_ttc; + $this->fk_code_ventilation = $objp->fk_code_ventilation; + $this->rang = $objp->rang; + $this->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); + $this->pa_ht = $marginInfos[0]; + $this->marge_tx = $marginInfos[1]; + $this->marque_tx = $marginInfos[2]; - $this->ref = $objp->product_ref; // deprecated - $this->product_ref = $objp->product_ref; - $this->libelle = $objp->product_libelle; // deprecated - $this->product_label = $objp->product_libelle; - $this->product_desc = $objp->product_desc; + $this->ref = $objp->product_ref; // deprecated + $this->product_ref = $objp->product_ref; + $this->libelle = $objp->product_libelle; // deprecated + $this->product_label = $objp->product_libelle; + $this->product_desc = $objp->product_desc; - $this->db->free($result); - } - else - { - dol_print_error($this->db); - } - } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } - /** - * Insert line into database - * - * @param int $notrigger 1 no triggers - * @return int <0 if KO, >0 if OK - */ - function insert($notrigger=0) - { - global $langs,$user,$conf; + /** + * Insert line into database + * + * @param int $notrigger 1 no triggers + * @return int <0 if KO, >0 if OK + */ + function insert($notrigger=0) + { + global $langs,$user,$conf; - $error=0; + $error=0; - dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG); + dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG); - // Clean parameters - $this->desc=trim($this->desc); - if (empty($this->tva_tx)) $this->tva_tx=0; - if (empty($this->localtax1_tx)) $this->localtax1_tx=0; - if (empty($this->localtax2_tx)) $this->localtax2_tx=0; - if (empty($this->localtax1_type)) $this->localtax1_type=0; - if (empty($this->localtax2_type)) $this->localtax2_type=0; - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; - if (empty($this->rang)) $this->rang=0; - if (empty($this->remise_percent)) $this->remise_percent=0; - if (empty($this->info_bits)) $this->info_bits=0; - if (empty($this->subprice)) $this->subprice=0; - if (empty($this->special_code)) $this->special_code=0; - if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + // Clean parameters + $this->desc=trim($this->desc); + if (empty($this->tva_tx)) $this->tva_tx=0; + if (empty($this->localtax1_tx)) $this->localtax1_tx=0; + if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; + if (empty($this->rang)) $this->rang=0; + if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->remise_amount)) $this->remise_amount=0; + if (empty($this->info_bits)) $this->info_bits=0; + if (empty($this->subprice)) $this->subprice=0; + if (empty($this->special_code)) $this->special_code=0; + if (empty($this->fk_parent_line)) $this->fk_parent_line=0; - if (empty($this->pa_ht)) $this->pa_ht=0; + if (empty($this->pa_ht)) $this->pa_ht=0; - // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente - if ($this->pa_ht == 0) { - if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) - $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); - } + // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente + if ($this->pa_ht == 0) { + if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) + $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); + } - // Check parameters - if ($this->product_type < 0) - { - $this->error='ErrorProductTypeMustBe0orMore'; - return -1; - } - if (! empty($this->fk_product)) - { - // Check product exists - $result=Product::isExistingObject('product', $this->fk_product); - if ($result <= 0) - { - $this->error='ErrorProductIdDoesNotExists'; - return -1; - } - } + // Check parameters + if ($this->product_type < 0) + { + $this->error='ErrorProductTypeMustBe0orMore'; + return -1; + } + if (! empty($this->fk_product)) + { + // Check product exists + $result=Product::isExistingObject('product', $this->fk_product); + if ($result <= 0) + { + $this->error='ErrorProductIdDoesNotExists'; + return -1; + } + } - $this->db->begin(); + $this->db->begin(); - // Insertion dans base de la ligne - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; - $sql.= ' (fk_facture, fk_parent_line, label, description, qty,'; - $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; - $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; - $sql.= ' date_start, date_end, fk_code_ventilation, '; - $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; - $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; - $sql.= " VALUES (".$this->fk_facture.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; - $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; - $sql.= " '".$this->db->escape($this->desc)."',"; - $sql.= " ".price2num($this->qty).","; - $sql.= " ".price2num($this->tva_tx).","; - $sql.= " ".price2num($this->localtax1_tx).","; - $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; - $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; - $sql.= " ".$this->product_type.","; - $sql.= " ".price2num($this->remise_percent).","; - $sql.= " ".price2num($this->subprice).","; - $sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; - $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; - $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; - $sql.= ' '.$this->fk_code_ventilation.','; - $sql.= ' '.$this->rang.','; - $sql.= ' '.$this->special_code.','; - $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; - $sql.= ' '.price2num($this->pa_ht).','; - $sql.= " '".$this->info_bits."',"; - $sql.= " ".price2num($this->total_ht).","; - $sql.= " ".price2num($this->total_tva).","; - $sql.= " ".price2num($this->total_ttc).","; - $sql.= " ".price2num($this->total_localtax1).","; - $sql.= " ".price2num($this->total_localtax2); - $sql.= ')'; + // Insertion dans base de la ligne + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; + $sql.= ' (fk_facture, fk_parent_line, label, description, qty,'; + $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; + $sql.= ' fk_product, product_type, remise_percent, remise_amount, subprice, fk_remise_except,'; + $sql.= ' date_start, date_end, fk_code_ventilation, '; + $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; + $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; + $sql.= " VALUES (".$this->fk_facture.","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; + $sql.= " '".$this->db->escape($this->desc)."',"; + $sql.= " ".price2num($this->qty).","; + $sql.= " ".price2num($this->tva_tx).","; + $sql.= " ".price2num($this->localtax1_tx).","; + $sql.= " ".price2num($this->localtax2_tx).","; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; + $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; + $sql.= " ".$this->product_type.","; + $sql.= " ".price2num($this->remise_percent).","; + $sql.= " ".price2num($this->remise_amount).","; + $sql.= " ".price2num($this->subprice).","; + $sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; + $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; + $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; + $sql.= ' '.$this->fk_code_ventilation.','; + $sql.= ' '.$this->rang.','; + $sql.= ' '.$this->special_code.','; + $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; + $sql.= ' '.price2num($this->pa_ht).','; + $sql.= " '".$this->info_bits."',"; + $sql.= " ".price2num($this->total_ht).","; + $sql.= " ".price2num($this->total_tva).","; + $sql.= " ".price2num($this->total_ttc).","; + $sql.= " ".price2num($this->total_localtax1).","; + $sql.= " ".price2num($this->total_localtax2); + $sql.= ')'; - dol_syslog(get_class($this)."::insert", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); + dol_syslog(get_class($this)."::insert", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } } - // Si fk_remise_except defini, on lie la remise a la facture - // ce qui la flague comme "consommee". - if ($this->fk_remise_except) - { - $discount=new DiscountAbsolute($this->db); - $result=$discount->fetch($this->fk_remise_except); - if ($result >= 0) - { - // Check if discount was found - if ($result > 0) - { - // Check if discount not already affected to another invoice - if ($discount->fk_facture) - { - $this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id); - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - else - { - $result=$discount->link_to_invoice($this->rowid,0); - if ($result < 0) - { - $this->error=$discount->error; - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } - } - else - { - $this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } - else - { - $this->error=$discount->error; - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } + // Si fk_remise_except defini, on lie la remise a la facture + // ce qui la flague comme "consommee". + if ($this->fk_remise_except) + { + $discount=new DiscountAbsolute($this->db); + $result=$discount->fetch($this->fk_remise_except); + if ($result >= 0) + { + // Check if discount was found + if ($result > 0) + { + // Check if discount not already affected to another invoice + if ($discount->fk_facture) + { + $this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + else + { + $result=$discount->link_to_invoice($this->rowid,0); + if ($result < 0) + { + $this->error=$discount->error; + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } + } + else + { + $this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } + else + { + $this->error=$discount->error; + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } - if (! $notrigger) - { + if (! $notrigger) + { // Call trigger $result=$this->call_trigger('LINEBILL_INSERT',$user); if ($result < 0) - { - $this->db->rollback(); - return -2; - } + { + $this->db->rollback(); + return -2; + } // End call triggers - } + } - $this->db->commit(); - return $this->rowid; + $this->db->commit(); + return $this->rowid; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } - /** - * Update line into database - * - * @param User $user User object - * @param int $notrigger Disable triggers - * @return int <0 if KO, >0 if OK - */ - function update($user='',$notrigger=0) - { - global $user,$langs,$conf; + /** + * Update line into database + * + * @param User $user User object + * @param int $notrigger Disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user='',$notrigger=0) + { + global $user,$langs,$conf; - $error=0; + $error=0; - // Clean parameters - $this->desc=trim($this->desc); - if (empty($this->tva_tx)) $this->tva_tx=0; - if (empty($this->localtax1_tx)) $this->localtax1_tx=0; - if (empty($this->localtax2_tx)) $this->localtax2_tx=0; - if (empty($this->localtax1_type)) $this->localtax1_type=0; - if (empty($this->localtax2_type)) $this->localtax2_type=0; - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; - if (empty($this->remise_percent)) $this->remise_percent=0; - if (empty($this->info_bits)) $this->info_bits=0; - if (empty($this->special_code)) $this->special_code=0; - if (empty($this->product_type)) $this->product_type=0; - if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + // Clean parameters + $this->desc=trim($this->desc); + if (empty($this->tva_tx)) $this->tva_tx=0; + if (empty($this->localtax1_tx)) $this->localtax1_tx=0; + if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; + if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->remise_amount)) $this->remise_amount=0; + if (empty($this->info_bits)) $this->info_bits=0; + if (empty($this->special_code)) $this->special_code=0; + if (empty($this->product_type)) $this->product_type=0; + if (empty($this->fk_parent_line)) $this->fk_parent_line=0; - // Check parameters - if ($this->product_type < 0) return -1; + // Check parameters + if ($this->product_type < 0) return -1; - if (empty($this->pa_ht)) $this->pa_ht=0; + if (empty($this->pa_ht)) $this->pa_ht=0; - // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente - if ($this->pa_ht == 0) { - if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) - $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); - } + // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente + if ($this->pa_ht == 0) { + if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) + $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); + } - $this->db->begin(); + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; @@ -3602,13 +3611,14 @@ class FactureLigne extends CommonInvoiceLine $sql.= ",label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= ",subprice=".price2num($this->subprice).""; $sql.= ",remise_percent=".price2num($this->remise_percent).""; + $sql.= ",remise_amount=".price2num($this->remise_amount).""; if ($this->fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except; else $sql.= ",fk_remise_except=null"; $sql.= ",tva_tx=".price2num($this->tva_tx).""; $sql.= ",localtax1_tx=".price2num($this->localtax1_tx).""; $sql.= ",localtax2_tx=".price2num($this->localtax2_tx).""; - $sql.= ",localtax1_type='".$this->localtax1_type."'"; - $sql.= ",localtax2_type='".$this->localtax2_type."'"; + $sql.= ",localtax1_type='".$this->localtax1_type."'"; + $sql.= ",localtax2_type='".$this->localtax2_type."'"; $sql.= ",qty=".price2num($this->qty).""; $sql.= ",date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null"); $sql.= ",date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null"); @@ -3617,129 +3627,129 @@ class FactureLigne extends CommonInvoiceLine $sql.= ",special_code='".$this->special_code."'"; if (empty($this->skip_update_total)) { - $sql.= ",total_ht=".price2num($this->total_ht).""; - $sql.= ",total_tva=".price2num($this->total_tva).""; - $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; - $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; + $sql.= ",total_ht=".price2num($this->total_ht).""; + $sql.= ",total_tva=".price2num($this->total_tva).""; + $sql.= ",total_ttc=".price2num($this->total_ttc).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); - $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; - $sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); - if (! empty($this->rang)) $sql.= ", rang=".$this->rang; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); + $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; + $sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); + if (! empty($this->rang)) $sql.= ", rang=".$this->rang; + $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $this->id=$this->rowid; - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } - if (! $notrigger) - { + if (! $notrigger) + { // Call trigger $result=$this->call_trigger('LINEBILL_UPDATE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -2; - } + if ($result < 0) + { + $this->db->rollback(); + return -2; + } // End call triggers - } - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + } + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } - /** - * Delete line in database - * - * @return int <0 if KO, >0 if OK - */ - function delete() - { - global $conf,$langs,$user; + /** + * Delete line in database + * + * @return int <0 if KO, >0 if OK + */ + function delete() + { + global $conf,$langs,$user; - $error=0; + $error=0; - $this->db->begin(); - - // Call trigger - $result=$this->call_trigger('LINEBILL_DELETE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - } - // End call triggers - + $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sql) ) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -1; - } - } + // Call trigger + $result=$this->call_trigger('LINEBILL_DELETE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers - /** - * Mise a jour en base des champs total_xxx de ligne de facture - * - * @return int <0 if KO, >0 if OK - */ - function update_total() - { - $this->db->begin(); - dol_syslog(get_class($this)."::update_total", LOG_DEBUG); - // Clean parameters - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if ($this->db->query($sql) ) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -1; + } + } - // Mise a jour ligne en base - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; - $sql.= " total_ht=".price2num($this->total_ht).""; - $sql.= ",total_tva=".price2num($this->total_tva).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; - $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; - $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= " WHERE rowid = ".$this->rowid; + /** + * Mise a jour en base des champs total_xxx de ligne de facture + * + * @return int <0 if KO, >0 if OK + */ + function update_total() + { + $this->db->begin(); + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); - dol_syslog(get_class($this)."::update_total", LOG_DEBUG); + // Clean parameters + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; - $resql=$this->db->query($sql); - if ($resql) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + // Mise a jour ligne en base + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; + $sql.= " total_ht=".price2num($this->total_ht).""; + $sql.= ",total_tva=".price2num($this->total_tva).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; + $sql.= ",total_ttc=".price2num($this->total_ttc).""; + $sql.= " WHERE rowid = ".$this->rowid; + + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); + + $resql=$this->db->query($sql); + if ($resql) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 543c2f5ef43..7ebe5245a96 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1425,6 +1425,38 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) } } +/** + * Return line remise value + * + * @param Object $object Object + * @param int $i Current line number + * @param Translate $outputlangs Object langs for output + * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) + * @return string + */ +function pdf_getlineremisevalue($object,$i,$outputlangs,$hidedetails=0) +{ + global $hookmanager; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + if ($object->lines[$i]->special_code != 3) + { + if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) + { + $special_code = $object->lines[$i]->special_code; + if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); + $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; + return $hookmanager->executeHooks('pdf_getlineremisevalue',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + } + else + { + if (empty($hidedetails) || $hidedetails > 1) return price($object->lines[$i]->subprice * $object->lines[$i]->qty - $object->lines[$i]->total_ht); + } + } +} + /** * Return line total excluding tax * diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index d07bd93825c..1742d4448a4 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -49,86 +49,86 @@ class pdf_crabe extends ModelePDFFactures var $page_largeur; var $page_hauteur; var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; - var $emetteur; // Objet societe qui emet + var $emetteur; // Objet societe qui emet - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - global $conf,$langs,$mysoc; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("bills"); + $langs->load("main"); + $langs->load("bills"); - $this->db = $db; - $this->name = "crabe"; - $this->description = $langs->trans('PDFCrabeDescription'); + $this->db = $db; + $this->name = "crabe"; + $this->description = $langs->trans('PDFCrabeDescription'); - // Dimension page pour format A4 - $this->type = 'pdf'; - $formatarray=pdf_getFormat(); - $this->page_largeur = $formatarray['width']; - $this->page_hauteur = $formatarray['height']; - $this->format = array($this->page_largeur,$this->page_hauteur); - $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; - $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; - $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; - $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; + // Dimension page pour format A4 + $this->type = 'pdf'; + $formatarray=pdf_getFormat(); + $this->page_largeur = $formatarray['width']; + $this->page_hauteur = $formatarray['height']; + $this->format = array($this->page_largeur,$this->page_hauteur); + $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; + $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; + $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; + $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte - $this->option_credit_note = 1; // Support credit notes - $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->option_logo = 1; // Affiche logo + $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION + $this->option_modereg = 1; // Affiche mode reglement + $this->option_condreg = 1; // Affiche conditions reglement + $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_credit_note = 1; // Support credit notes + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 1; // Support add of a watermark on drafts - $this->franchise=!$mysoc->tva_assuj; + $this->franchise=!$mysoc->tva_assuj; - // Get source company - $this->emetteur=$mysoc; - if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined + // Get source company + $this->emetteur=$mysoc; + if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined - // Define position of columns - $this->posxdesc=$this->marge_gauche+1; - $this->posxtva=112; - $this->posxup=126; - $this->posxqty=145; - $this->posxdiscount=162; - $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images - if ($this->page_largeur < 210) // To work with US executive format - { - $this->posxpicture-=20; - $this->posxtva-=20; - $this->posxup-=20; - $this->posxqty-=20; - $this->posxdiscount-=20; - $this->postotalht-=20; - } + // Define position of columns + $this->posxdesc=$this->marge_gauche+1; + $this->posxtva=95; + $this->posxup=109; + $this->posxqty=128; + $this->posxdiscount=148; + $this->postotalht=174; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images + if ($this->page_largeur < 210) // To work with US executive format + { + $this->posxpicture-=20; + $this->posxtva-=20; + $this->posxup-=20; + $this->posxqty-=20; + $this->posxdiscount-=20; + $this->postotalht-=20; + } - $this->tva=array(); - $this->localtax1=array(); - $this->localtax2=array(); - $this->atleastoneratenotnull=0; - $this->atleastonediscount=0; - } + $this->tva=array(); + $this->localtax1=array(); + $this->localtax2=array(); + $this->atleastoneratenotnull=0; + $this->atleastonediscount=0; + } - /** + /** * Function to build pdf onto disk * * @param Object $object Object to generate @@ -138,59 +138,59 @@ class pdf_crabe extends ModelePDFFactures * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref * @return int 1=OK, 0=KO - */ - function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) - { - global $user,$langs,$conf,$mysoc,$db,$hookmanager; + */ + function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) + { + global $user,$langs,$conf,$mysoc,$db,$hookmanager; - if (! is_object($outputlangs)) $outputlangs=$langs; - // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO - if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; + if (! is_object($outputlangs)) $outputlangs=$langs; + // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO + if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); - $outputlangs->load("products"); + $outputlangs->load("main"); + $outputlangs->load("dict"); + $outputlangs->load("companies"); + $outputlangs->load("bills"); + $outputlangs->load("products"); - if ($conf->facture->dir_output) - { - $object->fetch_thirdparty(); + if ($conf->facture->dir_output) + { + $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement(); - $amount_credit_notes_included = $object->getSumCreditNotesUsed(); - $amount_deposits_included = $object->getSumDepositsUsed(); + $deja_regle = $object->getSommePaiement(); + $amount_credit_notes_included = $object->getSumCreditNotesUsed(); + $amount_deposits_included = $object->getSumDepositsUsed(); - // Definition of $dir and $file - if ($object->specimen) - { - $dir = $conf->facture->dir_output; - $file = $dir . "/SPECIMEN.pdf"; - } - else - { - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->facture->dir_output . "/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; - } - if (! file_exists($dir)) - { - if (dol_mkdir($dir) < 0) - { - $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); - return 0; - } - } + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->facture->dir_output; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->facture->dir_output . "/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; + } + if (! file_exists($dir)) + { + if (dol_mkdir($dir) < 0) + { + $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); + return 0; + } + } - if (file_exists($dir)) - { - $nblignes = count($object->lines); + if (file_exists($dir)) + { + $nblignes = count($object->lines); $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + $heightforinfotot = 50; // Height reserved to output the info and total part + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) @@ -203,1260 +203,1273 @@ class pdf_crabe extends ModelePDFFactures // Set path to the background PDF File if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); - $tplidx = $pdf->importPage(1); + $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $tplidx = $pdf->importPage(1); } - $pdf->Open(); - $pagenb=0; - $pdf->SetDrawColor(128,128,128); + $pdf->Open(); + $pagenb=0; + $pdf->SetDrawColor(128,128,128); - $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Invoice")); - $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); + $pdf->SetSubject($outputlangs->transnoentities("Invoice")); + $pdf->SetCreator("Dolibarr ".DOL_VERSION); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); - $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right + $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right - // Positionne $this->atleastonediscount si on a au moins une remise - for ($i = 0 ; $i < $nblignes ; $i++) - { - if ($object->lines[$i]->remise_percent) - { - $this->atleastonediscount++; - } - } - if (empty($this->atleastonediscount)) - { - $this->posxpicture+=($this->postotalht - $this->posxdiscount); - $this->posxtva+=($this->postotalht - $this->posxdiscount); - $this->posxup+=($this->postotalht - $this->posxdiscount); - $this->posxqty+=($this->postotalht - $this->posxdiscount); - $this->posxdiscount+=($this->postotalht - $this->posxdiscount); - //$this->postotalht; - } + // Positionne $this->atleastonediscount si on a au moins une remise + for ($i = 0 ; $i < $nblignes ; $i++) + { + if ($object->lines[$i]->remise_percent) + { + $this->atleastonediscount++; + } + } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } - // New page - $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - $pagenb++; + // New page + $pdf->AddPage(); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell(0, 3, ''); // Set interline to 3 - $pdf->SetTextColor(0,0,0); + $this->_pagehead($pdf, $object, 1, $outputlangs); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(0, 3, ''); // Set interline to 3 + $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); + $tab_height = 130; + $tab_height_newpage = 150; - // Affiche notes - $notetoshow=empty($object->note_public)?'':$object->note_public; - if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) - { - // Get first sale rep - if (is_object($object->thirdparty)) - { - $salereparray=$object->thirdparty->getSalesRepresentatives($user); - $salerepobj=new User($this->db); - $salerepobj->fetch($salereparray[0]['id']); - if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature); - } - } - if ($notetoshow) - { - $tab_top = 88; + // Affiche notes + $notetoshow=empty($object->note_public)?'':$object->note_public; + if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) + { + // Get first sale rep + if (is_object($object->thirdparty)) + { + $salereparray=$object->thirdparty->getSalesRepresentatives($user); + $salerepobj=new User($this->db); + $salerepobj->fetch($salereparray[0]['id']); + if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature); + } + } + if ($notetoshow) + { + $tab_top = 88; - $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); - $nexY = $pdf->GetY(); - $height_note=$nexY-$tab_top; + $pdf->SetFont('','', $default_font_size - 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $nexY = $pdf->GetY(); + $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param - $pdf->SetDrawColor(192,192,192); - $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); + // Rect prend une longueur en 3eme param + $pdf->SetDrawColor(192,192,192); + $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; - } + $tab_height = $tab_height - $height_note; + $tab_top = $nexY+6; + } + else + { + $height_note=0; + } - $iniY = $tab_top + 7; - $curY = $tab_top + 7; - $nexY = $tab_top + 7; + $iniY = $tab_top + 7; + $curY = $tab_top + 7; + $nexY = $tab_top + 7; - // Loop on each lines - for ($i = 0; $i < $nblignes; $i++) - { - $curY = $nexY; - $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + // Loop on each lines + for ($i = 0; $i < $nblignes; $i++) + { + $curY = $nexY; + $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage + $pdf->SetTextColor(0,0,0); - $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. - $pageposbefore=$pdf->getPage(); + $pdf->setTopMargin($tab_top_newpage); + $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pageposbefore=$pdf->getPage(); - // Description of product line - $curX = $this->posxdesc-1; + // Description of product line + $curX = $this->posxdesc-1; - $showpricebeforepagebreak=1; + $showpricebeforepagebreak=1; - $pdf->startTransaction(); - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc); - $pageposafter=$pdf->getPage(); - if ($pageposafter > $pageposbefore) // There is a pagebreak - { - $pdf->rollbackTransaction(true); - $pageposafter=$pageposbefore; - //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); - $pageposafter=$pdf->getPage(); - $posyafter=$pdf->GetY(); - //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; - if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text - { - if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page - { - $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pageposafter+1); - } - } - else - { - // We found a page break - $showpricebeforepagebreak=0; - } - } - else // No pagebreak - { - $pdf->commitTransaction(); - } + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,8,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + $posyafter=$pdf->GetY(); + //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pageposafter+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } - $nexY = $pdf->GetY(); - $pageposafter=$pdf->getPage(); - $pdf->setPage($pageposbefore); - $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $nexY = $pdf->GetY(); + $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); + $pdf->setTopMargin($this->marge_haute); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut - // VAT Rate - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); - } + // VAT Rate + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxtva, $curY); + $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); + } - // Unit price before discount - $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); + // Unit price before discount + $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxup, $curY); + $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); - // Quantity - $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars + // Quantity + $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxqty, $curY); + $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars - // Discount on line - if ($object->lines[$i]->remise_percent) - { + // Discount % on line + if ($object->lines[$i]->remise_percent) + { $pdf->SetXY($this->posxdiscount-2, $curY); - $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); - $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); - } + $remise_amount = pdf_getlineremisevalue($object, $i, $outputlangs, $hidedetails); + $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails)."\n Soit : ".$remise_amount; + $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); + } + // Total HT line + $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->postotalht, $curY); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); - // Total HT line - $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva + $tvaligne=$object->lines[$i]->total_tva; + $localtax1ligne=$object->lines[$i]->total_localtax1; + $localtax2ligne=$object->lines[$i]->total_localtax2; + $localtax1_rate=$object->lines[$i]->localtax1_tx; + $localtax2_rate=$object->lines[$i]->localtax2_tx; + $localtax1_type=$object->lines[$i]->localtax1_type; + $localtax2_type=$object->lines[$i]->localtax2_type; - // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - $tvaligne=$object->lines[$i]->total_tva; - $localtax1ligne=$object->lines[$i]->total_localtax1; - $localtax2ligne=$object->lines[$i]->total_localtax2; - $localtax1_rate=$object->lines[$i]->localtax1_tx; - $localtax2_rate=$object->lines[$i]->localtax2_tx; - $localtax1_type=$object->lines[$i]->localtax1_type; - $localtax2_type=$object->lines[$i]->localtax2_type; + if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; + if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; + if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; - if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; - if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; - if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; + $vatrate=(string) $object->lines[$i]->tva_tx; - $vatrate=(string) $object->lines[$i]->tva_tx; + // Retrieve type from database for backward compatibility with old records + if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined + && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax + { + $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0, $object->thirdparty, $mysoc); + $localtax1_type = $localtaxtmp_array[0]; + $localtax2_type = $localtaxtmp_array[2]; + } - // Retrieve type from database for backward compatibility with old records - if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined - && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax - { - $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0, $object->thirdparty, $mysoc); - $localtax1_type = $localtaxtmp_array[0]; - $localtax2_type = $localtaxtmp_array[2]; - } + // retrieve global local tax + if ($localtax1_type && $localtax1ligne != 0) + $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; + if ($localtax2_type && $localtax2ligne != 0) + $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; - // retrieve global local tax - if ($localtax1_type && $localtax1ligne != 0) - $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2_type && $localtax2ligne != 0) - $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; + if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; + if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; + $this->tva[$vatrate] += $tvaligne; - if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; - if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; - $this->tva[$vatrate] += $tvaligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + { + $pdf->setPage($pageposafter); + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } - // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) - { - $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); - //$pdf->SetDrawColor(190,190,200); - $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); - $pdf->SetLineStyle(array('dash'=>0)); - } + $nexY+=2; // Passe espace entre les lignes - $nexY+=2; // Passe espace entre les lignes + // Detect if some page were added automatically and output _tableau for past pages + while ($pagenb < $pageposafter) + { + $pdf->setPage($pagenb); + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + } + $this->_pagefoot($pdf,$object,$outputlangs,1); + $pagenb++; + $pdf->setPage($pagenb); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + } + if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) + { + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + } + $this->_pagefoot($pdf,$object,$outputlangs,1); + // New page + $pdf->AddPage(); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + $pagenb++; + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + } + } - // Detect if some page were added automatically and output _tableau for past pages - while ($pagenb < $pageposafter) - { - $pdf->setPage($pagenb); - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); - } - $this->_pagefoot($pdf,$object,$outputlangs,1); - $pagenb++; - $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - } - if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) - { - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); - } - $this->_pagefoot($pdf,$object,$outputlangs,1); - // New page - $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - $pagenb++; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - } - } + // Show square + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + } - // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } + // Affiche zone infos + $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); - // Affiche zone infos - $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); + // Affiche zone totaux + $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); - // Affiche zone totaux - $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); + // Affiche zone versements + if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) + { + $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); + } - // Affiche zone versements - if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) - { - $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); - } + // Pied de page + $this->_pagefoot($pdf,$object,$outputlangs); + if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); - // Pied de page - $this->_pagefoot($pdf,$object,$outputlangs); - if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); + $pdf->Close(); - $pdf->Close(); + $pdf->Output($file,'F'); - $pdf->Output($file,'F'); + // Add pdfgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - // Add pdfgeneration hook - if (! is_object($hookmanager)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - } - $hookmanager->initHooks(array('pdfgeneration')); - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; - $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); - - return 1; // Pas d'erreur - } - else - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } - else - { - $this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); - return 0; - } - $this->error=$langs->trans("ErrorUnknown"); - return 0; // Erreur par defaut - } + return 1; // Pas d'erreur + } + else + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } + else + { + $this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); + return 0; + } + $this->error=$langs->trans("ErrorUnknown"); + return 0; // Erreur par defaut + } - /** - * Show payments table - * + /** + * Show payments table + * * @param PDF &$pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output * @return int <0 if KO, >0 if OK - */ - function _tableau_versements(&$pdf, $object, $posy, $outputlangs) - { - global $conf; + */ + function _tableau_versements(&$pdf, $object, $posy, $outputlangs) + { + global $conf; $sign=1; if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; $tab3_posx = 120; - $tab3_top = $posy + 8; - $tab3_width = 80; - $tab3_height = 4; - if ($this->page_largeur < 210) // To work with US executive format - { - $tab3_posx -= 20; - } + $tab3_top = $posy + 8; + $tab3_width = 80; + $tab3_height = 4; + if ($this->page_largeur < 210) // To work with US executive format + { + $tab3_posx -= 20; + } - $default_font_size = pdf_getPDFFontSize($outputlangs); + $default_font_size = pdf_getPDFFontSize($outputlangs); - $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); - if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); + $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); + if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); - $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->SetFont('','', $default_font_size - 3); + $pdf->SetXY($tab3_posx, $tab3_top - 4); + $pdf->MultiCell(60, 3, $title, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); + $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); - $pdf->SetFont('','', $default_font_size - 4); - $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->SetFont('','', $default_font_size - 4); + $pdf->SetXY($tab3_posx, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); + $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); - $y=0; + $y=0; - $pdf->SetFont('','', $default_font_size - 4); + $pdf->SetFont('','', $default_font_size - 4); - // Loop on each deposits and credit notes included - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; - $sql.= " re.description, re.fk_facture_source,"; - $sql.= " f.type, f.datef"; - $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; - $sql.= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - $invoice=new Facture($this->db); - while ($i < $num) - { - $y+=3; - $obj = $this->db->fetch_object($resql); + // Loop on each deposits and credit notes included + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql.= " re.description, re.fk_facture_source,"; + $sql.= " f.type, f.datef"; + $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; + $sql.= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + $invoice=new Facture($this->db); + while ($i < $num) + { + $y+=3; + $obj = $this->db->fetch_object($resql); - if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); - elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); - else $text=$outputlangs->trans("UnknownType"); + if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); + elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); + else $text=$outputlangs->trans("UnknownType"); - $invoice->fetch($obj->fk_facture_source); + $invoice->fetch($obj->fk_facture_source); - $pdf->SetXY($tab3_posx, $tab3_top+$y); - $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); - $pdf->MultiCell(20, 3, $text, 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); - $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); + $pdf->SetXY($tab3_posx, $tab3_top+$y); + $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top+$y); + $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top+$y); + $pdf->MultiCell(20, 3, $text, 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top+$y); + $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); - $i++; - } - } - else - { - $this->error=$this->db->lasterror(); - return -1; - } + $i++; + } + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } - // Loop on each payment - $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; - $sql.= " cp.code"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; - $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; - $sql.= " ORDER BY p.datep"; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while ($i < $num) { - $y+=3; - $row = $this->db->fetch_object($resql); + // Loop on each payment + $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; + $sql.= " cp.code"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; + $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; + $sql.= " ORDER BY p.datep"; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) { + $y+=3; + $row = $this->db->fetch_object($resql); - $pdf->SetXY($tab3_posx, $tab3_top+$y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); + $pdf->SetXY($tab3_posx, $tab3_top+$y); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top+$y); + $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top+$y); + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); - $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top+$y); + $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); - $i++; - } - } - else - { - $this->error=$this->db->lasterror(); - return -1; - } + $i++; + } + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } - } + } - /** - * Show miscellaneous information (payment mode, payment term, ...) - * - * @param PDF &$pdf Object PDF - * @param Object $object Object to show - * @param int $posy Y - * @param Translate $outputlangs Langs object - * @return void - */ - function _tableau_info(&$pdf, $object, $posy, $outputlangs) - { - global $conf; + /** + * Show miscellaneous information (payment mode, payment term, ...) + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $posy Y + * @param Translate $outputlangs Langs object + * @return void + */ + function _tableau_info(&$pdf, $object, $posy, $outputlangs) + { + global $conf; - $default_font_size = pdf_getPDFFontSize($outputlangs); + $default_font_size = pdf_getPDFFontSize($outputlangs); - $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetFont('','', $default_font_size - 1); - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + // If France, show VAT mention if not applicable + if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); - $posy=$pdf->GetY()+4; - } + $posy=$pdf->GetY()+4; + } - $posxval=52; + $posxval=52; - // Show payments conditions - if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + // Show payments conditions + if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentConditions").':'; + $pdf->MultiCell(80, 4, $titre, 0, 'L'); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); - $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posxval, $posy); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); + $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); - $posy=$pdf->GetY()+3; - } + $posy=$pdf->GetY()+3; + } - if ($object->type != 2) - { - // Check a payment mode is defined - if (empty($object->mode_reglement_code) - && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) - { - $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } - // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) - { - $outputlangs->load("errors"); + if ($object->type != 2) + { + // Check a payment mode is defined + if (empty($object->mode_reglement_code) + && empty($conf->global->FACTURE_CHQ_NUMBER) + && empty($conf->global->FACTURE_RIB_NUMBER)) + { + $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); + } + // Avoid having any valid PDF with setup that is not complete + elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) + || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) + { + $outputlangs->load("errors"); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B', $default_font_size - 2); - $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); - $pdf->MultiCell(80, 3, $this->error,0,'L',0); - $pdf->SetTextColor(0,0,0); + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetTextColor(200,0,0); + $pdf->SetFont('','B', $default_font_size - 2); + $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); + $pdf->MultiCell(80, 3, $this->error,0,'L',0); + $pdf->SetTextColor(0,0,0); - $posy=$pdf->GetY()+1; - } + $posy=$pdf->GetY()+1; + } - // Show payment mode - if ($object->mode_reglement_code - && $object->mode_reglement_code != 'CHQ' - && $object->mode_reglement_code != 'VIR') - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentMode").':'; - $pdf->MultiCell(80, 5, $titre, 0, 'L'); + // Show payment mode + if ($object->mode_reglement_code + && $object->mode_reglement_code != 'CHQ' + && $object->mode_reglement_code != 'VIR') + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentMode").':'; + $pdf->MultiCell(80, 5, $titre, 0, 'L'); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); - $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posxval, $posy); + $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); + $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); - $posy=$pdf->GetY()+2; - } + $posy=$pdf->GetY()+2; + } - // Show payment mode CHQ - if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') - { - // Si mode reglement non force ou si force a CHQ - if (! empty($conf->global->FACTURE_CHQ_NUMBER)) - { - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + // Show payment mode CHQ + if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') + { + // Si mode reglement non force ou si force a CHQ + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) + { + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); - if ($conf->global->FACTURE_CHQ_NUMBER > 0) - { - $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + if ($conf->global->FACTURE_CHQ_NUMBER > 0) + { + $account = new Account($this->db); + $account->fetch($conf->global->FACTURE_CHQ_NUMBER); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); - $posy=$pdf->GetY()+1; + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); + $posy=$pdf->GetY()+1; - if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); - $posy=$pdf->GetY()+2; - } - } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); - $posy=$pdf->GetY()+1; + if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $posy=$pdf->GetY()+2; + } + } + if ($conf->global->FACTURE_CHQ_NUMBER == -1) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); + $posy=$pdf->GetY()+1; - if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); - $posy=$pdf->GetY()+2; - } - } - } - } + if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $posy=$pdf->GetY()+2; + } + } + } + } - // If payment mode not forced or forced to VIR, show payment with BAN - if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') - { - if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) - { - $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); - $account = new Account($this->db); - $account->fetch($bankid); + // If payment mode not forced or forced to VIR, show payment with BAN + if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') + { + if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) + { + $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); + $account = new Account($this->db); + $account->fetch($bankid); - $curx=$this->marge_gauche; - $cury=$posy; + $curx=$this->marge_gauche; + $cury=$posy; - $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size); + $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size); - $posy+=2; - } - } - } + $posy+=2; + } + } + } - return $posy; - } + return $posy; + } - /** - * Show total to pay - * - * @param PDF &$pdf Object PDF - * @param Facture $object Object invoice - * @param int $deja_regle Montant deja regle - * @param int $posy Position depart - * @param Translate $outputlangs Objet langs - * @return int Position pour suite - */ - function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) - { - global $conf,$mysoc; + /** + * Show total to pay + * + * @param PDF &$pdf Object PDF + * @param Facture $object Object invoice + * @param int $deja_regle Montant deja regle + * @param int $posy Position depart + * @param Translate $outputlangs Objet langs + * @return int Position pour suite + */ + function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) + { + global $conf,$mysoc; $sign=1; if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; $default_font_size = pdf_getPDFFontSize($outputlangs); - $tab2_top = $posy; - $tab2_hl = 4; - $pdf->SetFont('','', $default_font_size - 1); + $tab2_top = $posy; + $tab2_hl = 4; + $pdf->SetFont('','', $default_font_size - 1); - // Tableau total - $col1x = 120; $col2x = 170; - if ($this->page_largeur < 210) // To work with US executive format - { - $col2x-=20; - } - $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); - - $useborder=0; - $index = 0; - - // Total HT - $pdf->SetFillColor(255,255,255); - $pdf->SetXY($col1x, $tab2_top + 0); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + 0); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); - - // Show VAT by rates and total - $pdf->SetFillColor(248,248,248); - - $this->atleastoneratenotnull=0; - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) - { - // Nothing to do - } - else - { - //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey!=0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - } - //} - //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey!=0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - - } - } - } - //} - // VAT - foreach($this->tva as $tvakey => $tvaval) - { - if ($tvakey > 0) // On affiche pas taux 0 - { - $this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - - //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - } - //} - //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - // retrieve global local tax - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; - - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - //} - } - - // Revenue stamp - if (price2num($object->revenuestamp) != 0) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); - } - - // Total TTC - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0,0,60); - $pdf->SetFillColor(224,224,224); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); - } - } - - $pdf->SetTextColor(0,0,0); - - $creditnoteamount=$object->getSumCreditNotesUsed(); - $depositsamount=$object->getSumDepositsUsed(); - //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); - if ($object->paye) $resteapayer=0; - - if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) - { - // Already paid + Deposits - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); - - // Credit note - if ($creditnoteamount) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); - } - - // Escompte - if ($object->close_code == 'discount_vat') - { - $index++; - $pdf->SetFillColor(255,255,255); - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); - - $resteapayer=0; - } - - $index++; - $pdf->SetTextColor(0,0,60); - $pdf->SetFillColor(224,224,224); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); - - // Fin - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetTextColor(0,0,0); - } - - $index++; - return ($tab2_top + ($tab2_hl * $index)); - } - - /** - * Show table for lines - * - * @param PDF &$pdf Object PDF - * @param string $tab_top Top position of table - * @param string $tab_height Height of table (rectangle) - * @param int $nexY Y (not used) - * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array - * @return void - */ - function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) - { - global $conf; - - // Force to disable hidetop and hidebottom - $hidebottom=0; - if ($hidetop) $hidetop=-1; - - $default_font_size = pdf_getPDFFontSize($outputlangs); - - // Amount in (at tab_top - 1) - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - - if (empty($hidetop)) - { - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); - $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); - $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); - - //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; - if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); - } - - $pdf->SetDrawColor(128,128,128); - $pdf->SetFont('','', $default_font_size - 1); - - // Output Rect - $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param - - if (empty($hidetop)) - { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param - - $pdf->SetXY($this->posxdesc-1, $tab_top+1); - $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); - } - - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxtva-3, $tab_top+1); - $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); - } - } - - $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxup-1, $tab_top+1); - $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); - } - - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); - } - - $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - if ($this->atleastonediscount) - { - $pdf->SetXY($this->posxdiscount-1, $tab_top+1); - $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); - } - } - if ($this->atleastonediscount) - { - $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); - } - if (empty($hidetop)) - { - $pdf->SetXY($this->postotalht-1, $tab_top+1); - $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); - } - } - - /** - * Show top header of page. - * - * @param PDF &$pdf Object PDF - * @param Object $object Object to show - * @param int $showaddress 0=no, 1=yes - * @param Translate $outputlangs Object lang for output - * @return void - */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs) - { - global $conf,$langs; - - $outputlangs->load("main"); - $outputlangs->load("bills"); - $outputlangs->load("propal"); - $outputlangs->load("companies"); - - $default_font_size = pdf_getPDFFontSize($outputlangs); - - pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); - - // Show Draft Watermark - if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + // Tableau total + $col1x = 120; $col2x = 170; + if ($this->page_largeur < 210) // To work with US executive format { - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); + $col2x-=20; + } + $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); + + $useborder=0; + $index = 0; + + // Total HT + $pdf->SetFillColor(255,255,255); + $pdf->SetXY($col1x, $tab2_top + 0); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); + + // Show VAT by rates and total + $pdf->SetFillColor(248,248,248); + + $this->atleastoneratenotnull=0; + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) + { + // Nothing to do + } + else + { + //Local tax 1 before VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ + foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey!=0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + } + //} + //Local tax 2 before VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ + foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey!=0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + + } + } + } + //} + // VAT + foreach($this->tva as $tvakey => $tvaval) + { + if ($tvakey > 0) // On affiche pas taux 0 + { + $this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat.=vatrate($tvakey,1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + + //Local tax 1 after VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ + foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('2','4','6'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey != 0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + } + //} + //Local tax 2 after VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ + foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('2','4','6'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + // retrieve global local tax + if ($tvakey != 0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + //} + } + + // Revenue stamp + if (price2num($object->revenuestamp) != 0) + { + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + } + + // Total TTC + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->SetTextColor(0,0,60); + $pdf->SetFillColor(224,224,224); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); + + if($this->atleastonediscount){ + // Total Discount + $index++; + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->SetTextColor(0,0,60); + $pdf->SetFillColor(224,224,224); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); + } + } } - $pdf->SetTextColor(0,0,60); - $pdf->SetFont('','B', $default_font_size + 3); + $pdf->SetTextColor(0,0,0); - $posy=$this->marge_haute; + $creditnoteamount=$object->getSumCreditNotesUsed(); + $depositsamount=$object->getSumDepositsUsed(); + //print "x".$creditnoteamount."-".$depositsamount;exit; + $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + if ($object->paye) $resteapayer=0; + + if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) + { + // Already paid + Deposits + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + + // Credit note + if ($creditnoteamount) + { + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + } + + // Escompte + if ($object->close_code == 'discount_vat') + { + $index++; + $pdf->SetFillColor(255,255,255); + + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + + $resteapayer=0; + } + + $index++; + $pdf->SetTextColor(0,0,60); + $pdf->SetFillColor(224,224,224); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + + // Fin + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetTextColor(0,0,0); + } + + $index++; + return ($tab2_top + ($tab2_hl * $index)); + } + + /** + * Show table for lines + * + * @param PDF &$pdf Object PDF + * @param string $tab_top Top position of table + * @param string $tab_height Height of table (rectangle) + * @param int $nexY Y (not used) + * @param Translate $outputlangs Langs object + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int $hidebottom Hide bottom bar of array + * @return void + */ + function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) + { + global $conf; + + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + + $default_font_size = pdf_getPDFFontSize($outputlangs); + + // Amount in (at tab_top - 1) + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + + if (empty($hidetop)) + { + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); + $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); + + //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; + if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); + } + + $pdf->SetDrawColor(128,128,128); + $pdf->SetFont('','', $default_font_size - 1); + + // Output Rect + $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + + if (empty($hidetop)) + { + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + + $pdf->SetXY($this->posxdesc-1, $tab_top+1); + $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); + } + + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxtva-3, $tab_top+1); + $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); + } + } + + $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxup-1, $tab_top+1); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); + } + + $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxqty-1, $tab_top+1); + $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); + } + + $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + if ($this->atleastonediscount) + { + $pdf->SetXY($this->posxdiscount-1, $tab_top+1); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + } + } + if ($this->atleastonediscount) + { + $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); + } + if (empty($hidetop)) + { + $pdf->SetXY($this->postotalht-1, $tab_top+1); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); + } + } + + /** + * Show top header of page. + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $showaddress 0=no, 1=yes + * @param Translate $outputlangs Object lang for output + * @return void + */ + function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + { + global $conf,$langs; + + $outputlangs->load("main"); + $outputlangs->load("bills"); + $outputlangs->load("propal"); + $outputlangs->load("companies"); + + $default_font_size = pdf_getPDFFontSize($outputlangs); + + pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); + + // Show Draft Watermark + if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) + { + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); + } + + $pdf->SetTextColor(0,0,60); + $pdf->SetFont('','B', $default_font_size + 3); + + $posy=$this->marge_haute; $posx=$this->page_largeur-$this->marge_droite-100; - $pdf->SetXY($this->marge_gauche,$posy); + $pdf->SetXY($this->marge_gauche,$posy); - // Logo - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; - if ($this->emetteur->logo) - { - if (is_readable($logo)) - { - $height=pdf_getHeightForLogo($logo); - $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) - } - else - { - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B',$default_font_size - 2); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); - } - } - else - { - $text=$this->emetteur->name; - $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); - } + // Logo + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + if ($this->emetteur->logo) + { + if (is_readable($logo)) + { + $height=pdf_getHeightForLogo($logo); + $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + } + else + { + $pdf->SetTextColor(200,0,0); + $pdf->SetFont('','B',$default_font_size - 2); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); + } + } + else + { + $text=$this->emetteur->name; + $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); + } - $pdf->SetFont('','B', $default_font_size + 3); - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $title=$outputlangs->transnoentities("Invoice"); - if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); - if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); - if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); - if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); - $pdf->MultiCell(100, 3, $title, '', 'R'); + $pdf->SetFont('','B', $default_font_size + 3); + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $title=$outputlangs->transnoentities("Invoice"); + if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); + if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); + if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); + if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); + $pdf->MultiCell(100, 3, $title, '', 'R'); - $pdf->SetFont('','B',$default_font_size); + $pdf->SetFont('','B',$default_font_size); - $posy+=5; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); + $posy+=5; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); - $posy+=1; - $pdf->SetFont('','', $default_font_size - 2); + $posy+=1; + $pdf->SetFont('','', $default_font_size - 2); - if ($object->ref_client) - { - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); - } + if ($object->ref_client) + { + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); + } - $objectidnext=$object->getIdReplacingInvoice('validated'); - if ($object->type == 0 && $objectidnext) - { - $objectreplacing=new Facture($this->db); - $objectreplacing->fetch($objectidnext); + $objectidnext=$object->getIdReplacingInvoice('validated'); + if ($object->type == 0 && $objectidnext) + { + $objectreplacing=new Facture($this->db); + $objectreplacing->fetch($objectidnext); - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); - } - if ($object->type == 1) - { - $objectreplaced=new Facture($this->db); - $objectreplaced->fetch($object->fk_facture_source); + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); + } + if ($object->type == 1) + { + $objectreplaced=new Facture($this->db); + $objectreplaced->fetch($object->fk_facture_source); - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); - } - if ($object->type == 2) - { - $objectreplaced=new Facture($this->db); - $objectreplaced->fetch($object->fk_facture_source); + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); + } + if ($object->type == 2) + { + $objectreplaced=new Facture($this->db); + $objectreplaced->fetch($object->fk_facture_source); - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); - } + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); + } - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R'); + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R'); - if ($object->type != 2) - { - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); - } + if ($object->type != 2) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); + } - if ($object->client->code_client) - { - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); - } + if ($object->client->code_client) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); + } - $posy+=1; + $posy+=1; - // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); - if ($showaddress) - { - // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + if ($showaddress) + { + // Sender properties + $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); - // Show sender - $posy=42; - $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; - $hautcadre=40; + // Show sender + $posy=42; + $posx=$this->marge_gauche; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + $hautcadre=40; - // Show sender frame - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posx,$posy-5); - $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); - $pdf->SetXY($posx,$posy); - $pdf->SetFillColor(230,230,230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0,0,60); + // Show sender frame + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posx,$posy-5); + $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); + $pdf->SetXY($posx,$posy); + $pdf->SetFillColor(230,230,230); + $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->SetTextColor(0,0,60); - // Show sender name - $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy=$pdf->getY(); + // Show sender name + $pdf->SetXY($posx+2,$posy+3); + $pdf->SetFont('','B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); - // Show sender information - $pdf->SetXY($posx+2,$posy); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); + // Show sender information + $pdf->SetXY($posx+2,$posy); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); - // If BILLING contact defined on invoice, we use it - $usecontact=false; - $arrayidcontact=$object->getIdContact('external','BILLING'); - if (count($arrayidcontact) > 0) - { - $usecontact=true; - $result=$object->fetch_contact($arrayidcontact[0]); - } + // If BILLING contact defined on invoice, we use it + $usecontact=false; + $arrayidcontact=$object->getIdContact('external','BILLING'); + if (count($arrayidcontact) > 0) + { + $usecontact=true; + $result=$object->fetch_contact($arrayidcontact[0]); + } - // Recipient name - if (! empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; - else $socname = $object->client->nom; - $carac_client_name=$outputlangs->convToOutputCharset($socname); - } - else - { - $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); - } + // Recipient name + if (! empty($usecontact)) + { + // On peut utiliser le nom de la societe du contact + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; + else $socname = $object->client->nom; + $carac_client_name=$outputlangs->convToOutputCharset($socname); + } + else + { + $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); + } - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); - // Show recipient - $widthrecbox=100; - if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; - $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; + // Show recipient + $widthrecbox=100; + if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format + $posy=42; + $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; - // Show recipient frame - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posx+2,$posy-5); - $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + // Show recipient frame + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posx+2,$posy-5); + $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); + $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); - // Show recipient name - $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + // Show recipient name + $pdf->SetXY($posx+2,$posy+3); + $pdf->SetFont('','B', $default_font_size); + $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); - // Show recipient information - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); - $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); - } + // Show recipient information + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + } - $pdf->SetTextColor(0,0,0); - } + $pdf->SetTextColor(0,0,0); + } - /** - * Show footer of page. Need this->emetteur object + /** + * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF - * @param Object $object Object to show - * @param Translate $outputlangs Object lang for output - * @param int $hidefreetext 1=Hide free text - * @return int Return height of bottom margin including footer text - */ - function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) - { - return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); - } + * @param PDF &$pdf PDF + * @param Object $object Object to show + * @param Translate $outputlangs Object lang for output + * @param int $hidefreetext 1=Hide free text + * @return int Return height of bottom margin including footer text + */ + function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) + { + return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); + } } From 605919be765c1b8495e534afdffc80593683350f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 14:51:40 +0200 Subject: [PATCH 371/502] Fix: Too many parameter Fix: Can't delete bank account --- htdocs/compta/bank/bankid_fr.php | 4 +- .../compta/localtax/class/localtax.class.php | 68 ++++++++--------- htdocs/compta/tva/class/tva.class.php | 74 +++++++++---------- htdocs/product/stock/product.php | 8 +- htdocs/user/perms.php | 7 ++ 5 files changed, 80 insertions(+), 81 deletions(-) diff --git a/htdocs/compta/bank/bankid_fr.php b/htdocs/compta/bank/bankid_fr.php index 0042377481e..9c10a311366 100644 --- a/htdocs/compta/bank/bankid_fr.php +++ b/htdocs/compta/bank/bankid_fr.php @@ -35,6 +35,7 @@ $langs->load("bills"); $action=GETPOST('action'); $id=GETPOST('id'); +$ref=GETPOST('ref'); // Security check if (isset($_GET["id"]) || isset($_GET["ref"])) @@ -89,7 +90,8 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights-> { // Modification $account = new Account($db); - $account->delete($_GET["id"]); + $account->fetch($id); + $account->delete(); header("Location: ".DOL_URL_ROOT."/compta/bank/index.php"); exit; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 72ce346abad..749da49a7d0 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -106,11 +106,11 @@ class Localtax extends CommonObject // Call trigger $result=$this->call_trigger('LOCALTAX_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers //FIXME: Add rollback if trigger fail - + return $this->id; } else @@ -167,9 +167,9 @@ class Localtax extends CommonObject { // Call trigger $result=$this->call_trigger('LOCALTAX_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - + //FIXME: Add rollback if trigger fail } @@ -257,8 +257,8 @@ class Localtax extends CommonObject $result=$this->call_trigger('LOCALTAX_DELETE',$user); if ($result < 0) return -1; // End call triggers - - + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax"; $sql.= " WHERE rowid=".$this->id; @@ -326,35 +326,32 @@ class Localtax extends CommonObject */ 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; + $ret = $obj->amount; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free($result); - } else - { - print $this->db->error(); + { + print $this->db->lasterror(); return -1; } } @@ -370,31 +367,30 @@ class Localtax extends CommonObject $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); + $result = $this->db->query($sql); if ($result) { if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); - return $obj->total_localtax; + $ret = $obj->total_localtax; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free(); - } else { - print $this->db->error(); + print $this->db->lasterror(); return -1; } } @@ -412,32 +408,30 @@ class Localtax extends CommonObject $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; + $ret = $obj->amount; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free(); - } else { - print $this->db->error(); + print $this->db->lasterror(); return -1; } } @@ -543,14 +537,14 @@ class Localtax extends CommonObject } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); $this->db->rollback(); return -2; } } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); $this->db->rollback(); return -1; } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 312da55f138..4e049594b49 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -123,7 +123,7 @@ class Tva extends CommonObject // Call trigger $result=$this->call_trigger('TVA_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers //FIXME: Add rollback if trigger fail @@ -138,7 +138,7 @@ class Tva extends CommonObject /** * 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 @@ -188,9 +188,9 @@ class Tva extends CommonObject { // Call trigger $result=$this->call_trigger('TVA_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - + //FIXME: Add rollback if trigger fail } @@ -200,7 +200,7 @@ class Tva extends CommonObject /** * Load object in memory from database - * + * * @param int $id id object * @param User $user User that load * @return int <0 if KO, >0 if OK @@ -269,7 +269,7 @@ class Tva extends CommonObject /** * Delete object in database - * + * * @param User $user User that delete * @return int <0 if KO, >0 if OK */ @@ -278,12 +278,12 @@ class Tva extends CommonObject global $conf, $langs; $error=0; - + // Call trigger $result=$this->call_trigger('TVA_DELETE',$user); if ($result < 0) return -1; // End call triggers - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva"; $sql.= " WHERE rowid=".$this->id; @@ -325,7 +325,7 @@ class Tva extends CommonObject /** * Balance of VAT - * + * * @param int $year Year * @return double Amount */ @@ -344,7 +344,7 @@ class Tva extends CommonObject /** * Total of the VAT from invoices emitted by the society. - * + * * @param int $year Year * @return double Amount */ @@ -353,32 +353,30 @@ class Tva extends CommonObject $sql = "SELECT sum(f.tva) 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; + $ret = $obj->amount; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free($result); - } else { - print $this->db->error(); + print $this->db->lasterror(); return -1; } } @@ -394,31 +392,30 @@ class Tva extends CommonObject $sql = "SELECT sum(f.total_tva) as total_tva"; $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); + $result = $this->db->query($sql); if ($result) { if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); - return $obj->total_tva; + $ret = $obj->total_tva; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free(); - } else { - print $this->db->error(); + print $this->db->lasterror(); return -1; } } @@ -442,25 +439,24 @@ class Tva extends CommonObject } $result = $this->db->query($sql); - if ($result) { if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); - return $obj->amount; + $ret = $obj->amount; + $this->db->free($result); + return $ret; } else - { - return 0; + { + $this->db->free($result); + return 0; } - - $this->db->free(); - } else { - print $this->db->error(); + print $this->db->lasterror(); return -1; } } @@ -485,7 +481,7 @@ class Tva extends CommonObject $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); - + // Check parameters if (! $this->label) { @@ -542,13 +538,13 @@ class Tva extends CommonObject // Call trigger //XXX: Should be done just befor commit no ? $result=$this->call_trigger('TVA_ADDPAYMENT',$user); - if ($result < 0) + if ($result < 0) { $this->id = 0; $ok = 0; } // End call triggers - + if ($this->id > 0) { $ok=1; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index a9b9c000553..a2096c49f14 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -68,7 +68,7 @@ if ($action == 'setstocklimit') $product = new Product($db); $result=$product->fetch($id); $product->seuil_stock_alerte=$stocklimit; - $result=$product->update($product->id,$user,1,0,1); + $result=$product->update($product->id,$user,0,'update'); if ($result < 0) setEventMessage($product->error, 'errors'); $action=''; @@ -80,7 +80,7 @@ if ($action == 'setdesiredstock') $product = new Product($db); $result=$product->fetch($id); $product->desiredstock=$desiredstock; - $result=$product->update($product->id,$user,1,0,1); + $result=$product->update($product->id,$user,0,'update'); if ($result < 0) setEventMessage($product->error, 'errors'); $action=''; @@ -154,7 +154,7 @@ if ($action == "correct_stock" && ! $cancel) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$product->id); exit; } - else + else { setEventMessage($product->error,'errors'); $action='correction'; @@ -258,7 +258,7 @@ if ($id > 0 || $ref) $titre=$langs->trans("CardProduct".$product->type); $picto=($product->type==1?'service':'product'); dol_fiche_head($head, 'stock', $titre, 0, $picto); - + dol_htmloutput_events(); $form = new Form($db); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 2be426bb571..f9dbb54f8f4 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -279,6 +279,7 @@ if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivat if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'

'."\n"; // For multicompany transversal mode +// TODO Place a hook here if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { $aEntities=array_keys($permsgroupbyentity); @@ -422,6 +423,12 @@ if ($result) else dol_print_error($db); print '
'; +// For multicompany transversal mode +// TODO Place a hook here +if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) +{ + dol_fiche_end(); +} dol_fiche_end(); From 67a7a210fd9cb07d7cdb4f49fa5719a0744f35a5 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Fri, 1 Aug 2014 16:17:31 +0200 Subject: [PATCH 372/502] Fix: Optimieze Price by Customer --- htdocs/comm/propal.php | 71 ++++++++++++++++++------------------- htdocs/commande/fiche.php | 73 +++++++++++++++++++-------------------- htdocs/compta/facture.php | 73 +++++++++++++++++++-------------------- htdocs/contrat/fiche.php | 4 +-- 4 files changed, 106 insertions(+), 115 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 9b47a302398..486ca39c18e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -9,6 +9,7 @@ * Copyright (C) 2010-2011 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -151,7 +152,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -171,7 +172,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -461,7 +462,7 @@ else if ($action == 'add' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -548,11 +549,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Recipient was provided from combo list if ($_POST ['receiver'] == 'thirdparty') // Id of third party { - $sendto = $object->client->email; + $sendto = $object->thirdparty->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property($_POST ['receiver'], 'email'); + $sendto = $object->thirdparty->contact_get_property($_POST ['receiver'], 'email'); $sendtoid = $_POST ['receiver']; } } @@ -656,7 +657,7 @@ if ($action == 'modif' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -742,18 +743,22 @@ else if ($action == 'addline' && $user->rights->propal->creer) { $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); // If prices fields are update - $tva_tx = get_default_tva($mysoc, $object->client, $prod->id); - $tva_npr = get_default_npr($mysoc, $object->client, $prod->id); + $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); + $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; // On defini prix unitaire - if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) + if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->thirdparty->price_level) { - $pu_ht = $prod->multiprices [$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; - $price_min = $prod->multiprices_min [$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type [$object->client->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; + $pu_ht = $prod->multiprices [$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min [$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -761,12 +766,11 @@ else if ($action == 'addline' && $user->rights->propal->creer) { $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $found = true; $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; @@ -774,13 +778,6 @@ else if ($action == 'addline' && $user->rights->propal->creer) { } } } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { @@ -807,7 +804,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) { if (empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if (empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -852,8 +849,8 @@ else if ($action == 'addline' && $user->rights->propal->creer) { $date_end = dol_mktime(0, 0, 0, GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); // Local Taxes - $localtax1_tx = get_localtax($tva_tx, 1, $object->client); - $localtax2_tx = get_localtax($tva_tx, 2, $object->client); + $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty); $info_bits = 0; if ($tva_npr) @@ -874,7 +871,7 @@ else if ($action == 'addline' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -933,8 +930,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa // Define vat_rate $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->client); - $localtax2_rate = get_localtax($vat_rate, 2, $object->client); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); $pu_ht = GETPOST('price_ht'); // Add buying price @@ -969,8 +966,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min [$object->client->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); @@ -1002,7 +999,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1044,7 +1041,7 @@ else if ($action == 'builddoc' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1130,7 +1127,7 @@ else if ($action == 'up' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -1149,7 +1146,7 @@ else if ($action == 'down' && $user->rights->propal->creer) { $outputlangs = $langs; if (! empty($conf->global->MAIN_MULTILANGS)) { $outputlangs = new Translate("", $conf); - $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang); $outputlangs->setDefaultLang($newlang); } $ret = $object->fetch($id); // Reload to get new records @@ -2302,7 +2299,7 @@ if ($action == 'create') { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 73088fb5ba9..a82eb5dda05 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -9,6 +9,7 @@ * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -170,7 +171,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -476,7 +477,7 @@ else if ($action == 'setconditions' && $user->rights->commande->creer) { $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -581,18 +582,22 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); // Update if prices fields are defined - $tva_tx = get_default_tva($mysoc, $object->client, $prod->id); - $tva_npr = get_default_npr($mysoc, $object->client, $prod->id); + $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); + $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; // multiprix - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { - $pu_ht = $prod->multiprices [$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; - $price_min = $prod->multiprices_min [$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type [$object->client->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; + $pu_ht = $prod->multiprices [$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min [$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -600,12 +605,11 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $found = true; $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; @@ -613,14 +617,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { } } } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -646,7 +643,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { if (empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if (empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -688,8 +685,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $buyingprice = (GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : ''); // Local Taxes - $localtax1_tx = get_localtax($tva_tx, 1, $object->client); - $localtax2_tx = get_localtax($tva_tx, 2, $object->client); + $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty); $desc = dol_htmlcleanlastbr($desc); @@ -712,7 +709,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -778,8 +775,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->client); - $localtax2_rate = get_localtax($vat_rate, 2, $object->client); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); // Add buying price $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); @@ -805,8 +802,8 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min [$object->client->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); @@ -836,7 +833,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -902,7 +899,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -947,7 +944,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1013,7 +1010,7 @@ else if ($action == 'up' && $user->rights->commande->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1035,7 +1032,7 @@ else if ($action == 'down' && $user->rights->commande->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1064,7 +1061,7 @@ else if ($action == 'builddoc') // In get or post if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1179,11 +1176,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Recipient was provided from combo list if (GETPOST('receiver') == 'thirdparty') // Id of third party { - $sendto = $object->client->email; + $sendto = $object->thirdparty->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property(GETPOST('receiver'), 'email'); + $sendto = $object->thirdparty->contact_get_property(GETPOST('receiver'), 'email'); $sendtoid = GETPOST('receiver'); } } @@ -2444,7 +2441,7 @@ if ($action == 'create' && $user->rights->commande->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 320acf570b6..056d5168234 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -10,6 +10,7 @@ * Copyright (C) 2013 Jean-Francois FERRY * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2014 Ferran Marcet * * 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 @@ -182,7 +183,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -393,7 +394,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -468,7 +469,7 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_ if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1145,18 +1146,22 @@ else if ($action == 'addline' && $user->rights->facture->creer) $label = ((GETPOST('product_label') && GETPOST('product_label') != $prod->label) ? GETPOST('product_label') : ''); // Update if prices fields are defined - $tva_tx = get_default_tva($mysoc, $object->client, $prod->id); - $tva_npr = get_default_npr($mysoc, $object->client, $prod->id); - + $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); + $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; + // We define price for product - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { - $pu_ht = $prod->multiprices [$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc [$object->client->price_level]; - $price_min = $prod->multiprices_min [$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type [$object->client->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; + $pu_ht = $prod->multiprices [$object->thirdparty->price_level]; + $pu_ttc = $prod->multiprices_ttc [$object->thirdparty->price_level]; + $price_min = $prod->multiprices_min [$object->thirdparty->price_level]; + $price_base_type = $prod->multiprices_base_type [$object->thirdparty->price_level]; + $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level]; + $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -1164,12 +1169,11 @@ else if ($action == 'addline' && $user->rights->facture->creer) $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { if (count($prodcustprice->lines) > 0) { - $found = true; $pu_ht = price($prodcustprice->lines [0]->price); $pu_ttc = price($prodcustprice->lines [0]->price_ttc); $price_base_type = $prodcustprice->lines [0]->price_base_type; @@ -1177,14 +1181,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) } } } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -1210,7 +1207,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) if (empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if (empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1252,8 +1249,8 @@ else if ($action == 'addline' && $user->rights->facture->creer) $buyingprice = price2num(GETPOST('buying_price' . $predef) ? GETPOST('buying_price' . $predef) : ''); // Local Taxes - $localtax1_tx = get_localtax($tva_tx, 1, $object->client); - $localtax2_tx = get_localtax($tva_tx, 2, $object->client); + $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty); + $localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty); $info_bits = 0; if ($tva_npr) @@ -1272,7 +1269,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) $outputlangs = $langs; $newlang = GETPOST('lang_id', 'alpha'); if (! empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1342,8 +1339,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' // Define vat_rate $vat_rate = str_replace('*', '', $vat_rate); - $localtax1_rate = get_localtax($vat_rate, 1, $object->client); - $localtax2_rate = get_localtax($vat_rate, 2, $object->client); + $localtax1_rate = get_localtax($vat_rate, 1, $object->thirdparty); + $localtax2_rate = get_localtax($vat_rate, 2, $object->thirdparty); // Add buying price $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); @@ -1370,8 +1367,8 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' $type = $product->type; $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min [$object->client->price_level]; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) + $price_min = $product->multiprices_min [$object->thirdparty->price_level]; $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); @@ -1403,7 +1400,7 @@ elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST(' if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1448,7 +1445,7 @@ else if ($action == 'up' && $user->rights->facture->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1470,7 +1467,7 @@ else if ($action == 'down' && $user->rights->facture->creer) { if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1546,11 +1543,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // Recipient was provided from combo list if ($_POST['receiver'] == 'thirdparty') // Id of third party { - $sendto = $object->client->email; + $sendto = $object->thirdparty->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property($_POST['receiver'], 'email'); + $sendto = $object->thirdparty->contact_get_property($_POST['receiver'], 'email'); $sendtoid = $_POST['receiver']; } } @@ -1692,7 +1689,7 @@ else if ($action == 'builddoc') // En get ou en post $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->client->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("", $conf); @@ -3670,7 +3667,7 @@ if ($action == 'create') if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang = $_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) - $newlang = $object->client->default_lang; + $newlang = $object->thirdparty->default_lang; if (!empty($newlang)) { diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 0677a725f74..ef5b4efab74 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -277,7 +277,7 @@ if ($action == 'add' && $user->rights->contrat->creer) $outputlangs = $langs; $newlang=''; if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$srcobject->client->default_lang; + if (empty($newlang)) $newlang=$srcobject->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -441,7 +441,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer) $prodcustprice = new Productcustomerprice($db); - $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->client->id); + $filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $object->thirdparty->id); $result = $prodcustprice->fetch_all('', '', 0, 0, $filter); if ($result) { From 1c39e7ecbdfe904d3447e50f0be5895e8fc9fb99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 17:11:18 +0200 Subject: [PATCH 373/502] Fix: Bad param --- htdocs/public/members/new.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5728e1ae5f5..c8628bd26a0 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -251,7 +251,7 @@ if ($action == 'add') $extralabels=$extrafields->fetch_name_optionals_label($adh->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels,$adh); - $result=$adh->create($user->id); + $result=$adh->create($user); if ($result > 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; From eee17589b254a87bc93278c5cdd679f785116b95 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 1 Aug 2014 18:22:39 +0200 Subject: [PATCH 374/502] Fix: Price by customer: a client must be able to have multiple products with customer prices --- htdocs/product/price.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9c0597ec0f6..a28fbd83706 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2014 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -816,7 +817,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print '' . $langs->trans('ThirdParty') . ''; print ''; - print $form->select_company('', 'socid', 's.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price)', 1); + print $form->select_company('', 'socid', 's.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price WHERE fk_product='.$object->id.')', 1); print ''; print ''; From be76fd93fdffba84f75b878279f6da07193cc7e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 1 Aug 2014 22:24:25 +0200 Subject: [PATCH 375/502] New: Add user of creation and validation on invoice export --- htdocs/core/modules/modFacture.class.php | 14 +++++++++----- htdocs/langs/en_US/other.lang | 10 ++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 7b8d8d355ff..02a3972e05d 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -177,11 +177,11 @@ class modFacture extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; - $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); + $this->export_permission[$r]=array(array("facture","facture","export","other")); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; @@ -221,6 +221,8 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facturedet as fd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; @@ -232,10 +234,10 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture'"; @@ -275,6 +277,8 @@ class modFacture extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiement as p ON pf.fk_paiement = p.rowid'; diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 6a8fdd730c9..6758b2b482e 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -80,6 +80,16 @@ ModifiedBy=Modified by %s ValidatedBy=Validated by %s CanceledBy=Canceled by %s ClosedBy=Closed by %s +CreatedById=User id who created +ModifiedById=User id who made last change +ValidatedById=User id who validated +CanceledById=User id who canceled +ClosedById=User id who closed +CreatedByLogin=User login who created +ModifiedByLogin=User login who made last change +ValidatedByLogin=User login who validated +CanceledByLogin=User login who canceled +ClosedByLogin=User login who closed FileWasRemoved=File %s was removed DirWasRemoved=Directory %s was removed FeatureNotYetAvailableShort=Available in a next version From 6a815dd5856f1fcf197344912ed3420a0465b66b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Aug 2014 00:34:15 +0200 Subject: [PATCH 376/502] Fix: external link is visible when a module is using tabhelp of dictionary. --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 654d8cf10ba..7075b601877 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -818,7 +818,7 @@ if ($id) if ($valuetoshow != '') { print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/http:/i',$tabhelp[$id][$value])) print ''.$valuetoshow.''; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); else print $valuetoshow; print ''; From 250e8aacafea4257b0de9c408f32367794c1475b Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 2 Aug 2014 09:58:23 +0200 Subject: [PATCH 377/502] Update company.lib.php --- htdocs/core/lib/company.lib.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index bd5f19e2401..88443ba2ad5 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -64,13 +64,21 @@ function societe_prepare_head($object) $h++; } - if (($object->localtax1_assuj || $object->localtax2_assuj) && (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) ) - { - $head[$h][0] = DOL_URL_ROOT.'/societe/localtaxes.php?socid='.$object->id; - $head[$h][1] = $langs->trans("LocalTaxes"); - $head[$h][2] = 'localtaxes'; - $h++; - } + if (! empty($conf->global->MAIN_SUPPORT_CONTACT_TYPE_FOR_THIRDPARTIES)) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Contact"); + $head[$h][2] = 'contact'; + $h++; + } + + if (($object->localtax1_assuj || $object->localtax2_assuj) && (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) ) + { + $head[$h][0] = DOL_URL_ROOT.'/societe/localtaxes.php?socid='.$object->id; + $head[$h][1] = $langs->trans("LocalTaxes"); + $head[$h][2] = 'localtaxes'; + $h++; + } if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) { From 83b27c33d8a9989a087cbdc0e44dd7face3f7a39 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 2 Aug 2014 10:03:53 +0200 Subject: [PATCH 378/502] add contact tabs on company appair only if MAIN_SUPPORT_CONTACT_TYPE_FOR_THIRDPARTIES is enabled display on tabs adherent list of company --- htdocs/societe/societecontact.php | 325 ++++++++++++++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 htdocs/societe/societecontact.php diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php new file mode 100644 index 00000000000..f02a0cb0b0a --- /dev/null +++ b/htdocs/societe/societecontact.php @@ -0,0 +1,325 @@ + + * Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2014 Charles-Fr Benke + * + * 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 . + */ + +/** + * \file htdocs/societe/societecontact.php + * \ingroup societe + * \brief Onglet de gestion des contacts additionnel d'une socit + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +$langs->load("orders"); +$langs->load("companies"); + +$id=GETPOST('id','int'); +$ref=GETPOST('ref','alpha'); +$action=GETPOST('action','alpha'); + +// Security check +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $id,''); + +$object = new Societe($db); + +/* + * Ajout d'un nouveau contact + */ + +if ($action == 'addcontact' && $user->rights->societe->creer) +{ + $result = $object->fetch($id); + + if ($result > 0 && $id > 0) + { + $contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + } + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $langs->load("errors"); + $mesg = '
'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'
'; + } + else + { + $mesg = '
'.$object->error.'
'; + } + } +} + +// bascule du statut d'un contact +else if ($action == 'swapstatut' && $user->rights->societe->creer) +{ + if ($object->fetch($id)) + { + $result=$object->swapContactStatus(GETPOST('ligne')); + } + else + { + dol_print_error($db); + } +} + +// Efface un contact +else if ($action == 'deletecontact' && $user->rights->societe->creer) +{ + $object->fetch($id); + $result = $object->delete_contact($_GET["lineid"]); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + dol_print_error($db); + } +} + +else if ($action == 'setaddress' && $user->rights->societe->creer) +{ + $object->fetch($id); + $result=$object->setDeliveryAddress($_POST['fk_address']); + if ($result < 0) dol_print_error($db,$object->error); +} + +/* + * View + */ + +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$langs->trans("ThirdParty"),$help_url); + + +$form = new Form($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); +$contactstatic=new Contact($db); +$userstatic=new User($db); + + +/* *************************************************************************** */ +/* */ +/* Mode vue et edition */ +/* */ +/* *************************************************************************** */ +dol_htmloutput_mesg($mesg); + +if ($id > 0 || ! empty($ref)) +{ + $langs->trans("OrderCard"); + + if ($object->fetch($id, $ref) > 0) + { + $soc = new Societe($db); + $soc->fetch($object->socid); + + $head = societe_prepare_head($object); + dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"),0,'company'); + + print '
'; + print ''; + print ''; + print ''; + print ''; + + if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field + { + print ''; + } + + if ($object->client) + { + print ''; + } + + if ($object->fournisseur) + { + print ''; + } + print '
'.$langs->trans('ThirdPartyName').''; + print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom'); + print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
'; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
'; + print '
'; + + // Contacts lines (modules that overwrite templates must declare this into descriptor) + $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); + foreach($dirtpls as $reldir) + { + $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); + if ($res) break; + } + + // additionnal list with adherents of company + if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) + { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + + $membertypestatic=new AdherentType($db); + $memberstatic=new Adherent($db); + + $langs->load("members"); + $sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,"; + $sql.= " d.datefin,"; + $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; + $sql.= " t.libelle as type, t.cotisation"; + $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d"; + $sql.= ", ".MAIN_DB_PREFIX."adherent_type as t"; + $sql.= " WHERE d.fk_soc=".$id; + + dol_syslog("get list sql=".$sql); + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + + if ($num > 0 ) + { + $titre=$langs->trans("MembersListOfTiers"); + print '
'; + + print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,''); + + print ""; + print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); + print "\n"; + + $var=True; + $i=0; + while ($i < $num && $i < $conf->liste_limit) + { + $objp = $db->fetch_object($resql); + + $datefin=$db->jdate($objp->datefin); + $memberstatic->id=$objp->rowid; + $memberstatic->ref=$objp->rowid; + $memberstatic->lastname=$objp->lastname; + $memberstatic->firstname=$objp->firstname; + + $companyname=$objp->company; + + $var=!$var; + print ""; + + // Ref + print "\n"; + + // Lastname + print "\n"; + + // Login + print "\n"; + + // Type + $membertypestatic->id=$objp->type_id; + $membertypestatic->libelle=$objp->type; + print ''; + + // Moral/Physique + print "\n"; + + // EMail + print "\n"; + + // Statut + print '"; + + // End of subscription date + if ($datefin) + { + print ''; + } + else + { + print ''; + } + + print "\n"; + $i++; + } + print "
"; + print $memberstatic->getNomUrl(1); + print "rowid\">"; + print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); + print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); + print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); + print "".$objp->login."'; + print $membertypestatic->getNomUrl(1,32); + print '".$memberstatic->getmorphylib($objp->morphy)."".dol_print_email($objp->email,0,0,1)."'; + print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); + print "'; + print dol_print_date($datefin,'day'); + if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate")); + print ''; + if ($objp->cotisation == 'yes') + { + print $langs->trans("SubscriptionNotReceived"); + if ($objp->statut > 0) print " ".img_warning(); + } + else + { + print ' '; + } + print '
\n"; + } + } + } + } + else + { + // Contrat non trouve + print "ErrorRecordNotFound"; + } +} + + +$db->close(); +llxFooter(); +?> \ No newline at end of file From f4738dc1d49e3c1253bed21b27820d3d47b101b6 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 2 Aug 2014 10:21:00 +0200 Subject: [PATCH 379/502] Update societecontact.php --- htdocs/societe/societecontact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index f02a0cb0b0a..42519bb13e1 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -22,7 +22,7 @@ /** * \file htdocs/societe/societecontact.php * \ingroup societe - * \brief Onglet de gestion des contacts additionnel d'une socit + * \brief Onglet de gestion des contacts additionnel d'une société */ require '../main.inc.php'; @@ -322,4 +322,4 @@ if ($id > 0 || ! empty($ref)) $db->close(); llxFooter(); -?> \ No newline at end of file +?> From 21168308af4c030944ba08699b2c78890a04609e Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 2 Aug 2014 10:53:19 +0200 Subject: [PATCH 380/502] Update societecontact.php --- htdocs/societe/societecontact.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 42519bb13e1..c473bd27d32 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -319,7 +319,7 @@ if ($id > 0 || ! empty($ref)) } } - $db->close(); llxFooter(); -?> + +?> From bc478a75ee571404371d155bc15f90c7d674d885 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sat, 2 Aug 2014 11:34:29 +0200 Subject: [PATCH 381/502] Update societecontact.php --- htdocs/societe/societecontact.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index c473bd27d32..60e114be6a5 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -321,5 +321,3 @@ if ($id > 0 || ! empty($ref)) $db->close(); llxFooter(); - -?> From 9eab1f51cc51a6d9cc07c99b1eb72d56f6b56063 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Aug 2014 17:27:45 +0200 Subject: [PATCH 382/502] Fix: remove debug output --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 5cfad135973..fdb5a26109e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -434,7 +434,7 @@ function isValidUrl($url,$http=0,$pass=0,$port=0,$path=0,$query=0,$anchor=0) { $ValidUrl = 1; } - print $urlregex.' - '.$url.' - '.$ValidUrl; + //print $urlregex.' - '.$url.' - '.$ValidUrl; return $ValidUrl; } From 8ed21f606ec788949a07d330222e4da50299c949 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Aug 2014 21:16:43 +0200 Subject: [PATCH 383/502] Qual: states are linked to regions. --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ htdocs/install/mysql/tables/llx_c_departements.key.sql | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index e8d4de8a9fa..5ce56d30b9d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -918,3 +918,5 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); +DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_regions IS NOT NULL; +ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); diff --git a/htdocs/install/mysql/tables/llx_c_departements.key.sql b/htdocs/install/mysql/tables/llx_c_departements.key.sql index 0d8459c1ba0..4c8ceb42582 100644 --- a/htdocs/install/mysql/tables/llx_c_departements.key.sql +++ b/htdocs/install/mysql/tables/llx_c_departements.key.sql @@ -19,5 +19,7 @@ ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_region); - ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); + +ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); + From 331cb38a10ed97069b9216a74eb99e9aea8f77ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Aug 2014 21:56:39 +0200 Subject: [PATCH 384/502] A little clean of tables. --- .../install/mysql/migration/3.5.0-3.6.0.sql | 2 +- .../install/mysql/migration/3.6.0-3.7.0.sql | 25 ++++++++++ htdocs/install/mysql/migration/repair.sql | 49 ++++++++++++++++--- .../mysql/tables/llx_c_email_template.sql | 9 +++- htdocs/install/mysql/tables/llx_texts.sql | 34 ------------- 5 files changed, 75 insertions(+), 44 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_texts.sql diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index cf9563be554..33301e5efe9 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -38,7 +38,7 @@ create table llx_c_email_templates ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id - type_template varchar(32), -- template for wich type of email (send invoice by email, send order, ...) + type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...) datec datetime, label varchar(255), content text diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 5ce56d30b9d..4f4a2440880 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -919,4 +919,29 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_regions IS NOT NULL; + + +DROP TABLE llx_texts; + + +DROP TABLE llx_c_email_templates; +CREATE table llx_c_email_templates +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + module varchar(32), -- Nom du module en rapport avec le modele + type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...) + sortorder smallint, -- Ordre affichage + + private smallint DEFAULT 0 NOT NULL, -- Template public or private + fk_user integer, -- Id utilisateur si modele prive, sinon null + datec datetime, + tms timestamp, + + label varchar(255), + content text +)ENGINE=innodb; + + + ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index a172b83a99b..c6fcfc06ce6 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -108,14 +108,6 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps -- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); --- Requests to clean old tables or fields - --- DROP TABLE llx_c_methode_commande_fournisseur; --- DROP TABLE llx_c_source; --- DROP TABLE llx_cond_reglement; --- DROP TABLE llx_expedition_methode; --- DROP TABLE llx_product_fournisseur; --- ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; @@ -150,3 +142,44 @@ drop table tmp_societe_double; UPDATE llx_projet_task SET fk_task_parent = 0 WHERE fk_task_parent = rowid + + + + +-- Requests to clean old tables or external modules tables + +-- DROP TABLE llx_c_methode_commande_fournisseur; +-- DROP TABLE llx_c_source; +-- DROP TABLE llx_congespayes; +-- DROP TABLE llx_congespayes_config; +-- DROP TABLE llx_congespayes_log; +-- DROP TABLE llx_congespayes_events; +-- DROP TABLE llx_congespayes_users; +-- DROP TABLE llx_compta; +-- DROP TABLE llx_compta_compte_generaux; +-- DROP TABLE llx_compta_account; +-- DROP TABLE llx_cabinetmed*; +-- DROP TABLE llx_cond_reglement; +-- DROP TABLE llx_expedition_methode; +-- DROP TABLE llx_product_fournisseur; +-- DROP TABLE llx_element_rang; +-- DROP TABLE llx_dolicloud_customers; +-- DROP TABLE llx_dolicloud_emailstemplates; +-- DROP TABLE llx_dolicloud_stats; +-- DROP TABLE llx_submitew_message; +-- DROP TABLE llx_submitew_targets; +-- DROP TABLE llx_submitew_targets_param; +-- DROP TABLE llx_pos_cash; +-- DROP TABLE llx_pos_control_cash; +-- DROP TABLE llx_pos_facture; +-- DROP TABLE llx_pos_moviments; +-- DROP TABLE llx_pos_ticketdet; + + + + + + + + + diff --git a/htdocs/install/mysql/tables/llx_c_email_template.sql b/htdocs/install/mysql/tables/llx_c_email_template.sql index b3f8ca1e1e0..9390f934bc3 100644 --- a/htdocs/install/mysql/tables/llx_c_email_template.sql +++ b/htdocs/install/mysql/tables/llx_c_email_template.sql @@ -21,8 +21,15 @@ create table llx_c_email_templates ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id - type_template varchar(32), -- template for wich type of email (send invoice by email, send order, ...) + module varchar(32), -- Nom du module en rapport avec le modele + type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...) + sortorder smallint, -- Ordre affichage + + private smallint DEFAULT 0 NOT NULL, -- Template public or private + fk_user integer, -- Id utilisateur si modele prive, sinon null datec datetime, + tms timestamp, + label varchar(255), content text )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_texts.sql b/htdocs/install/mysql/tables/llx_texts.sql deleted file mode 100644 index 9e667120287..00000000000 --- a/htdocs/install/mysql/tables/llx_texts.sql +++ /dev/null @@ -1,34 +0,0 @@ --- ============================================================================ --- Copyright (C) 2007-2009 Laurent Destailleur --- --- 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 . --- --- ============================================================================ - -create table llx_texts -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - - module varchar(32), -- Nom du module en rapport avec le modele - typemodele varchar(32), -- Type du modele - sortorder smallint, -- Ordre affichage - - private smallint DEFAULT 0 NOT NULL, -- Modele publique ou prive - fk_user integer, -- Id utilisateur si modele prive, sinon null - title varchar(128), -- Titre du modele - filename varchar(128), -- Nom fichier si modele fichier - content text, -- Texte si modele texte - - tms timestamp -)ENGINE=innodb; From c11ff57fbe2b43f3914ea97f9e1058d89859be20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Aug 2014 11:17:24 +0200 Subject: [PATCH 385/502] Fix: The type is a code so must not contains any space. Fix: State is not linked to region. --- .../install/mysql/data/llx_10_c_regions.sql | 2 +- htdocs/install/mysql/data/llx_accounting.sql | 1052 ++++++++-------- .../install/mysql/migration/3.6.0-3.7.0.sql | 1058 ++++++++--------- 3 files changed, 1055 insertions(+), 1057 deletions(-) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index f8cf6e6618f..2b8b5f92dea 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -32,7 +32,7 @@ -- Regions -- -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1,0,0,'0',0,'-'); +insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (0,0,0,'0',0,'-'); -- Regions France (id country=1) insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 101, 1, 1,'97105',3,'Guadeloupe'); diff --git a/htdocs/install/mysql/data/llx_accounting.sql b/htdocs/install/mysql/data/llx_accounting.sql index 6c19c76f2a4..afc70f08a9f 100644 --- a/htdocs/install/mysql/data/llx_accounting.sql +++ b/htdocs/install/mysql/data/llx_accounting.sql @@ -1430,10 +1430,10 @@ INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) V INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4001,'PCG08-PYME','FINANCIACION', 'XXXXXX', '1', '', 'Financiación básica', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4002,'PCG08-PYME','ACTIVO', 'XXXXXX', '2', '', 'Activo no corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '', 'Existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS Y GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS_GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', '1'); @@ -1687,525 +1687,525 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4257, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '394', '4252', 'Deterioro de valor de los productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4258, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '395', '4252', 'Deterioro de valor de los productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4259, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501,'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 4f4a2440880..59e63eda9b8 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -137,10 +137,10 @@ INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) V INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4001,'PCG08-PYME','FINANCIACION', 'XXXXXX', '1', '', 'Financiación básica', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4002,'PCG08-PYME','ACTIVO', 'XXXXXX', '2', '', 'Activo no corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '', 'Existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS Y GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS_Y_GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', '1'); @@ -394,531 +394,528 @@ INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4257, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '394', '4252', 'Deterioro de valor de los productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4258, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '395', '4252', 'Deterioro de valor de los productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4259, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES Y DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501,'PCG08-PYME','COMPRAS Y GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS Y GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS E INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); -INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS E INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); - - -DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_regions IS NOT NULL; +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS_Y_GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); +INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1'); DROP TABLE llx_texts; @@ -943,5 +940,6 @@ CREATE table llx_c_email_templates )ENGINE=innodb; - +UPDATE llx_c_regions SET rowid = 0 where rowid = 1; +DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0; ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); From 12ff7a8af5508a30497fd31f6cfa0f75b5e87372 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Aug 2014 11:18:32 +0200 Subject: [PATCH 386/502] Look: Refresh install style with more neutral colors. Select line style is now stored into css. Removed all images for install process. --- htdocs/cache.manifest | 1 - htdocs/install/background.png | Bin 229 -> 0 bytes htdocs/install/check.php | 4 ++-- htdocs/install/default.css | 35 ++++++++++++++++++----------- htdocs/install/headbg.jpg | Bin 7881 -> 0 bytes htdocs/support/default.css | 2 +- htdocs/theme/eldy/style.css.php | 38 ++++++++++++++++++++++++++++++++ 7 files changed, 63 insertions(+), 17 deletions(-) delete mode 100644 htdocs/install/background.png delete mode 100644 htdocs/install/headbg.jpg diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest index 34782a02141..e46443bb86b 100644 --- a/htdocs/cache.manifest +++ b/htdocs/cache.manifest @@ -13,7 +13,6 @@ support/ support/index.php support/online.php -support/background.png support/default.css support/dolibarr_logo2.png support/headbg.jpg diff --git a/htdocs/install/background.png b/htdocs/install/background.png deleted file mode 100644 index b264649fcbc26d7774496d1d9c308841c69c769f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^j6j^i!3-n|KCJ=?Bn0?`xPE|vk6`c#3_gRw7clq= z2H(KoI~e=`gP&mV3k-gP!5=XA3kLtd;Q#;sTZBT60PS+{ba4!+n4^2JQ^+X*$PF)Q zxfAl`e|_egJ$GNo-}UFOulu`WckAlz&65{5?|r{v^VW~4xv80gc4up6%$y}59iy4b W#yEA_)mK2X7(8A5T-G@yGywnt^o;)i diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 063fefd62e0..d815d67dd59 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -57,7 +57,7 @@ pHeader('',''); // No next step for navigation buttons. Next step is defined //print "
\n"; //print $langs->trans("InstallEasy")."

\n"; -print ''.$langs->trans("MiscellaneousChecks").":
\n"; +print '

'.$langs->trans("MiscellaneousChecks").":

\n"; // Check browser $useragent=$_SERVER['HTTP_USER_AGENT']; @@ -440,7 +440,7 @@ else } } - $choice .= ''; + $choice .= ''; $choice .= ''.$langs->trans("Upgrade").'
'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'
'; $choice .= ''; $choice .= $langs->trans("UpgradeDesc"); diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 0c550cd1119..7ba1a9b136b 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -18,9 +18,8 @@ body { font-size:13px; -font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; -background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; -/* background-color: #F4F4F4; */ +font-family: Verdana, Arial, Helvetica, Tahoma, sans-serif; +background: #f6f6f6; margin: 15px 30px 10px; } @@ -33,8 +32,8 @@ span.titre { font-size: 1.1em; font-weight: bold; background: #FFFFFF; -color: #4965B3; -border: 1px solid #8CACBB; +color: #444; +border: 1px solid #999; padding: 5px 5px 5px 5px; margin: 0 0 0 0; } @@ -45,8 +44,8 @@ font-weight: bold; color: #4965B3; padding: 0 1.2em 0.5em 2em; margin: 1.2em 1.2em 1.2em 1.2em; -border-bottom: 1px solid #8CACBB; -border-right: 1px solid #8CACBB; +border-bottom: 1px solid #999; +border-right: 1px solid #999; text-align: right; } @@ -71,10 +70,13 @@ input:-webkit-autofill { } table.main { -background: #F0F0F0 url(background.png) repeat-x; +background: #FfFfFf; text-align: left; -border: 1px solid #8CACBB; +border: 1px solid #999; color: #000000; +-webkit-box-shadow: 3px 3px 4px #DDD !important; +-moz-box-shadow: 3px 3px 4px #DDD !important; +box-shadow: 3px 3px 4px #DDD !important; } table.main-inside { @@ -89,7 +91,7 @@ table.listofchoices, tr.listofchoices, td.listofchoices { border-collapse: collapse; padding: 4px; color: #000000; -border: 1px solid #888888 !important; +border: 1px solid #999 !important; } tr.listofchoices { @@ -104,8 +106,8 @@ tr.listofchoices { .installchoices table tr td { margin-left: 2px; margin-right: 2px; -border-bottom: 1px solid #8CACBB; -border-right: 1px solid #8CACBB; +border-bottom: 1px solid #999; +border-right: 1px solid #999; color: #000000; } @@ -178,6 +180,7 @@ margin-top: 10px; font-size:16px; font-weight: normal; color: #4965B3; +text-shadow: 2px 1px 2px #c0c0c0; } tr.bg1 { @@ -212,7 +215,7 @@ font-size: 12px; .install { -border: 1px solid #8CACBB; +border: 1px solid #999; padding: 4px 4px 4px 4px; } @@ -246,3 +249,9 @@ ul { a.button:hover { text-decoration:none; } + +.choiceselected { +background-color: #dfd; +background-repeat: repeat-x; +background-position: top left; +} diff --git a/htdocs/install/headbg.jpg b/htdocs/install/headbg.jpg deleted file mode 100644 index 5491c6e4acbc576eb5397d1091fdd7ea7e03de00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7881 zcmd5>hhGzEw;r-&g`liJXf7ZiAqhQUQBb-BOh8BiYEX(0LkWsh1yMm3ltdQRkc48S zgwT{CRVk|yFi3*1R0Xlnq=^L)7Ztd}e)rzr{S)paTVr#im*1_U&k5Cv|UKzz_MK;VTr;laW z@AP8DyZXKBwGE(hf>A*Mdl)eve#Q1;5_6REzK&|kMcMq=QBlzM=9%o@ z<+;B2FTWhsv=mx~)rMMc0(_>f%A{h{3I|)u{Pc5|(F|8%!~2BNh{#T4oVyro!_Qq` z{$QxNw}B!&o~~l%tGnZ5x&Ip|VVMV7HiGNl|HIPKKyO4b(&8|IUBgc<h9L*F8GhF8r2l>gVhYt+ceXH|$&(C3#YDUBCYA@ifx`w`cLC*oBGAO(08Y zM4Z^QE9kSNty|M1J|^QP>334PvHe|QW@EN$TroV3>#GCgb_qylXtKz5%h@8LBQE?5*}ZHL-fQ``cPrZmyBXDoH68+ z1~!@09WB>z^H;}l4LHf3jP9nbbKBr-75}?LX&4&CzY%`2+33FioJM;Xji+Ix_f^}o z!QALc-HGmH%=&vBiIz^FiQjl&ZJI(kUR8Lc=4#ZEsU53IUvoe49gF}=YJB*sU%Idee#H$&NGqHj7NJ;2H-YNG#oug*KXww||# z!R%1p;|@;7bW2RpkeA905=|Kj>31YZTb(evPxzgJg!d!i!}^L$ef6BfXOM~&<$b8- z`OM?iEzTsHl90lWS$NBDhjKHPoJNsROo~%J;?PY4)*6zFWpeM{OwB;lNT0{*Dxs<9 zrZbh8=BCeLetvlA>4~ep-c$GP)szip@jEGb zp~d7*g&+q6!Q<*C0$V)&;blUkRcxb;ognm$9}t z9Rh_%dDDdaWby#XUZ&gv<{-ot+6u6vHn0!-47*Gwuu$@_Vo zoA26@^nerqSFi`nHt zUgP=DXr(23SUmf~uP4xqnPxH&+^L}a5=;nAhp9aRs(G*HkC=42l5MG_i@AsGrHgfW z^Ic!|6mvb}U7Ix3t{oEX5w7C<)IOMaUrfu;HD)Z#W`_vYXWJ@c#?sN{?bKbq0d#qB zYJ0?Sw?6)CfBf#+@8DAz?VVspU9~$)n?9reS?iZ>+w8b~qGKVe_qIVD-OcD(3_RY& zc4XQ2j!;Crx9Z*A?xJm=EbClBCQIRD&B&x40(fb}qR5$ZjO8|MBAbMFjh3bv);1V- zRw3X~DijpL0jKfEn^vg;MWB*}`LcOI33`8eoWiMhX$D;$5ldav`$~D2Wuoc5o}+T0 zbz-!Lbds$M=gaPd18V)hSsXr07QD5tnm)r?S~(-9?$3F#bk6rW!-9ct&uvGl2L+%6 zC0*!iJ{NA-yqF}HqxF$OXHU(sRsiC9-?@6C&nS#r%sZz3#`~SWe7r?0f7sz1=fQa)y9qRhsek_YVMLyX;BOwy;8>2yrC*I` zwqxnpA?zH+VRA&UcS=rBw#KaLp#`U};RZN-8do1(&S|tq959VpGIsMZS9r5ztSt1{ zIg^bI$lUvvPvbSM0{08eKC2fd_o$UCR+TfO7QRfWKhug{>GCMz#-AO&S>WNK)@AKv zz4qhgtqYM2r8e7JvhI$I@<4o1k?OVPL#1Q!M9GE>0{BU^Es?#0VCtXqN#KeE|m`VkH8J-NgHngiK~3n}|3 z;0K^k_JTWL-pncpYY=XDM6^0pJtE5D;9Hl(ncQmfw~r}Q2gmiMr^1OuZqxD3N@;U! zAGZjhmrA{3ks`_L>iat4$4EhWHs~3u_bGnv({nI;=GywV005v#0Pu@3!k7$qL%^f8 z4&`PVJIA|lGOEGA*VqP>FFJiq%_voD4X{1Rzt~c6p$)LRa8mIJrA2?_|k<=Rndy_Ku-88?yTeXzXE&v&T_4dCzp%D-H8 z!lcwcvt+&dLFPd%o`3vj>|cHlG*NHkS3Y;fUOr~!r*>f#ESZ)ulYE_lAk6h_`7*J{ zvMV=&*K!NL@=8Yzx1OQml1m3HGvjQf6GI@aP24^=QL1Zpx3=GBAEf2*O_gHAUA?MbE8>;Ik$)z&l z6X{iPT&xgTuk;57WA;iDpYi_rjJjsVyyXpB_8M!_Puxw|+qVh0_W#rNVfa?vCNMZ? zksjT7P%^xBzjHC=j0tJ&!eG3QOWA2#YZvUIg2LFYLNBNzTh6HAd7XqcT_-WB6ZX2Y zB;SncCc*&#BC#vXM(~UgG7kqNC%lR&VD6haZPa{%0hz03KHbq+V5g_G9S@?dnxFWM8{UZmA96K*BYkNNqq1Wzk z6vQr=>y2pabKFmhG|d+o)#k5uF+>UYzQ%fn+ubH44CED0C-TSlJ87`Fg?f)Gl}0h% zdHFuez2UVnqHwjojGn3Vp6HoD4a0TQ*bLbmk%`ak3-x_!o50dYuvWe;U+Z-JLhP)M zWmivY%mvGp;0C>}hK3o`k8x#T0g2MF_Q{n8k_J;4i>p~I9FanS|RN){V=YpBJOv+)0Bkg7G zOrY$kG;jZ3RHB=rjaq&jf91ze2(Z5GdX0Qm-zobt`*KyeJs@=w04OzD6_zFVo?mH8 z<$b1MYf;O!!(Vr}9NTTEK4nO<5e!?P1OoIH{UZbg1O};?=j6Y?G4gds=ahBlJ#`Px zB&AOk%@D=KcG>E_VBooDxqPn&_$$cNt5gHFM5FE--7JlHIDSHZjFH+((GTMq#y2m` zSJtKLbh)+E$46$CT@1vCS`R*bwsx^s6ZHaVoBdc~eQ)vbx=qeRh5`vLcmg1}QD6tv zxatIl6SwIWCVI?wcSm_A;?^}Zb`NA6f$#~3$)zf9ca)s_wl|f*P=?7n9cM{kDK&Ma za{M7HyHO{hS5h>s>Iy!lNhKoD-4zEW3KXAd4|*k+L+L$g&Y4RV(ZG-sMH@154#*i3Po|^SLV~@t7N)68pNp3UBAMN*QnmJpE}I=&{63|a91#z zNqMF@Si&WVh>OR%iR`~}c@=hg=MF7I4fndL)GEBJk#WQJlAcz&9*bht@9%nnN$njy zA7=e&ek$Jesrm4l5@q9l;?j%azdK4aTx?$wjpXc&j2g!FbhkO4T{&x;6~Fh%i#?~W zOGcZVM-xoeqZ}j!IM1UUu{oTew+@ITb;8!Uf~4I43XFld_>$|NfJ*{y`7Jz=rBy z!(H0N{x`$mj1f^$_iUeq?)~P=cg+l22i_2@{9H}+Hm)JJLG>%hQLS!9r<#s4%mD3@ zq$^>xKfyMY(pI=F){Y@e;=ze*qK+%xjC7Plt2|YUF<=`&isW|UrB|Iot`$r_ops+< zR$r!^;&??*$;21G?sKKmD*GZ1kP1K(0V#WzE{6DFH`P`UT~GOu-uBtJ>q**&9f?B$ zuj1(Y|M3V7yBL%xR++q5>81$X8Lx+cp)CwRa;kzYI2FwHI9Ghf>@vPUPF*;jV9AOQ zCqAx>l4xPCRwHXIot_TNJ5l$J+%R_0EJUa;e4&=5_ef@9TSmWNb04S{DVdww>ZI56 z!UO#>uRPlXSXA_+zx#m%dlv4*`w=J0o2<%EKaPXui z2njD9J!c>%CYB`0RN(X;LE&UL(YU*AEKT~ite2%UnfGNO_cAN?@g%?9$Ib3sl~Htb zYmSXCvwbu_a4iG@2kNd6Aw%}W-G=^dy>@uD*D*ZZ_0n2%yyb=WdA+~YT6N`~)vAu{ zh+Gar=7ih2+aAwoQkp4Wpn}9lY||KN#*;(i^&DA|I5>3!Os| zuXbY-f>l;xW;G^1+=^{{0~(8;c{(o?#rG#gXwvK+itb@gXYUQ2Wn2`x}T~E zhF*CBH3oTI1PSMWuNfQS@k+#_i8yXavH{!;P9~D@D);mUPJ^7V>+S|f38Up`U_0Z0 z$NTVvOJ=pKPG+hGH$u0}tSJ(KAQu{^BH$dvz{_Ml1F8F*bf}z228d9oR2Z$QCM7f% zPf1QFjRtd{Z}0m8Ez<)ZSDwgPSGsJMT#f#YEnghS(6omP;RIf)V$@E1VC`FdmEI)1 zXJRFcw3LY{yy*Vr|msaVOmN?p@|_&XIzepSjI+0q3#Xpwe>fm&7H^8fH>g)#O3H$ZLk{nPn^Uj??WQzP>vv+c_?O z_ra-)Jr|mt%{%`hgDZc#Q=?Ltx$O9)oE58ts&u3rRs8#wCB5M@VKB6T`w^oz9*vFeGup~h_COMxcz4JJ*8b{f#xhM++0^vJ4s53TSr<{}$jh=8 zh@q0HbstuC^mWPT-vC@^>j)sO5ijz@TO6k8>UWCP&a`mv1TGn+B;F=fjb3x@t+rh*_!~n zcAw3R!7*=q>aYc+sfp4Zj4FWo)6(PdOiqU}wvG11)>M){iIKEEJFmK3(6P@ZFD(`I zhR3(AU(>NO9k`5N$;!t!U6%A-EVx%!x9atsRW|xP!R~D6_XKW@Y0&8ReLd;R{@vLn z8D#?-hy1(c+6bNP5lsj<38$N?t&v*J)WLz|j_igoHESh^5?$3DKY^65J6Q4I-!Ou{ zVoA8G|H62Cup)8Wwiv5b|3!jq3^cMclqeTm$hV)eLm-jd{o(*-y%ErJy%f(g%Ne2xFj4zW}Bvx6Hm!&sNVvq z5(BpShduoT!!cK5W@5N8DbHF$!d6-mf)6#92m6=gvpr4?1cv4c6OdEo&6_|6=IW?Z z!X>S254S*FbYImir_S^7*yem1^RN{XJ~SL_aK^&Bi-l?6g$xywb*Xhj?Mh4GHYQeH z4{ACVM3?sGe_SEEVYs%QIqzHDR+H-r(1JeBkBAlrHOEES+lwo765bzoNm+{pwmTLU zhcEx(dC-%bowE!!gx%`v7V7Qlj-z1#I53XdP$*BsSmy@}jRu=YfP|Is zc!yvBB$gUgJX1s}sI9`IuCH6+_%|Gx1gTIt{zM!M1$gn3P(@Oqfy%iuF!hD021{Dz z56;e&E(IwEJ$?5}?!8_OWGA22Ddio20ob|AR6HvD2~=_`D)lQWZin;=CP8tsw4%at z*T=jpCOr>SDJ}J;g!HUGaJ7~__dc~GF1z(z3x9CrdUsFf=hFkd+eLE4`=6SWK3uaX z&IZGyUzV^Z}_5H8h-(SD#cFKIr}}M($WRI2YPuR^22;E*L=Ie;hYkpPmM zm!_D&Z?}2ug1)}+x{SE9rOUS zJC}@R%Qzi#F)jbhDnv_aV#?&3j@PS#)yYj6Gv?8qk9n7QBa?SLVO0FkQKP;&mkr>;f!PeP}58mxK z$!7(C(hfFxF{5x995_+>w>s_j)+D<1%*U@5&)Ar-JlEvYb1tp z%OOtLM$K$~s>muf6;Nbvg+K}bW3bgrfDHxjFc=7amZw*-*AS1a+e|M;`NowZe~x8E zHU;m(caESzK%W}6DE9O`!n>U17-_M!Vq$cW>WqX7z7$^IEbGGko+0zTuxlTS|CEX&pa4P1bS=Tb9;e`x z3UH~YmazLWm6BUgaKeN}%a)5Et1SVC0w5sK0YkfM3-zTXdcq^7hCerD{ce7x65Mh- z1eA`MA~bj7HdSzhD2m(%W(KbbJ3qd^-k_I{j-%>fnB62Gf4r7z-iIhU9 zb|JzTf`YRRz)b)kol^cg`)fG1oUV@`JCYMH;617x0XvfZ^#LGmVV0Q+p7y`JxJ@U~ z8#q5#&Vh34ZSnx9ebd8Mz`0acsGR_BQiR`Dq=?mdXDsOY)cVMR#xePYtwaAq_(;uu7}A6wOyGcHkv({JB0z)`5)Du? zw9#IsPeKbs-wL7$;pKiDKN)%+WSU3qMB z(*N!SC!)4kFbV)j_E6AS08W$wceDo&A>qJa5P@;E!mi-pL;wXb lFn}ee!L$qi=iK0@3?G~|AX6ywe>eW0|NlRI{bh6XzW{0BliC0P diff --git a/htdocs/support/default.css b/htdocs/support/default.css index 1d540096f10..d535ab0ea70 100644 --- a/htdocs/support/default.css +++ b/htdocs/support/default.css @@ -147,4 +147,4 @@ background: #DDDFDD; } table { font-size: 12px; } -table.login { border: 1px solid #C0C0C0; background: #F0F0F0 url(background.png) repeat-x; font-size: 12px; } +table.login { border: 1px solid #C0C0C0; background: #F0F0F0; font-size: 12px; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a2903630378..319a58131ab 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2068,6 +2068,44 @@ div.titre { #tablesubscribe { width: 100%; } +/* + * Effect Postit + */ +.effectpostit +{ + position: relative; +} +.effectpostit:before, .effectpostit:after +{ + z-index: -1; + position: absolute; + content: ""; + bottom: 15px; + left: 10px; + width: 50%; + top: 80%; + max-width:300px; + background: #777; + -webkit-box-shadow: 0 15px 10px #777; + -moz-box-shadow: 0 15px 10px #777; + box-shadow: 0 15px 10px #777; + -webkit-transform: rotate(-3deg); + -moz-transform: rotate(-3deg); + -o-transform: rotate(-3deg); + -ms-transform: rotate(-3deg); + transform: rotate(-3deg); +} +.effectpostit:after +{ + -webkit-transform: rotate(3deg); + -moz-transform: rotate(3deg); + -o-transform: rotate(3deg); + -ms-transform: rotate(3deg); + transform: rotate(3deg); + right: 10px; + left: auto; +} + /* ============================================================================== */ From 42008ae8cbf9ed561047bdd854a93ac285b10e43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Aug 2014 11:35:35 +0200 Subject: [PATCH 387/502] Fix: Bad translation --- htdocs/langs/en_US/users.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index a9d789b8c31..972b8534213 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -114,7 +114,7 @@ YourRole=Your roles YourQuotaOfUsersIsReached=Your quota of active users is reached ! NbOfUsers=Nb of users DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin -HierarchicalResponsible=Hierarchical responsible +HierarchicalResponsible=Supervisor HierarchicView=Hierarchical view UseTypeFieldToChange=Use field Type to change OpenIDURL=OpenID URL From 1f2cc71975e0013686d9e852db9924a6b09c1a53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Aug 2014 11:36:00 +0200 Subject: [PATCH 388/502] New: Supervisor is now visible into user list. --- ChangeLog | 1 + htdocs/core/class/commonobject.class.php | 1 - htdocs/user/index.php | 39 ++++++++++++++++++------ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index cea23d23381..a2b1dccb654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Supervisor is now visible into user list. - New: Add user of creation and validation on invoice export. - New: Add info page about browser. - New: Enable feature developed for 3.6 we forgot to enabled: Adding prefix diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73dc9211000..d322dd201df 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -116,7 +116,6 @@ abstract class CommonObject $lastname=$this->lastname; $firstname=$this->firstname; if (empty($lastname)) $lastname=(isset($this->lastname)?$this->lastname:(isset($this->name)?$this->name:(isset($this->nom)?$this->nom:''))); - if (empty($firstname)) $firstname=$this->firstname; $ret=''; if ($option && $this->civility_id) diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 743379f843c..8b7ba96a7f3 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -72,9 +72,11 @@ $sql.= " u.datec,"; $sql.= " u.tms as datem,"; $sql.= " u.datelastlogin,"; $sql.= " u.ldap_sid, u.statut, u.entity,"; +$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,"; $sql.= " s.nom, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity)))) { $sql.= " WHERE u.entity IS NOT NULL"; @@ -108,19 +110,20 @@ if ($result) print ''; print ''; - print_liste_field_titre($langs->trans("Login"),"index.php","u.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastName"),"index.php","u.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("FirstName"),"index.php","u.firstname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),"index.php","u.fk_societe",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateCreation"),"index.php","u.datec",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("LastConnexion"),"index.php","u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),$_SERVER['PHP_SELF'],"u.fk_societe",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateCreation"),$_SERVER['PHP_SELF'],"u.datec",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder); print ''; print "\n"; //SearchBar print ''; - print ''; + print ''; // Status print ''; print "\n"; + + $user2=new User($db); + $var=True; while ($i < $num) { @@ -192,9 +198,22 @@ if ($result) // Date last login print ''; - // Statut + // Resp + print ''; + + // Statut $userstatic->statut=$obj->statut; - print ''; + print ''; print ''; print "\n"; $i++; From 7ac22cf7d2a073bd4f36a2b15308a027b3c9ea18 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 09:05:51 +0200 Subject: [PATCH 389/502] Qual: no more currency into output, must be included into price function --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 543c2f5ef43..1641aeb132c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -739,7 +739,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass // Capital if ($fromcompany->capital) { - $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->currency); + $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($fromcompany->capital, 0, $outputlangs, 0, 0, 0, $conf->currency)); } // Prof Id 1 if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) From be89fddc52fdddb62858ab3b0090f269f441e20d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 10:54:22 +0200 Subject: [PATCH 390/502] Uniformize field list --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 3 +++ htdocs/install/mysql/tables/llx_user.sql | 2 ++ 2 files changed, 5 insertions(+) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index e8d4de8a9fa..e848e5f5607 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -29,6 +29,9 @@ INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4); +ALTER TABLE llx_user ADD COLUMN fk_user_creat integer AFTER tms; +ALTER TABLE llx_user ADD COLUMN fk_user_modif integer AFTER fk_user_creat; + ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_accountingaccount add column datec datetime NOT NULL AFTER entity; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 6fccf1804c4..1462fcf09aa 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -28,6 +28,8 @@ create table llx_user datec datetime, tms timestamp, + fk_user_creat integer, + fk_user_modif integer, login varchar(24) NOT NULL, pass varchar(32), pass_crypted varchar(128), From 4e8ec8e5980540bd27c27d3f7888ac51c46f76d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 18:36:18 +0200 Subject: [PATCH 391/502] Revert "Add Reduction value in pdf" This reverts commit 0b5707c1cf7f057fa6c2d5bce21cafd0d7bba5be. --- htdocs/compta/facture/class/facture.class.php | 6630 ++++++++--------- htdocs/core/lib/pdf.lib.php | 32 - .../modules/facture/doc/pdf_crabe.modules.php | 2443 +++--- 3 files changed, 4525 insertions(+), 4580 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b4c47a43c14..7e5af441280 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -11,8 +11,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Cedric Gross - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> + * Copyright (C) 2013 Florian Henry * * 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 @@ -45,78 +44,78 @@ require_once DOL_DOCUMENT_ROOT .'/margin/lib/margins.lib.php'; */ class Facture extends CommonInvoice { - public $element='facture'; - public $table_element='facture'; - public $table_element_line = 'facturedet'; - public $fk_element = 'fk_facture'; - protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='facture'; + public $table_element='facture'; + public $table_element_line = 'facturedet'; + public $fk_element = 'fk_facture'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id; - //! Id client - var $socid; - //! Objet societe client (to load with fetch_client method) - var $client; - var $author; - var $fk_user_author; - var $fk_user_valid; - //! Invoice date - var $date; // Invoice date - var $date_creation; // Creation date - var $date_validation; // Validation date - var $datem; - var $ref; - var $ref_client; - var $ref_ext; - var $ref_int; - //Check constants for types - var $type = self::TYPE_STANDARD; + var $id; + //! Id client + var $socid; + //! Objet societe client (to load with fetch_client method) + var $client; + var $author; + var $fk_user_author; + var $fk_user_valid; + //! Invoice date + var $date; // Invoice date + var $date_creation; // Creation date + var $date_validation; // Validation date + var $datem; + var $ref; + var $ref_client; + var $ref_ext; + var $ref_int; + //Check constants for types + var $type = self::TYPE_STANDARD; - //var $amount; - var $remise_absolue; - var $remise_percent; - var $total_ht=0; - var $total_tva=0; - var $total_ttc=0; - var $revenuestamp; - var $note; // deprecated - var $note_private; - var $note_public; - //! 0=draft, - //! 1=validated (need to be paid), - //! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null), - //! 3=classified abandoned and no payment done (close_code='badcustomer','abandon' or 'replaced') - var $statut; - //! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon - //! Fermeture alors que aucun paiement: replaced (si remplace), abandon - var $close_code; - //! Commentaire si mis a paye sans paiement complet - var $close_note; - //! 1 if invoice paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) - var $paye; - //! id of source invoice if replacement invoice or credit note - var $fk_facture_source; - var $origin; - var $origin_id; - var $linked_objects=array(); - var $fk_project; - var $date_lim_reglement; - var $cond_reglement_id; // Id in llx_c_paiement - var $cond_reglement_code; // Code in llx_c_paiement - var $mode_reglement_id; // Id in llx_c_paiement - var $mode_reglement_code; // Code in llx_c_paiement + //var $amount; + var $remise_absolue; + var $remise_percent; + var $total_ht=0; + var $total_tva=0; + var $total_ttc=0; + var $revenuestamp; + var $note; // deprecated + var $note_private; + var $note_public; + //! 0=draft, + //! 1=validated (need to be paid), + //! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null), + //! 3=classified abandoned and no payment done (close_code='badcustomer','abandon' or 'replaced') + var $statut; + //! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon + //! Fermeture alors que aucun paiement: replaced (si remplace), abandon + var $close_code; + //! Commentaire si mis a paye sans paiement complet + var $close_note; + //! 1 if invoice paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code) + var $paye; + //! id of source invoice if replacement invoice or credit note + var $fk_facture_source; + var $origin; + var $origin_id; + var $linked_objects=array(); + var $fk_project; + var $date_lim_reglement; + var $cond_reglement_id; // Id in llx_c_paiement + var $cond_reglement_code; // Code in llx_c_paiement + var $mode_reglement_id; // Id in llx_c_paiement + var $mode_reglement_code; // Code in llx_c_paiement var $fk_account; // Id of bank account - var $fk_bank; // Field to store bank id to use when payment mode is withdraw - var $modelpdf; - var $products=array(); // deprecated - var $lines=array(); - var $line; - var $extraparams=array(); - //! Pour board - var $nbtodo; - var $nbtodolate; - var $specimen; + var $fk_bank; // Field to store bank id to use when payment mode is withdraw + var $modelpdf; + var $products=array(); // deprecated + var $lines=array(); + var $line; + var $extraparams=array(); + //! Pour board + var $nbtodo; + var $nbtodolate; + var $specimen; - var $fac_rec; + var $fac_rec; /** * Standard invoice @@ -143,2680 +142,2677 @@ class Facture extends CommonInvoice */ const TYPE_PROFORMA = 4; - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + } - /** - * Create invoice in database - * Note: this->ref can be set or empty. If empty, we will use "(PROV)" - * - * @param User $user Object user that create - * @param int $notrigger 1=Does not execute triggers, 0 otherwise - * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value - * @return int <0 if KO, >0 if OK - */ - function create($user,$notrigger=0,$forceduedate=0) - { - global $langs,$conf,$mysoc,$hookmanager; - $error=0; + /** + * Create invoice in database + * Note: this->ref can be set or empty. If empty, we will use "(PROV)" + * + * @param User $user Object user that create + * @param int $notrigger 1=Does not execute triggers, 0 otherwise + * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value + * @return int <0 if KO, >0 if OK + */ + function create($user,$notrigger=0,$forceduedate=0) + { + global $langs,$conf,$mysoc,$hookmanager; + $error=0; - // Clean parameters - if (empty($this->type)) $this->type = self::TYPE_STANDARD; - $this->ref_client=trim($this->ref_client); - $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated - $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); - $this->note_public=trim($this->note_public); - if (! $this->cond_reglement_id) $this->cond_reglement_id = 0; - if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; - $this->brouillon = 1; + // Clean parameters + if (empty($this->type)) $this->type = self::TYPE_STANDARD; + $this->ref_client=trim($this->ref_client); + $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated + $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); + $this->note_public=trim($this->note_public); + if (! $this->cond_reglement_id) $this->cond_reglement_id = 0; + if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; + $this->brouillon = 1; - dol_syslog(get_class($this)."::create user=".$user->id); + dol_syslog(get_class($this)."::create user=".$user->id); - // Check parameters - if (empty($this->date) || empty($user->id)) - { - $this->error="ErrorBadParameter"; - dol_syslog(get_class($this)."::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR); - return -3; - } - $soc = new Societe($this->db); - $result=$soc->fetch($this->socid); - if ($result < 0) - { - $this->error="Failed to fetch company"; - dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); - return -2; - } + // Check parameters + if (empty($this->date) || empty($user->id)) + { + $this->error="ErrorBadParameter"; + dol_syslog(get_class($this)."::create Try to create an invoice with an empty parameter (user, date, ...)", LOG_ERR); + return -3; + } + $soc = new Societe($this->db); + $result=$soc->fetch($this->socid); + if ($result < 0) + { + $this->error="Failed to fetch company"; + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); + return -2; + } - $now=dol_now(); + $now=dol_now(); - $this->db->begin(); + $this->db->begin(); - // Create invoice from a predefined invoice - if ($this->fac_rec > 0) - { - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; - $_facrec = new FactureRec($this->db); - $result=$_facrec->fetch($this->fac_rec); + // Create invoice from a predefined invoice + if ($this->fac_rec > 0) + { + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; + $_facrec = new FactureRec($this->db); + $result=$_facrec->fetch($this->fac_rec); - $this->fk_project = $_facrec->fk_project; - $this->cond_reglement_id = $_facrec->cond_reglement_id; - $this->mode_reglement_id = $_facrec->mode_reglement_id; - $this->remise_absolue = $_facrec->remise_absolue; - $this->remise_percent = $_facrec->remise_percent; + $this->fk_project = $_facrec->fk_project; + $this->cond_reglement_id = $_facrec->cond_reglement_id; + $this->mode_reglement_id = $_facrec->mode_reglement_id; + $this->remise_absolue = $_facrec->remise_absolue; + $this->remise_percent = $_facrec->remise_percent; - // Clean parametres - if (! $this->type) $this->type = self::TYPE_STANDARD; - $this->ref_client=trim($this->ref_client); - $this->note_private=trim($this->note_private); - $this->note_public=trim($this->note_public); - //if (! $this->remise) $this->remise = 0; - if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; - $this->brouillon = 1; - } + // Clean parametres + if (! $this->type) $this->type = self::TYPE_STANDARD; + $this->ref_client=trim($this->ref_client); + $this->note_private=trim($this->note_private); + $this->note_public=trim($this->note_public); + //if (! $this->remise) $this->remise = 0; + if (! $this->mode_reglement_id) $this->mode_reglement_id = 0; + $this->brouillon = 1; + } - // Define due date if not already defined - $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); + // Define due date if not already defined + $datelim=(empty($forceduedate)?$this->calculate_date_lim_reglement():$forceduedate); - // Insert into database - $socid = $this->socid; + // Insert into database + $socid = $this->socid; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; - $sql.= " facnumber"; - $sql.= ", entity"; - $sql.= ", ref_ext"; - $sql.= ", type"; - $sql.= ", fk_soc"; - $sql.= ", datec"; - $sql.= ", remise_absolue"; - $sql.= ", remise_percent"; - $sql.= ", datef"; - $sql.= ", note_private"; - $sql.= ", note_public"; - $sql.= ", ref_client, ref_int"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; + $sql.= " facnumber"; + $sql.= ", entity"; + $sql.= ", ref_ext"; + $sql.= ", type"; + $sql.= ", fk_soc"; + $sql.= ", datec"; + $sql.= ", remise_absolue"; + $sql.= ", remise_percent"; + $sql.= ", datef"; + $sql.= ", note_private"; + $sql.= ", note_public"; + $sql.= ", ref_client, ref_int"; $sql.= ", fk_account"; - $sql.= ", fk_facture_source, fk_user_author, fk_projet"; - $sql.= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf"; - $sql.= ")"; - $sql.= " VALUES ("; - $sql.= "'(PROV)'"; - $sql.= ", ".$conf->entity; - $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); - $sql.= ", '".$this->type."'"; - $sql.= ", '".$socid."'"; - $sql.= ", '".$this->db->idate($now)."'"; - $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); - $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); - $sql.= ", '".$this->db->idate($this->date)."'"; - $sql.= ",".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); - $sql.= ",".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); - $sql.= ",".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); - $sql.= ",".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); - $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); - $sql.= ",".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null"); - $sql.= ",".($user->id > 0 ? "'".$user->id."'":"null"); - $sql.= ",".($this->fk_project?$this->fk_project:"null"); - $sql.= ','.$this->cond_reglement_id; - $sql.= ",".$this->mode_reglement_id; - $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')"; + $sql.= ", fk_facture_source, fk_user_author, fk_projet"; + $sql.= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf"; + $sql.= ")"; + $sql.= " VALUES ("; + $sql.= "'(PROV)'"; + $sql.= ", ".$conf->entity; + $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); + $sql.= ", '".$this->type."'"; + $sql.= ", '".$socid."'"; + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ",".($this->remise_absolue>0?$this->remise_absolue:'NULL'); + $sql.= ",".($this->remise_percent>0?$this->remise_percent:'NULL'); + $sql.= ", '".$this->db->idate($this->date)."'"; + $sql.= ",".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null"); + $sql.= ",".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null"); + $sql.= ",".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); + $sql.= ",".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); + $sql.= ", ".($this->fk_account>0?$this->fk_account:'NULL'); + $sql.= ",".($this->fk_facture_source?"'".$this->db->escape($this->fk_facture_source)."'":"null"); + $sql.= ",".($user->id > 0 ? "'".$user->id."'":"null"); + $sql.= ",".($this->fk_project?$this->fk_project:"null"); + $sql.= ','.$this->cond_reglement_id; + $sql.= ",".$this->mode_reglement_id; + $sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture'); + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture'); - // Update ref with new one - $this->ref='(PROV'.$this->id.')'; - $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id; + // Update ref with new one + $this->ref='(PROV'.$this->id.')'; + $sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql=$this->db->query($sql); - if (! $resql) $error++; + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) $error++; - // Add object linked - if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) - { - foreach($this->linked_objects as $origin => $origin_id) - { - $ret = $this->add_object_linked($origin, $origin_id); - if (! $ret) - { - dol_print_error($this->db); - $error++; - } + // Add object linked + if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) + { + foreach($this->linked_objects as $origin => $origin_id) + { + $ret = $this->add_object_linked($origin, $origin_id); + if (! $ret) + { + dol_print_error($this->db); + $error++; + } - // TODO mutualiser - if ($origin == 'commande') - { - // On recupere les differents contact interne et externe - $order = new Commande($this->db); - $order->id = $origin_id; + // TODO mutualiser + if ($origin == 'commande') + { + // On recupere les differents contact interne et externe + $order = new Commande($this->db); + $order->id = $origin_id; - // On recupere le commercial suivi propale - $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL'); + // On recupere le commercial suivi propale + $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL'); - if ($this->userid) - { - //On passe le commercial suivi commande en commercial suivi paiement - $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); - } + if ($this->userid) + { + //On passe le commercial suivi commande en commercial suivi paiement + $this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal'); + } - // On recupere le contact client facturation commande - $this->contactid = $order->getIdcontact('external', 'BILLING'); + // On recupere le contact client facturation commande + $this->contactid = $order->getIdcontact('external', 'BILLING'); - if ($this->contactid) - { - //On passe le contact client facturation commande en contact client facturation - $this->add_contact($this->contactid[0], 'BILLING', 'external'); - } - } - } - } + if ($this->contactid) + { + //On passe le contact client facturation commande en contact client facturation + $this->add_contact($this->contactid[0], 'BILLING', 'external'); + } + } + } + } - /* + /* * Insert lines of invoices into database */ - if (count($this->lines) && is_object($this->lines[0])) // If this->lines is array on InvoiceLines (preferred mode) - { - $fk_parent_line = 0; + if (count($this->lines) && is_object($this->lines[0])) // If this->lines is array on InvoiceLines (preferred mode) + { + $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects"); - foreach ($this->lines as $i => $val) - { - $newinvoiceline=$this->lines[$i]; - $newinvoiceline->fk_facture=$this->id; - if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 - { - // Reset fk_parent_line for no child products and special product - if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) { - $fk_parent_line = 0; - } + dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects"); + foreach ($this->lines as $i => $val) + { + $newinvoiceline=$this->lines[$i]; + $newinvoiceline->fk_facture=$this->id; + if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 + { + // Reset fk_parent_line for no child products and special product + if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) { + $fk_parent_line = 0; + } - $newinvoiceline->fk_parent_line=$fk_parent_line; - $result=$newinvoiceline->insert(); + $newinvoiceline->fk_parent_line=$fk_parent_line; + $result=$newinvoiceline->insert(); - // Defined the new fk_parent_line - if ($result > 0 && $newinvoiceline->product_type == 9) { - $fk_parent_line = $result; - } - } - if ($result < 0) - { - $this->error=$newinvoiceline->error; - $error++; - break; - } - } - } - else // If this->lines is not object of invoice lines - { - $fk_parent_line = 0; + // Defined the new fk_parent_line + if ($result > 0 && $newinvoiceline->product_type == 9) { + $fk_parent_line = $result; + } + } + if ($result < 0) + { + $this->error=$newinvoiceline->error; + $error++; + break; + } + } + } + else // If this->lines is not object of invoice lines + { + $fk_parent_line = 0; - dol_syslog("There is ".count($this->lines)." lines that are array lines"); - foreach ($this->lines as $i => $val) - { - if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 - { - // Reset fk_parent_line for no child products and special product - if (($this->lines[$i]->product_type != 9 && empty($this->lines[$i]->fk_parent_line)) || $this->lines[$i]->product_type == 9) { - $fk_parent_line = 0; - } + dol_syslog("There is ".count($this->lines)." lines that are array lines"); + foreach ($this->lines as $i => $val) + { + if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 + { + // Reset fk_parent_line for no child products and special product + if (($this->lines[$i]->product_type != 9 && empty($this->lines[$i]->fk_parent_line)) || $this->lines[$i]->product_type == 9) { + $fk_parent_line = 0; + } - $result = $this->addline( - $this->lines[$i]->desc, - $this->lines[$i]->subprice, - $this->lines[$i]->qty, - $this->lines[$i]->tva_tx, - $this->lines[$i]->localtax1_tx, - $this->lines[$i]->localtax2_tx, - $this->lines[$i]->fk_product, - $this->lines[$i]->remise_percent, - $this->lines[$i]->date_start, - $this->lines[$i]->date_end, - $this->lines[$i]->fk_code_ventilation, - $this->lines[$i]->info_bits, - $this->lines[$i]->fk_remise_except, - 'HT', - 0, - $this->lines[$i]->product_type, - $this->lines[$i]->rang, - $this->lines[$i]->special_code, - '', - 0, - $fk_parent_line, - $this->lines[$i]->fk_fournprice, - $this->lines[$i]->pa_ht, - $this->lines[$i]->label, - '' - ); - if ($result < 0) - { - $this->error=$this->db->lasterror(); - dol_print_error($this->db); - $this->db->rollback(); - return -1; - } + $result = $this->addline( + $this->lines[$i]->desc, + $this->lines[$i]->subprice, + $this->lines[$i]->qty, + $this->lines[$i]->tva_tx, + $this->lines[$i]->localtax1_tx, + $this->lines[$i]->localtax2_tx, + $this->lines[$i]->fk_product, + $this->lines[$i]->remise_percent, + $this->lines[$i]->date_start, + $this->lines[$i]->date_end, + $this->lines[$i]->fk_code_ventilation, + $this->lines[$i]->info_bits, + $this->lines[$i]->fk_remise_except, + 'HT', + 0, + $this->lines[$i]->product_type, + $this->lines[$i]->rang, + $this->lines[$i]->special_code, + '', + 0, + $fk_parent_line, + $this->lines[$i]->fk_fournprice, + $this->lines[$i]->pa_ht, + $this->lines[$i]->label, + '' + ); + if ($result < 0) + { + $this->error=$this->db->lasterror(); + dol_print_error($this->db); + $this->db->rollback(); + return -1; + } - // Defined the new fk_parent_line - if ($result > 0 && $this->lines[$i]->product_type == 9) { - $fk_parent_line = $result; - } - } - } - } + // Defined the new fk_parent_line + if ($result > 0 && $this->lines[$i]->product_type == 9) { + $fk_parent_line = $result; + } + } + } + } - /* + /* * Insert lines of predefined invoices */ - if (! $error && $this->fac_rec > 0) - { - foreach ($_facrec->lines as $i => $val) - { - if ($_facrec->lines[$i]->fk_product) - { - $prod = new Product($this->db); - $res=$prod->fetch($_facrec->lines[$i]->fk_product); - } - $tva_tx = get_default_tva($mysoc,$soc,$prod->id); - $localtax1_tx=get_localtax($tva_tx,1,$soc); - $localtax2_tx=get_localtax($tva_tx,2,$soc); + if (! $error && $this->fac_rec > 0) + { + foreach ($_facrec->lines as $i => $val) + { + if ($_facrec->lines[$i]->fk_product) + { + $prod = new Product($this->db); + $res=$prod->fetch($_facrec->lines[$i]->fk_product); + } + $tva_tx = get_default_tva($mysoc,$soc,$prod->id); + $localtax1_tx=get_localtax($tva_tx,1,$soc); + $localtax2_tx=get_localtax($tva_tx,2,$soc); - $result_insert = $this->addline( - $_facrec->lines[$i]->desc, - $_facrec->lines[$i]->subprice, - $_facrec->lines[$i]->qty, - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $_facrec->lines[$i]->fk_product, - $_facrec->lines[$i]->remise_percent, - '','',0,0,'','HT',0, - $_facrec->lines[$i]->product_type, - $_facrec->lines[$i]->rang, - $_facrec->lines[$i]->special_code, - '', - 0, - 0, - null, - 0, - $_facrec->lines[$i]->label - ); + $result_insert = $this->addline( + $_facrec->lines[$i]->desc, + $_facrec->lines[$i]->subprice, + $_facrec->lines[$i]->qty, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $_facrec->lines[$i]->fk_product, + $_facrec->lines[$i]->remise_percent, + '','',0,0,'','HT',0, + $_facrec->lines[$i]->product_type, + $_facrec->lines[$i]->rang, + $_facrec->lines[$i]->special_code, + '', + 0, + 0, + null, + 0, + $_facrec->lines[$i]->label + ); - if ( $result_insert < 0) - { - $error++; - $this->error=$this->db->error(); - break; - } - } - } + if ( $result_insert < 0) + { + $error++; + $this->error=$this->db->error(); + break; + } + } + } - if (! $error) - { + if (! $error) + { - $result=$this->update_price(1); - if ($result > 0) - { - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('invoicedao')); - $parameters=array('invoiceid'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; + $result=$this->update_price(1); + if ($result > 0) + { + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('invoicedao')); + $parameters=array('invoiceid'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; // Call trigger $result=$this->call_trigger('BILL_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - if (! $error) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -4; - } - } - else - { - $this->error=$langs->trans('FailedToUpdatePrice'); - $this->db->rollback(); - return -3; - } - } - else - { - dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -2; - } - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -4; + } + } + else + { + $this->error=$langs->trans('FailedToUpdatePrice'); + $this->db->rollback(); + return -3; + } + } + else + { + dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -2; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } - /** - * Create a new invoice in database from current invoice - * - * @param User $user Object user that ask creation - * @param int $invertdetail Reverse sign of amounts for lines - * @return int <0 if KO, >0 if OK - */ - function createFromCurrent($user,$invertdetail=0) - { - // Charge facture source - $facture=new Facture($this->db); + /** + * Create a new invoice in database from current invoice + * + * @param User $user Object user that ask creation + * @param int $invertdetail Reverse sign of amounts for lines + * @return int <0 if KO, >0 if OK + */ + function createFromCurrent($user,$invertdetail=0) + { + // Charge facture source + $facture=new Facture($this->db); - $facture->fk_facture_source = $this->fk_facture_source; - $facture->type = $this->type; - $facture->socid = $this->socid; - $facture->date = $this->date; - $facture->note_public = $this->note_public; - $facture->note_private = $this->note_private; - $facture->ref_client = $this->ref_client; - $facture->modelpdf = $this->modelpdf; - $facture->fk_project = $this->fk_project; - $facture->cond_reglement_id = $this->cond_reglement_id; - $facture->mode_reglement_id = $this->mode_reglement_id; - $facture->remise_absolue = $this->remise_absolue; - $facture->remise_percent = $this->remise_percent; + $facture->fk_facture_source = $this->fk_facture_source; + $facture->type = $this->type; + $facture->socid = $this->socid; + $facture->date = $this->date; + $facture->note_public = $this->note_public; + $facture->note_private = $this->note_private; + $facture->ref_client = $this->ref_client; + $facture->modelpdf = $this->modelpdf; + $facture->fk_project = $this->fk_project; + $facture->cond_reglement_id = $this->cond_reglement_id; + $facture->mode_reglement_id = $this->mode_reglement_id; + $facture->remise_absolue = $this->remise_absolue; + $facture->remise_percent = $this->remise_percent; - $facture->lines = $this->lines; // Tableau des lignes de factures - $facture->products = $this->lines; // Tant que products encore utilise + $facture->lines = $this->lines; // Tableau des lignes de factures + $facture->products = $this->lines; // Tant que products encore utilise - // Loop on each line of new invoice - foreach($facture->lines as $i => $line) - { - if ($invertdetail) - { - $facture->lines[$i]->subprice = -$facture->lines[$i]->subprice; - $facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht; - $facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva; - $facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1; - $facture->lines[$i]->total_localtax2 = -$facture->lines[$i]->total_localtax2; - $facture->lines[$i]->total_ttc = -$facture->lines[$i]->total_ttc; - } - } + // Loop on each line of new invoice + foreach($facture->lines as $i => $line) + { + if ($invertdetail) + { + $facture->lines[$i]->subprice = -$facture->lines[$i]->subprice; + $facture->lines[$i]->total_ht = -$facture->lines[$i]->total_ht; + $facture->lines[$i]->total_tva = -$facture->lines[$i]->total_tva; + $facture->lines[$i]->total_localtax1 = -$facture->lines[$i]->total_localtax1; + $facture->lines[$i]->total_localtax2 = -$facture->lines[$i]->total_localtax2; + $facture->lines[$i]->total_ttc = -$facture->lines[$i]->total_ttc; + } + } - dol_syslog(get_class($this)."::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".count($facture->lines)); + dol_syslog(get_class($this)."::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".count($facture->lines)); - $facid = $facture->create($user); - if ($facid <= 0) - { - $this->error=$facture->error; - $this->errors=$facture->errors; - } + $facid = $facture->create($user); + if ($facid <= 0) + { + $this->error=$facture->error; + $this->errors=$facture->errors; + } - return $facid; - } + return $facid; + } - /** - * Load an object from its id and create a new one in database - * - * @param int $socid Id of thirdparty - * @return int New id of clone - */ - function createFromClone($socid=0) - { - global $conf,$user,$langs,$hookmanager; + /** + * Load an object from its id and create a new one in database + * + * @param int $socid Id of thirdparty + * @return int New id of clone + */ + function createFromClone($socid=0) + { + global $conf,$user,$langs,$hookmanager; - $error=0; + $error=0; - $this->db->begin(); + $this->db->begin(); - // Load source object - $objFrom = dol_clone($this); + // Load source object + $objFrom = dol_clone($this); - // Change socid if needed - if (! empty($socid) && $socid != $this->socid) - { - $objsoc = new Societe($this->db); + // Change socid if needed + if (! empty($socid) && $socid != $this->socid) + { + $objsoc = new Societe($this->db); - if ($objsoc->fetch($socid)>0) - { - $this->socid = $objsoc->id; - $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - $this->fk_project = ''; - $this->fk_delivery_address = ''; - } + if ($objsoc->fetch($socid)>0) + { + $this->socid = $objsoc->id; + $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + $this->fk_project = ''; + $this->fk_delivery_address = ''; + } - // TODO Change product price if multi-prices - } + // TODO Change product price if multi-prices + } - $this->id=0; - $this->statut=0; + $this->id=0; + $this->statut=0; - // Clear fields - $this->date = dol_now(); // Date of invoice is set to current date when cloning. // TODO Best is to ask date into confirm box - $this->user_author = $user->id; - $this->user_valid = ''; - $this->fk_facture_source = 0; - $this->date_creation = ''; - $this->date_validation = ''; - $this->ref_client = ''; - $this->close_code = ''; - $this->close_note = ''; - $this->products = $this->lines; // Tant que products encore utilise + // Clear fields + $this->date = dol_now(); // Date of invoice is set to current date when cloning. // TODO Best is to ask date into confirm box + $this->user_author = $user->id; + $this->user_valid = ''; + $this->fk_facture_source = 0; + $this->date_creation = ''; + $this->date_validation = ''; + $this->ref_client = ''; + $this->close_code = ''; + $this->close_note = ''; + $this->products = $this->lines; // Tant que products encore utilise - // Loop on each line of new invoice - foreach($this->lines as $i => $line) - { - if (($this->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts - { - unset($this->lines[$i]); - unset($this->products[$i]); // Tant que products encore utilise - } - } + // Loop on each line of new invoice + foreach($this->lines as $i => $line) + { + if (($this->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts + { + unset($this->lines[$i]); + unset($this->products[$i]); // Tant que products encore utilise + } + } - // Create clone - $result=$this->create($user); - if ($result < 0) $error++; + // Create clone + $result=$this->create($user); + if ($result < 0) $error++; - if (! $error) - { - // Hook of thirdparty module - if (is_object($hookmanager)) - { - $parameters=array('objFrom'=>$objFrom); - $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; - } + if (! $error) + { + // Hook of thirdparty module + if (is_object($hookmanager)) + { + $parameters=array('objFrom'=>$objFrom); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; + } // Call trigger $result=$this->call_trigger('BILL_CLONE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } + } - // End - if (! $error) - { - $this->db->commit(); - return $this->id; - } - else - { - $this->db->rollback(); - return -1; - } - } + // End + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + $this->db->rollback(); + return -1; + } + } - /** - * Load an object from an order and create a new invoice into database - * - * @param Object $object Object source - * @return int <0 if KO, 0 if nothing done, 1 if OK - */ - function createFromOrder($object) - { - global $conf,$user,$langs,$hookmanager; + /** + * Load an object from an order and create a new invoice into database + * + * @param Object $object Object source + * @return int <0 if KO, 0 if nothing done, 1 if OK + */ + function createFromOrder($object) + { + global $conf,$user,$langs,$hookmanager; - $error=0; + $error=0; - // Closed order - $this->date = dol_now(); - $this->source = 0; + // Closed order + $this->date = dol_now(); + $this->source = 0; - $num=count($object->lines); - for ($i = 0; $i < $num; $i++) - { - $line = new FactureLigne($this->db); + $num=count($object->lines); + for ($i = 0; $i < $num; $i++) + { + $line = new FactureLigne($this->db); - $line->libelle = $object->lines[$i]->libelle; - $line->label = $object->lines[$i]->label; - $line->desc = $object->lines[$i]->desc; - $line->subprice = $object->lines[$i]->subprice; - $line->total_ht = $object->lines[$i]->total_ht; - $line->total_tva = $object->lines[$i]->total_tva; - $line->total_ttc = $object->lines[$i]->total_ttc; - $line->tva_tx = $object->lines[$i]->tva_tx; - $line->localtax1_tx = $object->lines[$i]->localtax1_tx; - $line->localtax2_tx = $object->lines[$i]->localtax2_tx; - $line->qty = $object->lines[$i]->qty; - $line->fk_remise_except = $object->lines[$i]->fk_remise_except; - $line->remise_percent = $object->lines[$i]->remise_percent; - $line->fk_product = $object->lines[$i]->fk_product; - $line->info_bits = $object->lines[$i]->info_bits; - $line->product_type = $object->lines[$i]->product_type; - $line->rang = $object->lines[$i]->rang; - $line->special_code = $object->lines[$i]->special_code; - $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->libelle = $object->lines[$i]->libelle; + $line->label = $object->lines[$i]->label; + $line->desc = $object->lines[$i]->desc; + $line->subprice = $object->lines[$i]->subprice; + $line->total_ht = $object->lines[$i]->total_ht; + $line->total_tva = $object->lines[$i]->total_tva; + $line->total_ttc = $object->lines[$i]->total_ttc; + $line->tva_tx = $object->lines[$i]->tva_tx; + $line->localtax1_tx = $object->lines[$i]->localtax1_tx; + $line->localtax2_tx = $object->lines[$i]->localtax2_tx; + $line->qty = $object->lines[$i]->qty; + $line->fk_remise_except = $object->lines[$i]->fk_remise_except; + $line->remise_percent = $object->lines[$i]->remise_percent; + $line->fk_product = $object->lines[$i]->fk_product; + $line->info_bits = $object->lines[$i]->info_bits; + $line->product_type = $object->lines[$i]->product_type; + $line->rang = $object->lines[$i]->rang; + $line->special_code = $object->lines[$i]->special_code; + $line->fk_parent_line = $object->lines[$i]->fk_parent_line; - $line->fk_fournprice = $object->lines[$i]->fk_fournprice; - $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); - $line->pa_ht = $marginInfos[0]; + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; - $this->lines[$i] = $line; - } + $this->lines[$i] = $line; + } - $this->socid = $object->socid; - $this->fk_project = $object->fk_project; - $this->cond_reglement_id = $object->cond_reglement_id; - $this->mode_reglement_id = $object->mode_reglement_id; - $this->availability_id = $object->availability_id; - $this->demand_reason_id = $object->demand_reason_id; - $this->date_livraison = $object->date_livraison; - $this->fk_delivery_address = $object->fk_delivery_address; - $this->contact_id = $object->contactid; - $this->ref_client = $object->ref_client; - $this->note_private = $object->note_private; - $this->note_public = $object->note_public; + $this->socid = $object->socid; + $this->fk_project = $object->fk_project; + $this->cond_reglement_id = $object->cond_reglement_id; + $this->mode_reglement_id = $object->mode_reglement_id; + $this->availability_id = $object->availability_id; + $this->demand_reason_id = $object->demand_reason_id; + $this->date_livraison = $object->date_livraison; + $this->fk_delivery_address = $object->fk_delivery_address; + $this->contact_id = $object->contactid; + $this->ref_client = $object->ref_client; + $this->note_private = $object->note_private; + $this->note_public = $object->note_public; - $this->origin = $object->element; - $this->origin_id = $object->id; + $this->origin = $object->element; + $this->origin_id = $object->id; - // Possibility to add external linked objects with hooks - $this->linked_objects[$this->origin] = $this->origin_id; - if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) - { - $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); - } + // Possibility to add external linked objects with hooks + $this->linked_objects[$this->origin] = $this->origin_id; + if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) + { + $this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects); + } - $ret = $this->create($user); + $ret = $this->create($user); - if ($ret > 0) - { - // Actions hooked (by external module) - $hookmanager->initHooks(array('invoicedao')); + if ($ret > 0) + { + // Actions hooked (by external module) + $hookmanager->initHooks(array('invoicedao')); - $parameters=array('objFrom'=>$object); - $action=''; - $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) $error++; + $parameters=array('objFrom'=>$object); + $action=''; + $reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) $error++; - if (! $error) - { - return 1; - } - else return -1; - } - else return -1; - } + if (! $error) + { + return 1; + } + else return -1; + } + else return -1; + } - /** - * Return clicable link of object (with eventually picto) - * - * @param int $withpicto Add picto into link - * @param string $option Where point the link - * @param int $max Maxlength of ref - * @param int $short 1=Return just URL - * @param string $moretitle Add more text to title tooltip - * @return string String with URL - */ - function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='') - { - global $langs; + /** + * Return clicable link of object (with eventually picto) + * + * @param int $withpicto Add picto into link + * @param string $option Where point the link + * @param int $max Maxlength of ref + * @param int $short 1=Return just URL + * @param string $moretitle Add more text to title tooltip + * @return string String with URL + */ + function getNomUrl($withpicto=0,$option='',$max=0,$short=0,$moretitle='') + { + global $langs; - $result=''; + $result=''; - if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id; - else $url = DOL_URL_ROOT.'/compta/facture.php?facid='.$this->id; + if ($option == 'withdraw') $url = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$this->id; + else $url = DOL_URL_ROOT.'/compta/facture.php?facid='.$this->id; - if ($short) return $url; + if ($short) return $url; - $picto='bill'; - if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice - if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note - if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice + $picto='bill'; + if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice + if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note + if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice - $label=$langs->trans("ShowInvoice").': '.$this->ref; - if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; - if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; - if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; - if ($moretitle) $label.=' - '.$moretitle; + $label=$langs->trans("ShowInvoice").': '.$this->ref; + if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; + if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; + if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; + if ($moretitle) $label.=' - '.$moretitle; - $linkstart=''; - $linkend=''; + $linkstart=''; + $linkend=''; - if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label),$picto).$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$linkstart.($max?dol_trunc($this->ref,$max):$this->ref).$linkend; - return $result; - } + if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label),$picto).$linkend); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$linkstart.($max?dol_trunc($this->ref,$max):$this->ref).$linkend; + return $result; + } - /** - * Get object and lines from database - * - * @param int $rowid Id of object to load - * @param string $ref Reference of invoice - * @param string $ref_ext External reference of invoice - * @param int $ref_int Internal reference of other object - * @return int >0 if OK, <0 if KO, 0 if not found - */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='') - { - global $conf; + /** + * Get object and lines from database + * + * @param int $rowid Id of object to load + * @param string $ref Reference of invoice + * @param string $ref_ext External reference of invoice + * @param int $ref_int Internal reference of other object + * @return int >0 if OK, <0 if KO, 0 if not found + */ + function fetch($rowid, $ref='', $ref_ext='', $ref_int='') + { + global $conf; - if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; + if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp'; - $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; - $sql.= ', f.datef as df'; - $sql.= ', f.date_lim_reglement as dlr'; - $sql.= ', f.datec as datec'; - $sql.= ', f.date_valid as datev'; - $sql.= ', f.tms as datem'; - $sql.= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf'; - $sql.= ', f.fk_facture_source'; - $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams'; - $sql.= ', f.fk_account'; - $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; - $sql.= ' WHERE f.entity = '.$conf->entity; - if ($rowid) $sql.= " AND f.rowid=".$rowid; - if ($ref) $sql.= " AND f.facnumber='".$this->db->escape($ref)."'"; - if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; - if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; + $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp'; + $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; + $sql.= ', f.datef as df'; + $sql.= ', f.date_lim_reglement as dlr'; + $sql.= ', f.datec as datec'; + $sql.= ', f.date_valid as datev'; + $sql.= ', f.tms as datem'; + $sql.= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf'; + $sql.= ', f.fk_facture_source'; + $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams'; + $sql.= ', f.fk_account'; + $sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; + $sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as c ON f.fk_cond_reglement = c.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; + $sql.= ' WHERE f.entity = '.$conf->entity; + if ($rowid) $sql.= " AND f.rowid=".$rowid; + if ($ref) $sql.= " AND f.facnumber='".$this->db->escape($ref)."'"; + if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'"; + if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'"; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - $this->ref = $obj->facnumber; - $this->ref_client = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; - $this->ref_int = $obj->ref_int; - $this->type = $obj->type; - $this->date = $this->db->jdate($obj->df); - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_validation = $this->db->jdate($obj->datev); - $this->datem = $this->db->jdate($obj->datem); - $this->remise_percent = $obj->remise_percent; - $this->remise_absolue = $obj->remise_absolue; - $this->total_ht = $obj->total; - $this->total_tva = $obj->tva; - $this->total_localtax1 = $obj->localtax1; - $this->total_localtax2 = $obj->localtax2; - $this->total_ttc = $obj->total_ttc; - $this->revenuestamp = $obj->revenuestamp; - $this->paye = $obj->paye; - $this->close_code = $obj->close_code; - $this->close_note = $obj->close_note; - $this->socid = $obj->fk_soc; - $this->statut = $obj->fk_statut; - $this->date_lim_reglement = $this->db->jdate($obj->dlr); - $this->mode_reglement_id = $obj->fk_mode_reglement; - $this->mode_reglement_code = $obj->mode_reglement_code; - $this->mode_reglement = $obj->mode_reglement_libelle; - $this->cond_reglement_id = $obj->fk_cond_reglement; - $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; - $this->fk_account = ($obj->fk_account>0)?$obj->fk_account:null; - $this->fk_project = $obj->fk_projet; - $this->fk_facture_source = $obj->fk_facture_source; - $this->note = $obj->note_private; // deprecated - $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; - $this->user_author = $obj->fk_user_author; - $this->user_valid = $obj->fk_user_valid; - $this->modelpdf = $obj->model_pdf; + $this->id = $obj->rowid; + $this->ref = $obj->facnumber; + $this->ref_client = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; + $this->ref_int = $obj->ref_int; + $this->type = $obj->type; + $this->date = $this->db->jdate($obj->df); + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_validation = $this->db->jdate($obj->datev); + $this->datem = $this->db->jdate($obj->datem); + $this->remise_percent = $obj->remise_percent; + $this->remise_absolue = $obj->remise_absolue; + $this->total_ht = $obj->total; + $this->total_tva = $obj->tva; + $this->total_localtax1 = $obj->localtax1; + $this->total_localtax2 = $obj->localtax2; + $this->total_ttc = $obj->total_ttc; + $this->revenuestamp = $obj->revenuestamp; + $this->paye = $obj->paye; + $this->close_code = $obj->close_code; + $this->close_note = $obj->close_note; + $this->socid = $obj->fk_soc; + $this->statut = $obj->fk_statut; + $this->date_lim_reglement = $this->db->jdate($obj->dlr); + $this->mode_reglement_id = $obj->fk_mode_reglement; + $this->mode_reglement_code = $obj->mode_reglement_code; + $this->mode_reglement = $obj->mode_reglement_libelle; + $this->cond_reglement_id = $obj->fk_cond_reglement; + $this->cond_reglement_code = $obj->cond_reglement_code; + $this->cond_reglement = $obj->cond_reglement_libelle; + $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; + $this->fk_account = ($obj->fk_account>0)?$obj->fk_account:null; + $this->fk_project = $obj->fk_projet; + $this->fk_facture_source = $obj->fk_facture_source; + $this->note = $obj->note_private; // deprecated + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->user_author = $obj->fk_user_author; + $this->user_valid = $obj->fk_user_valid; + $this->modelpdf = $obj->model_pdf; - $this->extraparams = (array) json_decode($obj->extraparams, true); + $this->extraparams = (array) json_decode($obj->extraparams, true); - if ($this->statut == 0) $this->brouillon = 1; + if ($this->statut == 0) $this->brouillon = 1; - // Retreive all extrafield for invoice - // fetch optionals attributes and labels - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields=new ExtraFields($this->db); - $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); - $this->fetch_optionals($this->id,$extralabels); + // Retreive all extrafield for invoice + // fetch optionals attributes and labels + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); + $this->fetch_optionals($this->id,$extralabels); - /* + /* * Lines */ - $this->lines = array(); + $this->lines = array(); - $result=$this->fetch_lines(); - if ($result < 0) - { - $this->error=$this->db->error(); - return -3; - } - return 1; - } - else - { - $this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; - dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); - return 0; - } - } - else - { - $this->error=$this->db->error(); - return -1; - } - } + $result=$this->fetch_lines(); + if ($result < 0) + { + $this->error=$this->db->error(); + return -3; + } + return 1; + } + else + { + $this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; + dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); + return 0; + } + } + else + { + $this->error=$this->db->error(); + return -1; + } + } - /** - * Load all detailed lines into this->lines - * - * @return int 1 if OK, < 0 if KO - */ - function fetch_lines() - { - $this->lines=array(); + /** + * Load all detailed lines into this->lines + * + * @return int 1 if OK, < 0 if KO + */ + function fetch_lines() + { + $this->lines=array(); - $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, '; - $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,'; - $sql.= ' l.rang, l.special_code,'; - $sql.= ' l.date_start as date_start, l.date_end as date_end,'; - $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; - $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; - $sql.= ' WHERE l.fk_facture = '.$this->id; - $sql.= ' ORDER BY l.rang'; + $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, '; + $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,'; + $sql.= ' l.rang, l.special_code,'; + $sql.= ' l.date_start as date_start, l.date_end as date_end,'; + $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql.= ' WHERE l.fk_facture = '.$this->id; + $sql.= ' ORDER BY l.rang'; - dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - $num = $this->db->num_rows($result); - $i = 0; - while ($i < $num) - { - $objp = $this->db->fetch_object($result); - $line = new FactureLigne($this->db); + dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + $i = 0; + while ($i < $num) + { + $objp = $this->db->fetch_object($result); + $line = new FactureLigne($this->db); - $line->rowid = $objp->rowid; - $line->label = $objp->custom_label; // deprecated - $line->desc = $objp->description; // Description line - $line->product_type = $objp->product_type; // Type of line - $line->product_ref = $objp->product_ref; // Ref product - $line->libelle = $objp->product_label; // TODO deprecated - $line->product_label = $objp->product_label; // Label product - $line->product_desc = $objp->product_desc; // Description product - $line->fk_product_type = $objp->fk_product_type; // Type of product - $line->qty = $objp->qty; - $line->subprice = $objp->subprice; - $line->tva_tx = $objp->tva_tx; - $line->localtax1_tx = $objp->localtax1_tx; - $line->localtax2_tx = $objp->localtax2_tx; - $line->localtax1_type = $objp->localtax1_type; - $line->localtax2_type = $objp->localtax2_type; - $line->remise_percent = $objp->remise_percent; - $line->fk_remise_except = $objp->fk_remise_except; - $line->fk_product = $objp->fk_product; - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - $line->date_start = $this->db->jdate($objp->date_start); - $line->date_end = $this->db->jdate($objp->date_end); - $line->info_bits = $objp->info_bits; - $line->total_ht = $objp->total_ht; - $line->total_tva = $objp->total_tva; - $line->total_localtax1 = $objp->total_localtax1; - $line->total_localtax2 = $objp->total_localtax2; - $line->total_ttc = $objp->total_ttc; - $line->code_ventilation = $objp->fk_code_ventilation; - $line->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); - $line->pa_ht = $marginInfos[0]; - $line->marge_tx = $marginInfos[1]; - $line->marque_tx = $marginInfos[2]; - $line->rang = $objp->rang; - $line->special_code = $objp->special_code; - $line->fk_parent_line = $objp->fk_parent_line; + $line->rowid = $objp->rowid; + $line->label = $objp->custom_label; // deprecated + $line->desc = $objp->description; // Description line + $line->product_type = $objp->product_type; // Type of line + $line->product_ref = $objp->product_ref; // Ref product + $line->libelle = $objp->product_label; // TODO deprecated + $line->product_label = $objp->product_label; // Label product + $line->product_desc = $objp->product_desc; // Description product + $line->fk_product_type = $objp->fk_product_type; // Type of product + $line->qty = $objp->qty; + $line->subprice = $objp->subprice; + $line->tva_tx = $objp->tva_tx; + $line->localtax1_tx = $objp->localtax1_tx; + $line->localtax2_tx = $objp->localtax2_tx; + $line->localtax1_type = $objp->localtax1_type; + $line->localtax2_type = $objp->localtax2_type; + $line->remise_percent = $objp->remise_percent; + $line->fk_remise_except = $objp->fk_remise_except; + $line->fk_product = $objp->fk_product; + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_end = $this->db->jdate($objp->date_end); + $line->info_bits = $objp->info_bits; + $line->total_ht = $objp->total_ht; + $line->total_tva = $objp->total_tva; + $line->total_localtax1 = $objp->total_localtax1; + $line->total_localtax2 = $objp->total_localtax2; + $line->total_ttc = $objp->total_ttc; + $line->code_ventilation = $objp->fk_code_ventilation; + $line->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; + $line->rang = $objp->rang; + $line->special_code = $objp->special_code; + $line->fk_parent_line = $objp->fk_parent_line; - $this->lines[$i] = $line; + $this->lines[$i] = $line; - $i++; - } - $this->db->free($result); - return 1; - } - else - { - $this->error=$this->db->error(); - return -3; - } - } + $i++; + } + $this->db->free($result); + return 1; + } + else + { + $this->error=$this->db->error(); + return -3; + } + } - /** - * Update database - * - * @param User $user User that modify - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int <0 if KO, >0 if OK - */ - function update($user=0, $notrigger=0) - { - global $conf, $langs; - $error=0; + /** + * Update database + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user=0, $notrigger=0) + { + global $conf, $langs; + $error=0; - // Clean parameters - if (empty($this->type)) $this->type= self::TYPE_STANDARD; - if (isset($this->facnumber)) $this->facnumber=trim($this->ref); - if (isset($this->ref_client)) $this->ref_client=trim($this->ref_client); - if (isset($this->increment)) $this->increment=trim($this->increment); - if (isset($this->close_code)) $this->close_code=trim($this->close_code); - if (isset($this->close_note)) $this->close_note=trim($this->close_note); - if (isset($this->note) || isset($this->note_private)) $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated - if (isset($this->note) || isset($this->note_private)) $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note)); - if (isset($this->note_public)) $this->note_public=trim($this->note_public); - if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf); - if (isset($this->import_key)) $this->import_key=trim($this->import_key); + // Clean parameters + if (empty($this->type)) $this->type= self::TYPE_STANDARD; + if (isset($this->facnumber)) $this->facnumber=trim($this->ref); + if (isset($this->ref_client)) $this->ref_client=trim($this->ref_client); + if (isset($this->increment)) $this->increment=trim($this->increment); + if (isset($this->close_code)) $this->close_code=trim($this->close_code); + if (isset($this->close_note)) $this->close_note=trim($this->close_note); + if (isset($this->note) || isset($this->note_private)) $this->note=(isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated + if (isset($this->note) || isset($this->note_private)) $this->note_private=(isset($this->note_private) ? trim($this->note_private) : trim($this->note)); + if (isset($this->note_public)) $this->note_public=trim($this->note_public); + if (isset($this->modelpdf)) $this->modelpdf=trim($this->modelpdf); + if (isset($this->import_key)) $this->import_key=trim($this->import_key); - // Check parameters - // Put here code to add control on parameters values + // Check parameters + // Put here code to add control on parameters values - // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; - $sql.= " facnumber=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; - $sql.= " type=".(isset($this->type)?$this->type:"null").","; - $sql.= " ref_client=".(isset($this->ref_client)?"'".$this->db->escape($this->ref_client)."'":"null").","; - $sql.= " increment=".(isset($this->increment)?"'".$this->db->escape($this->increment)."'":"null").","; - $sql.= " fk_soc=".(isset($this->socid)?$this->socid:"null").","; - $sql.= " datec=".(strval($this->date_creation)!='' ? "'".$this->db->idate($this->date_creation)."'" : 'null').","; - $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; - $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; - $sql.= " paye=".(isset($this->paye)?$this->paye:"null").","; - $sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").","; - $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").","; - $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; - $sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").","; - $sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").","; - $sql.= " localtax1=".(isset($this->total_localtax1)?$this->total_localtax1:"null").","; - $sql.= " localtax2=".(isset($this->total_localtax2)?$this->total_localtax2:"null").","; - $sql.= " total=".(isset($this->total_ht)?$this->total_ht:"null").","; - $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; - $sql.= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '')?$this->revenuestamp:"null").","; - $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; - $sql.= " fk_user_author=".(isset($this->user_author)?$this->user_author:"null").","; - $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; - $sql.= " fk_facture_source=".(isset($this->fk_facture_source)?$this->fk_facture_source:"null").","; - $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; - $sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").","; - $sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").","; - $sql.= " date_lim_reglement=".(strval($this->date_lim_reglement)!='' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').","; - $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; - $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; - $sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").","; - $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; + $sql.= " facnumber=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").","; + $sql.= " type=".(isset($this->type)?$this->type:"null").","; + $sql.= " ref_client=".(isset($this->ref_client)?"'".$this->db->escape($this->ref_client)."'":"null").","; + $sql.= " increment=".(isset($this->increment)?"'".$this->db->escape($this->increment)."'":"null").","; + $sql.= " fk_soc=".(isset($this->socid)?$this->socid:"null").","; + $sql.= " datec=".(strval($this->date_creation)!='' ? "'".$this->db->idate($this->date_creation)."'" : 'null').","; + $sql.= " datef=".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null').","; + $sql.= " date_valid=".(strval($this->date_validation)!='' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; + $sql.= " paye=".(isset($this->paye)?$this->paye:"null").","; + $sql.= " remise_percent=".(isset($this->remise_percent)?$this->remise_percent:"null").","; + $sql.= " remise_absolue=".(isset($this->remise_absolue)?$this->remise_absolue:"null").","; + $sql.= " close_code=".(isset($this->close_code)?"'".$this->db->escape($this->close_code)."'":"null").","; + $sql.= " close_note=".(isset($this->close_note)?"'".$this->db->escape($this->close_note)."'":"null").","; + $sql.= " tva=".(isset($this->total_tva)?$this->total_tva:"null").","; + $sql.= " localtax1=".(isset($this->total_localtax1)?$this->total_localtax1:"null").","; + $sql.= " localtax2=".(isset($this->total_localtax2)?$this->total_localtax2:"null").","; + $sql.= " total=".(isset($this->total_ht)?$this->total_ht:"null").","; + $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; + $sql.= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '')?$this->revenuestamp:"null").","; + $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; + $sql.= " fk_user_author=".(isset($this->user_author)?$this->user_author:"null").","; + $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; + $sql.= " fk_facture_source=".(isset($this->fk_facture_source)?$this->fk_facture_source:"null").","; + $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; + $sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").","; + $sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").","; + $sql.= " date_lim_reglement=".(strval($this->date_lim_reglement)!='' ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'null').","; + $sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").","; + $sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").","; + $sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").","; + $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; - $sql.= " WHERE rowid=".$this->id; + $sql.= " WHERE rowid=".$this->id; - $this->db->begin(); + $this->db->begin(); - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if (! $resql) { - $error++; $this->errors[]="Error ".$this->db->lasterror(); - } + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } - if (! $error) - { - if (! $notrigger) - { - // Call trigger - $result=$this->call_trigger('BILL_MODIFY',$user); - if ($result < 0) $error++; - // End call triggers - } - } + if (! $error) + { + if (! $notrigger) + { + // Call trigger + $result=$this->call_trigger('BILL_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + } - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); - return 1; - } - } + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } - /** - * Add a discount line into invoice using an existing absolute discount - * - * @param int $idremise Id of absolute discount - * @return int >0 if OK, <0 if KO - */ - function insert_discount($idremise) - { - global $langs; + /** + * Add a discount line into invoice using an existing absolute discount + * + * @param int $idremise Id of absolute discount + * @return int >0 if OK, <0 if KO + */ + function insert_discount($idremise) + { + global $langs; - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $this->db->begin(); + $this->db->begin(); - $remise=new DiscountAbsolute($this->db); - $result=$remise->fetch($idremise); + $remise=new DiscountAbsolute($this->db); + $result=$remise->fetch($idremise); - if ($result > 0) - { - if ($remise->fk_facture) // Protection against multiple submission - { - $this->error=$langs->trans("ErrorDiscountAlreadyUsed"); - $this->db->rollback(); - return -5; - } + if ($result > 0) + { + if ($remise->fk_facture) // Protection against multiple submission + { + $this->error=$langs->trans("ErrorDiscountAlreadyUsed"); + $this->db->rollback(); + return -5; + } - $facligne=new FactureLigne($this->db); - $facligne->fk_facture=$this->id; - $facligne->fk_remise_except=$remise->id; - $facligne->desc=$remise->description; // Description ligne - $facligne->tva_tx=$remise->tva_tx; - $facligne->subprice=-$remise->amount_ht; - $facligne->fk_product=0; // Id produit predefini - $facligne->qty=1; - $facligne->remise_percent=0; - $facligne->rang=-1; - $facligne->info_bits=2; + $facligne=new FactureLigne($this->db); + $facligne->fk_facture=$this->id; + $facligne->fk_remise_except=$remise->id; + $facligne->desc=$remise->description; // Description ligne + $facligne->tva_tx=$remise->tva_tx; + $facligne->subprice=-$remise->amount_ht; + $facligne->fk_product=0; // Id produit predefini + $facligne->qty=1; + $facligne->remise_percent=0; + $facligne->rang=-1; + $facligne->info_bits=2; - $facligne->total_ht = -$remise->amount_ht; - $facligne->total_tva = -$remise->amount_tva; - $facligne->total_ttc = -$remise->amount_ttc; + $facligne->total_ht = -$remise->amount_ht; + $facligne->total_tva = -$remise->amount_tva; + $facligne->total_ttc = -$remise->amount_ttc; - $lineid=$facligne->insert(); - if ($lineid > 0) - { - $result=$this->update_price(1); - if ($result > 0) - { - // Create linke between discount and invoice line - $result=$remise->link_to_invoice($lineid,0); - if ($result < 0) - { - $this->error=$remise->error; - $this->db->rollback(); - return -4; - } + $lineid=$facligne->insert(); + if ($lineid > 0) + { + $result=$this->update_price(1); + if ($result > 0) + { + // Create linke between discount and invoice line + $result=$remise->link_to_invoice($lineid,0); + if ($result < 0) + { + $this->error=$remise->error; + $this->db->rollback(); + return -4; + } - $this->db->commit(); - return 1; - } - else - { - $this->error=$facligne->error; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$facligne->error; - $this->db->rollback(); - return -2; - } - } - else - { - $this->db->rollback(); - return -3; - } - } + $this->db->commit(); + return 1; + } + else + { + $this->error=$facligne->error; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$facligne->error; + $this->db->rollback(); + return -2; + } + } + else + { + $this->db->rollback(); + return -3; + } + } - /** - * Set customer ref - * - * @param string $ref_client Customer ref - * @return int <0 if KO, >0 if OK - */ - function set_ref_client($ref_client) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - if (empty($ref_client)) - $sql .= ' SET ref_client = NULL'; - else - $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; - $sql .= ' WHERE rowid = '.$this->id; - if ($this->db->query($sql)) - { - $this->ref_client = $ref_client; - return 1; - } - else - { - dol_print_error($this->db); - return -1; - } - } + /** + * Set customer ref + * + * @param string $ref_client Customer ref + * @return int <0 if KO, >0 if OK + */ + function set_ref_client($ref_client) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + if (empty($ref_client)) + $sql .= ' SET ref_client = NULL'; + else + $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; + $sql .= ' WHERE rowid = '.$this->id; + if ($this->db->query($sql)) + { + $this->ref_client = $ref_client; + return 1; + } + else + { + dol_print_error($this->db); + return -1; + } + } - /** - * Delete invoice - * - * @param int $rowid Id of invoice to delete. If empty, we delete current instance of invoice - * @param int $notrigger 1=Does not execute triggers, 0= execute triggers - * @param int $idwarehouse Id warehouse to use for stock change. - * @return int <0 if KO, >0 if OK - */ - function delete($rowid=0, $notrigger=0, $idwarehouse=-1) - { - global $user,$langs,$conf; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + /** + * Delete invoice + * + * @param int $rowid Id of invoice to delete. If empty, we delete current instance of invoice + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK + */ + function delete($rowid=0, $notrigger=0, $idwarehouse=-1) + { + global $user,$langs,$conf; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - if (empty($rowid)) $rowid=$this->id; + if (empty($rowid)) $rowid=$this->id; - dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - // TODO Test if there is at least on payment. If yes, refuse to delete. + // TODO Test if there is at least on payment. If yes, refuse to delete. - $error=0; - $this->db->begin(); + $error=0; + $this->db->begin(); - if (! $error && ! $notrigger) - { + if (! $error && ! $notrigger) + { // Call trigger $result=$this->call_trigger('BILL_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } + } - // Removed extrafields - if (! $error) { - $result=$this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR); - } - } + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields(); + if ($result < 0) + { + $error++; + dol_syslog(get_class($this)."::delete error deleteExtraFields ".$this->error, LOG_ERR); + } + } - if (! $error) - { - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) $error++; - } + if (! $error) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error++; + } - if (! $error) - { - // If invoice was converted into a discount not yet consumed, we remove discount - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' WHERE fk_facture_source = '.$rowid; - $sql.= ' AND fk_facture_line IS NULL'; - $resql=$this->db->query($sql); + if (! $error) + { + // If invoice was converted into a discount not yet consumed, we remove discount + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' WHERE fk_facture_source = '.$rowid; + $sql.= ' AND fk_facture_line IS NULL'; + $resql=$this->db->query($sql); - // If invoice has consumned discounts - $this->fetch_lines(); - $list_rowid_det=array(); - foreach($this->lines as $key => $invoiceline) - { - $list_rowid_det[]=$invoiceline->rowid; - } + // If invoice has consumned discounts + $this->fetch_lines(); + $list_rowid_det=array(); + foreach($this->lines as $key => $invoiceline) + { + $list_rowid_det[]=$invoiceline->rowid; + } - // Consumned discounts are freed - if (count($list_rowid_det)) - { - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL'; - $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')'; + // Consumned discounts are freed + if (count($list_rowid_det)) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture = NULL, fk_facture_line = NULL'; + $sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')'; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if (! $this->db->query($sql)) - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -5; - } - } + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if (! $this->db->query($sql)) + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -5; + } + } - // If we decrament stock on invoice validation, we increment - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse!=-1) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); + // If we decrament stock on invoice validation, we increment + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $idwarehouse!=-1) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); - else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value - } - } - } + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceDeleteDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value + } + } + } - // Delete invoice line - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; + // Delete invoice line + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sql) && $this->delete_linked_contact()) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid; + if ($this->db->query($sql) && $this->delete_linked_contact()) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); + dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - // On efface le repertoire de pdf provisoire - $ref = dol_sanitizeFileName($this->ref); - if ($conf->facture->dir_output && !empty($this->ref)) - { - $dir = $conf->facture->dir_output . "/" . $ref; - $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; - if (file_exists($file)) // We must delete all files before deleting directory - { - $ret=dol_delete_preview($this); + $resql=$this->db->query($sql); + if ($resql) + { + // On efface le repertoire de pdf provisoire + $ref = dol_sanitizeFileName($this->ref); + if ($conf->facture->dir_output && !empty($this->ref)) + { + $dir = $conf->facture->dir_output . "/" . $ref; + $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; + if (file_exists($file)) // We must delete all files before deleting directory + { + $ret=dol_delete_preview($this); - if (! dol_delete_file($file,0,0,0,$this)) // For triggers - { - $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); - $this->db->rollback(); - return 0; - } - } - if (file_exists($dir)) - { - if (! dol_delete_dir_recursive($dir)) // For remove dir and meta - { - $this->error=$langs->trans("ErrorCanNotDeleteDir",$dir); - $this->db->rollback(); - return 0; - } - } - } + if (! dol_delete_file($file,0,0,0,$this)) // For triggers + { + $this->error=$langs->trans("ErrorCanNotDeleteFile",$file); + $this->db->rollback(); + return 0; + } + } + if (file_exists($dir)) + { + if (! dol_delete_dir_recursive($dir)) // For remove dir and meta + { + $this->error=$langs->trans("ErrorCanNotDeleteDir",$dir); + $this->db->rollback(); + return 0; + } + } + } - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->lasterror()." sql=".$sql; - $this->db->rollback(); - return -6; - } - } - else - { - $this->error=$this->db->lasterror()." sql=".$sql; - $this->db->rollback(); - return -4; - } - } - else - { - $this->db->rollback(); - return -2; - } - } + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->lasterror()." sql=".$sql; + $this->db->rollback(); + return -6; + } + } + else + { + $this->error=$this->db->lasterror()." sql=".$sql; + $this->db->rollback(); + return -4; + } + } + else + { + $this->db->rollback(); + return -2; + } + } - /** - * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 - * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 - * - * @param User $user Objet utilisateur qui modifie - * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) - * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) - * @return int <0 if KO, >0 if OK - */ - function set_paid($user,$close_code='',$close_note='') - { - global $conf,$langs; - $error=0; + /** + * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 + * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 + * + * @param User $user Objet utilisateur qui modifie + * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet (cas escompte par exemple) + * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) + * @return int <0 if KO, >0 if OK + */ + function set_paid($user,$close_code='',$close_note='') + { + global $conf,$langs; + $error=0; - if ($this->paye != 1) - { - $this->db->begin(); + if ($this->paye != 1) + { + $this->db->begin(); - dol_syslog(get_class($this)."::set_paid rowid=".$this->id, LOG_DEBUG); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; - $sql.= ' fk_statut=2'; - if (! $close_code) $sql.= ', paye=1'; - if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; - if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; - $sql.= ' WHERE rowid = '.$this->id; + dol_syslog(get_class($this)."::set_paid rowid=".$this->id, LOG_DEBUG); + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; + $sql.= ' fk_statut=2'; + if (! $close_code) $sql.= ', paye=1'; + if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; + if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; + $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - // Call trigger - $result=$this->call_trigger('BILL_PAYED',$user); - if ($result < 0) $error++; - // End call triggers - } - else - { - $error++; - $this->error=$this->db->lasterror(); - } + dol_syslog(get_class($this)."::set_paid", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + // Call trigger + $result=$this->call_trigger('BILL_PAYED',$user); + if ($result < 0) $error++; + // End call triggers + } + else + { + $error++; + $this->error=$this->db->lasterror(); + } - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - else - { - return 0; - } - } + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + else + { + return 0; + } + } - /** - * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED - * Fonction utilisee quand un paiement prelevement est refuse, - * ou quand une facture annulee et reouverte. - * - * @param User $user Object user that change status - * @return int <0 if KO, >0 if OK - */ - function set_unpaid($user) - { - global $conf,$langs; - $error=0; + /** + * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED + * Fonction utilisee quand un paiement prelevement est refuse, + * ou quand une facture annulee et reouverte. + * + * @param User $user Object user that change status + * @return int <0 if KO, >0 if OK + */ + function set_unpaid($user) + { + global $conf,$langs; + $error=0; - $this->db->begin(); + $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; - $sql.= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null'; + $sql.= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { + dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { // Call trigger $result=$this->call_trigger('BILL_UNPAYED',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers - } - else - { - $error++; - $this->error=$this->db->error(); - dol_print_error($this->db); - } - - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - - - /** - * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL - * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because - * of no payment even if merchandises were sent). - * - * @param User $user Object user making change - * @param string $close_code Code de fermeture - * @param string $close_note Comment - * @return int <0 if KO, >0 if OK - */ - function set_canceled($user,$close_code='',$close_note='') - { - global $conf,$langs; - - $error=0; - - dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); - - $this->db->begin(); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; - $sql.= ' fk_statut=3'; - if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; - if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; - $sql.= ' WHERE rowid = '.$this->id; - - $resql = $this->db->query($sql); - if ($resql) - { - // On desaffecte de la facture les remises liees - // car elles n'ont pas ete utilisees vu que la facture est abandonnee. - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture = NULL'; - $sql.= ' WHERE fk_facture = '.$this->id; - - $resql=$this->db->query($sql); - if ($resql) - { - // Call trigger - $result=$this->call_trigger('BILL_CANCEL',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - } - // End call triggers - - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -2; - } - } - - /** - * Tag invoice as validated + call trigger BILL_VALIDATE - * Object must have lines loaded with fetch_lines - * - * @param User $user Object user that validate - * @param string $force_number Reference to force on invoice - * @param int $idwarehouse Id of warehouse to use for stock decrease - * @return int <0 if KO, >0 if OK - */ - function validate($user, $force_number='', $idwarehouse=0) - { - global $conf,$langs; - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $now=dol_now(); - - $error=0; - dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse); - - // Check parameters - if (! $this->brouillon) - { - dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); - return 0; - } - - if (! $user->rights->facture->valider) - { - $this->error='Permission denied'; - dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR); - return -1; - } - - $this->db->begin(); - - $this->fetch_thirdparty(); - $this->fetch_lines(); - - // Check parameters - if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement - { - // Controle que facture source connue - if ($this->fk_facture_source <= 0) - { - $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("InvoiceReplacement")); - $this->db->rollback(); - return -10; - } - - // Charge la facture source a remplacer - $facreplaced=new Facture($this->db); - $result=$facreplaced->fetch($this->fk_facture_source); - if ($result <= 0) - { - $this->error=$langs->trans("ErrorBadInvoice"); - $this->db->rollback(); - return -11; - } - - // Controle que facture source non deja remplacee par une autre - $idreplacement=$facreplaced->getIdReplacingInvoice('validated'); - if ($idreplacement && $idreplacement != $this->id) - { - $facreplacement=new Facture($this->db); - $facreplacement->fetch($idreplacement); - $this->error=$langs->trans("ErrorInvoiceAlreadyReplaced",$facreplaced->ref,$facreplacement->ref); - $this->db->rollback(); - return -12; - } - - $result=$facreplaced->set_canceled($user,'replaced',''); - if ($result < 0) - { - $this->error=$facreplaced->error; - $this->db->rollback(); - return -13; - } - } - - // Define new ref - if ($force_number) - { - $num = $force_number; - } - else if (preg_match('/^[\(]?PROV/i', $this->ref)) - { - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date - { - $this->date=dol_now(); - $this->date_lim_reglement=$this->calculate_date_lim_reglement(); - } - $num = $this->getNextNumRef($this->client); - } - else - { - $num = $this->ref; - } - - if ($num) - { - $this->update_price(1); - - // Validate - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; - if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date - { - $sql.= ", datef='".$this->db->idate($this->date)."'"; - $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; - } - $sql.= ' WHERE rowid = '.$this->id; - - dol_syslog(get_class($this)."::validate", LOG_DEBUG); - $resql=$this->db->query($sql); - if (! $resql) - { - dol_print_error($this->db); - $error++; - } - - // On verifie si la facture etait une provisoire - if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) - { - // La verif qu'une remise n'est pas utilisee 2 fois est faite au moment de l'insertion de ligne - } - - if (! $error) - { - // Define third party as a customer - $result=$this->client->set_as_client(); - - // Si active on decremente le produit principal et ses composants a la validation de facture - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); - - // Loop on each line - $cpt=count($this->lines); - for ($i = 0; $i < $cpt; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); - else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); - if ($result < 0) { - $error++; - } - } - } - } - } - - if (! $error) - { - $this->oldref = ''; - - // Rename directory if dir was a temporary ref - if (preg_match('/^[\(]?PROV/i', $this->ref)) - { - // Rename of object directory ($this->ref = old ref, $num = new ref) - // to not lose the linked files - $facref = dol_sanitizeFileName($this->ref); - $snumfa = dol_sanitizeFileName($num); - $dirsource = $conf->facture->dir_output.'/'.$facref; - $dirdest = $conf->facture->dir_output.'/'.$snumfa; - if (file_exists($dirsource)) - { - dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); - - if (@rename($dirsource, $dirdest)) - { - $this->oldref = $facref; - - dol_syslog("Rename ok"); - // Suppression ancien fichier PDF dans nouveau rep - dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); - } - } - } - } - - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->facnumber=$num; - $this->statut=1; - $this->brouillon=0; - $this->date_validation=$now; - } - - // Trigger calls - if (! $error) - { - // Call trigger - $result=$this->call_trigger('BILL_VALIDATE',$user); - if ($result < 0) $error++; - //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail - // End call triggers - } - } - else - { - $error++; - } - - if (! $error) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - - /** - * Set draft status - * - * @param User $user Object user that modify - * @param int $idwarehouse Id warehouse to use for stock change. - * @return int <0 if KO, >0 if OK - */ - function set_draft($user,$idwarehouse=-1) - { - global $conf,$langs; - - $error=0; - - if ($this->statut == 0) - { - dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); - return 0; - } - - $this->db->begin(); - - $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; - $sql.= " SET fk_statut = 0"; - $sql.= " WHERE rowid = ".$this->id; - - dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); - $result=$this->db->query($sql); - if ($result) - { - // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement - if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) - { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; - $langs->load("agenda"); - - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if ($this->lines[$i]->fk_product > 0) - { - $mouvP = new MouvementStock($this->db); - $mouvP->origin = &$this; - // We decrease stock for product - if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); - else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value - } - } - } - - if ($error == 0) - { - $old_statut=$this->statut; - $this->brouillon = 1; - $this->statut = 0; - // Call trigger - $result=$this->call_trigger('BILL_UNVALIDATE',$user); - if ($result < 0) - { - $error++; - $this->statut=$old_statut; - $this->brouillon=0; - } - // End call triggers - } else { - $this->db->rollback(); - return -1; - } - - if ($error == 0) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } - - - /** - * Add an invoice line into database (linked to product/service or not). - * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel - * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini - * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) - * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) - * - * @param string $desc Description of line - * @param double $pu_ht Unit price without tax (> 0 even for credit note) - * @param double $qty Quantity - * @param double $txtva Force vat rate, -1 for auto - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate - * @param int $fk_product Id of predefined product/service - * @param double $remise_percent Percent of discount on line - * @param timestamp $date_start Date start of service - * @param timestamp $date_end Date end of service - * @param int $ventil Code of dispatching into accountancy - * @param int $info_bits Bits de type de lignes - * @param int $fk_remise_except Id discount used - * @param string $price_base_type 'HT' or 'TTC' - * @param double $pu_ttc Unit price with tax (> 0 even for credit note) - * @param int $type Type of line (0=product, 1=service) - * @param int $rang Position of line - * @param int $special_code Special code (also used by externals modules!) - * @param string $origin 'order', ... - * @param int $origin_id Id of origin object - * @param int $fk_parent_line Id of parent line - * @param int $fk_fournprice Supplier price id (to calculate margin) or '' - * @param int $pa_ht Buying price of line (to calculate margin) or '' - * @param string $label Label of the line (deprecated, do not use) - * @param array $array_option extrafields array - * @return int <0 if KO, Id of line if OK - */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $remise_amount=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0) - { - global $mysoc, $conf, $langs; - - dol_syslog(get_class($this)."::addline facid=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - // Clean parameters - if (empty($remise_percent)) $remise_percent=0; - if (empty($remise_amount)) $remise_amount=0; - if (empty($qty)) $qty=0; - if (empty($info_bits)) $info_bits=0; - if (empty($rang)) $rang=0; - if (empty($ventil)) $ventil=0; - if (empty($txtva)) $txtva=0; - if (empty($txlocaltax1)) $txlocaltax1=0; - if (empty($txlocaltax2)) $txlocaltax2=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - - $remise_percent=price2num($remise_percent); - $remise_amount=price2num($remise_amount); - $qty=price2num($qty); - $pu_ht=price2num($pu_ht); - $pu_ttc=price2num($pu_ttc); - $pa_ht=price2num($pa_ht); - $txtva=price2num($txtva); - $txlocaltax1=price2num($txlocaltax1); - $txlocaltax2=price2num($txlocaltax2); - - if ($price_base_type=='HT') - { - $pu=$pu_ht; - } - else - { - $pu=$pu_ttc; - } - - // Check parameters - if ($type < 0) return -1; - - if (! empty($this->brouillon)) - { - $this->db->begin(); - - // Calcul du total TTC et de la TVA pour la ligne a partir de - // qty, pu, remise_percent et txtva - // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker - // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - - $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); - - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type); - - $total_ht = $tabprice[0]; - $total_tva = $tabprice[1]; - $total_ttc = $tabprice[2]; - $total_localtax1 = $tabprice[9]; - $total_localtax2 = $tabprice[10]; - $pu_ht = $tabprice[3]; - - // Rang to use - $rangtouse = $rang; - if ($rangtouse == -1) - { - $rangmax = $this->line_max($fk_parent_line); - $rangtouse = $rangmax + 1; - } - - $product_type=$type; - if (!empty($fk_product)) - { - $product=new Product($this->db); - $result=$product->fetch($fk_product); - $product_type=$product->type; - - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { - $this->error=$langs->trans('ErrorStockIsNotEnough'); - $this->db->rollback(); - return -3; - } - } - - // Insert line - $this->line=new FactureLigne($this->db); - $this->line->fk_facture=$this->id; - $this->line->label=$label; // deprecated - $this->line->desc=$desc; - $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative - $this->line->tva_tx=$txtva; - $this->line->localtax1_tx=$txlocaltax1; - $this->line->localtax2_tx=$txlocaltax2; - $this->line->fk_product=$fk_product; - $this->line->product_type=$product_type; - $this->line->remise_percent=$remise_percent; - $this->line->remise_amount=$remise_amount; - $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise - $this->line->date_start=$date_start; - $this->line->date_end=$date_end; - $this->line->ventil=$ventil; - $this->line->rang=$rangtouse; - $this->line->info_bits=$info_bits; - $this->line->fk_remise_except=$fk_remise_except; - $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); - $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); - $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); - $this->line->special_code=$special_code; - $this->line->fk_parent_line=$fk_parent_line; - $this->line->origin=$origin; - $this->line->origin_id=$origin_id; - - // infos marge - $this->line->fk_fournprice = $fk_fournprice; - $this->line->pa_ht = $pa_ht; - - if (is_array($array_option) && count($array_option)>0) { - $this->line->array_options=$array_option; - } - - $result=$this->line->insert(); - if ($result > 0) - { - // Reorder if child line - if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); - - // Mise a jour informations denormalisees au niveau de la facture meme - $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. - if ($result > 0) - { - $this->db->commit(); - return $this->line->rowid; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - } - else - { - $this->error=$this->line->error; - $this->db->rollback(); - return -2; - } - } - } - - /** - * Update a detail line - * - * @param int $rowid Id of line to update - * @param string $desc Description of line - * @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines) - * @param double $qty Quantity - * @param double $remise_percent Pourcentage de remise de la ligne - * @param date $date_start Date de debut de validite du service - * @param date $date_end Date de fin de validite du service - * @param double $txtva VAT Rate - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate - * @param string $price_base_type HT or TTC - * @param int $info_bits Miscellaneous informations - * @param int $type Type of line (0=product, 1=service) - * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). - * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) - * @param int $fk_fournprice Id of origin supplier price - * @param int $pa_ht Price (without tax) of product when it was bought - * @param string $label Label of the line (deprecated, do not use) - * @param int $special_code Special code (also used by externals modules!) + } + else + { + $error++; + $this->error=$this->db->error(); + dol_print_error($this->db); + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + + /** + * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL + * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because + * of no payment even if merchandises were sent). + * + * @param User $user Object user making change + * @param string $close_code Code de fermeture + * @param string $close_note Comment + * @return int <0 if KO, >0 if OK + */ + function set_canceled($user,$close_code='',$close_note='') + { + global $conf,$langs; + + $error=0; + + dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); + + $this->db->begin(); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture SET'; + $sql.= ' fk_statut=3'; + if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'"; + if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'"; + $sql.= ' WHERE rowid = '.$this->id; + + $resql = $this->db->query($sql); + if ($resql) + { + // On desaffecte de la facture les remises liees + // car elles n'ont pas ete utilisees vu que la facture est abandonnee. + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture = NULL'; + $sql.= ' WHERE fk_facture = '.$this->id; + + $resql=$this->db->query($sql); + if ($resql) + { + // Call trigger + $result=$this->call_trigger('BILL_CANCEL',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -2; + } + } + + /** + * Tag invoice as validated + call trigger BILL_VALIDATE + * Object must have lines loaded with fetch_lines + * + * @param User $user Object user that validate + * @param string $force_number Reference to force on invoice + * @param int $idwarehouse Id of warehouse to use for stock decrease + * @return int <0 if KO, >0 if OK + */ + function validate($user, $force_number='', $idwarehouse=0) + { + global $conf,$langs; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $now=dol_now(); + + $error=0; + dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse); + + // Check parameters + if (! $this->brouillon) + { + dol_syslog(get_class($this)."::validate no draft status", LOG_WARNING); + return 0; + } + + if (! $user->rights->facture->valider) + { + $this->error='Permission denied'; + dol_syslog(get_class($this)."::validate ".$this->error, LOG_ERR); + return -1; + } + + $this->db->begin(); + + $this->fetch_thirdparty(); + $this->fetch_lines(); + + // Check parameters + if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement + { + // Controle que facture source connue + if ($this->fk_facture_source <= 0) + { + $this->error=$langs->trans("ErrorFieldRequired",$langs->trans("InvoiceReplacement")); + $this->db->rollback(); + return -10; + } + + // Charge la facture source a remplacer + $facreplaced=new Facture($this->db); + $result=$facreplaced->fetch($this->fk_facture_source); + if ($result <= 0) + { + $this->error=$langs->trans("ErrorBadInvoice"); + $this->db->rollback(); + return -11; + } + + // Controle que facture source non deja remplacee par une autre + $idreplacement=$facreplaced->getIdReplacingInvoice('validated'); + if ($idreplacement && $idreplacement != $this->id) + { + $facreplacement=new Facture($this->db); + $facreplacement->fetch($idreplacement); + $this->error=$langs->trans("ErrorInvoiceAlreadyReplaced",$facreplaced->ref,$facreplacement->ref); + $this->db->rollback(); + return -12; + } + + $result=$facreplaced->set_canceled($user,'replaced',''); + if ($result < 0) + { + $this->error=$facreplaced->error; + $this->db->rollback(); + return -13; + } + } + + // Define new ref + if ($force_number) + { + $num = $force_number; + } + else if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date + { + $this->date=dol_now(); + $this->date_lim_reglement=$this->calculate_date_lim_reglement(); + } + $num = $this->getNextNumRef($this->client); + } + else + { + $num = $this->ref; + } + + if ($num) + { + $this->update_price(1); + + // Validate + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'"; + if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date + { + $sql.= ", datef='".$this->db->idate($this->date)."'"; + $sql.= ", date_lim_reglement='".$this->db->idate($this->date_lim_reglement)."'"; + } + $sql.= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::validate", LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) + { + dol_print_error($this->db); + $error++; + } + + // On verifie si la facture etait une provisoire + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + { + // La verif qu'une remise n'est pas utilisee 2 fois est faite au moment de l'insertion de ligne + } + + if (! $error) + { + // Define third party as a customer + $result=$this->client->set_as_client(); + + // Si active on decremente le produit principal et ses composants a la validation de facture + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); + + // Loop on each line + $cpt=count($this->lines); + for ($i = 0; $i < $cpt; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); + if ($result < 0) { + $error++; + } + } + } + } + } + + if (! $error) + { + $this->oldref = ''; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // Rename of object directory ($this->ref = old ref, $num = new ref) + // to not lose the linked files + $facref = dol_sanitizeFileName($this->ref); + $snumfa = dol_sanitizeFileName($num); + $dirsource = $conf->facture->dir_output.'/'.$facref; + $dirdest = $conf->facture->dir_output.'/'.$snumfa; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + $this->oldref = $facref; + + dol_syslog("Rename ok"); + // Suppression ancien fichier PDF dans nouveau rep + dol_delete_file($conf->facture->dir_output.'/'.$snumfa.'/'.$facref.'*.*'); + } + } + } + } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->facnumber=$num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } + + // Trigger calls + if (! $error) + { + // Call trigger + $result=$this->call_trigger('BILL_VALIDATE',$user); + if ($result < 0) $error++; + //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail + // End call triggers + } + } + else + { + $error++; + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + + /** + * Set draft status + * + * @param User $user Object user that modify + * @param int $idwarehouse Id warehouse to use for stock change. + * @return int <0 if KO, >0 if OK + */ + function set_draft($user,$idwarehouse=-1) + { + global $conf,$langs; + + $error=0; + + if ($this->statut == 0) + { + dol_syslog(get_class($this)."::set_draft already draft status", LOG_WARNING); + return 0; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."facture"; + $sql.= " SET fk_statut = 0"; + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::set_draft", LOG_DEBUG); + $result=$this->db->query($sql); + if ($result) + { + // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement + if ($this->type != self::TYPE_DEPOSIT && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + $langs->load("agenda"); + + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if ($this->lines[$i]->fk_product > 0) + { + $mouvP = new MouvementStock($this->db); + $mouvP->origin = &$this; + // We decrease stock for product + if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); + else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceBackToDraftInDolibarr",$this->ref)); // we use 0 for price, to not change the weighted average value + } + } + } + + if ($error == 0) + { + $old_statut=$this->statut; + $this->brouillon = 1; + $this->statut = 0; + // Call trigger + $result=$this->call_trigger('BILL_UNVALIDATE',$user); + if ($result < 0) + { + $error++; + $this->statut=$old_statut; + $this->brouillon=0; + } + // End call triggers + } else { + $this->db->rollback(); + return -1; + } + + if ($error == 0) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + + + /** + * Add an invoice line into database (linked to product/service or not). + * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel + * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini + * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) + * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) + * + * @param string $desc Description of line + * @param double $pu_ht Unit price without tax (> 0 even for credit note) + * @param double $qty Quantity + * @param double $txtva Force vat rate, -1 for auto + * @param double $txlocaltax1 Local tax 1 rate + * @param double $txlocaltax2 Local tax 2 rate + * @param int $fk_product Id of predefined product/service + * @param double $remise_percent Percent of discount on line + * @param timestamp $date_start Date start of service + * @param timestamp $date_end Date end of service + * @param int $ventil Code of dispatching into accountancy + * @param int $info_bits Bits de type de lignes + * @param int $fk_remise_except Id discount used + * @param string $price_base_type 'HT' or 'TTC' + * @param double $pu_ttc Unit price with tax (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $rang Position of line + * @param int $special_code Special code (also used by externals modules!) + * @param string $origin 'order', ... + * @param int $origin_id Id of origin object + * @param int $fk_parent_line Id of parent line + * @param int $fk_fournprice Supplier price id (to calculate margin) or '' + * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param string $label Label of the line (deprecated, do not use) + * @param array $array_option extrafields array + * @return int <0 if KO, Id of line if OK + */ + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0) + { + global $mysoc, $conf, $langs; + + dol_syslog(get_class($this)."::addline facid=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type", LOG_DEBUG); + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + // Clean parameters + if (empty($remise_percent)) $remise_percent=0; + if (empty($qty)) $qty=0; + if (empty($info_bits)) $info_bits=0; + if (empty($rang)) $rang=0; + if (empty($ventil)) $ventil=0; + if (empty($txtva)) $txtva=0; + if (empty($txlocaltax1)) $txlocaltax1=0; + if (empty($txlocaltax2)) $txlocaltax2=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + + $remise_percent=price2num($remise_percent); + $qty=price2num($qty); + $pu_ht=price2num($pu_ht); + $pu_ttc=price2num($pu_ttc); + $pa_ht=price2num($pa_ht); + $txtva=price2num($txtva); + $txlocaltax1=price2num($txlocaltax1); + $txlocaltax2=price2num($txlocaltax2); + + if ($price_base_type=='HT') + { + $pu=$pu_ht; + } + else + { + $pu=$pu_ttc; + } + + // Check parameters + if ($type < 0) return -1; + + if (! empty($this->brouillon)) + { + $this->db->begin(); + + // Calcul du total TTC et de la TVA pour la ligne a partir de + // qty, pu, remise_percent et txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); + + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type); + + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + $total_localtax1 = $tabprice[9]; + $total_localtax2 = $tabprice[10]; + $pu_ht = $tabprice[3]; + + // Rang to use + $rangtouse = $rang; + if ($rangtouse == -1) + { + $rangmax = $this->line_max($fk_parent_line); + $rangtouse = $rangmax + 1; + } + + $product_type=$type; + if (!empty($fk_product)) + { + $product=new Product($this->db); + $result=$product->fetch($fk_product); + $product_type=$product->type; + + if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { + $this->error=$langs->trans('ErrorStockIsNotEnough'); + $this->db->rollback(); + return -3; + } + } + + // Insert line + $this->line=new FactureLigne($this->db); + $this->line->fk_facture=$this->id; + $this->line->label=$label; // deprecated + $this->line->desc=$desc; + $this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->tva_tx=$txtva; + $this->line->localtax1_tx=$txlocaltax1; + $this->line->localtax2_tx=$txlocaltax2; + $this->line->fk_product=$fk_product; + $this->line->product_type=$product_type; + $this->line->remise_percent=$remise_percent; + $this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->date_start=$date_start; + $this->line->date_end=$date_end; + $this->line->ventil=$ventil; + $this->line->rang=$rangtouse; + $this->line->info_bits=$info_bits; + $this->line->fk_remise_except=$fk_remise_except; + $this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + $this->line->special_code=$special_code; + $this->line->fk_parent_line=$fk_parent_line; + $this->line->origin=$origin; + $this->line->origin_id=$origin_id; + + // infos marge + $this->line->fk_fournprice = $fk_fournprice; + $this->line->pa_ht = $pa_ht; + + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + + $result=$this->line->insert(); + if ($result > 0) + { + // Reorder if child line + if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); + + // Mise a jour informations denormalisees au niveau de la facture meme + $result=$this->update_price(1,'auto',0,$mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode. + if ($result > 0) + { + $this->db->commit(); + return $this->line->rowid; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + } + else + { + $this->error=$this->line->error; + $this->db->rollback(); + return -2; + } + } + } + + /** + * Update a detail line + * + * @param int $rowid Id of line to update + * @param string $desc Description of line + * @param double $pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines) + * @param double $qty Quantity + * @param double $remise_percent Pourcentage de remise de la ligne + * @param date $date_start Date de debut de validite du service + * @param date $date_end Date de fin de validite du service + * @param double $txtva VAT Rate + * @param double $txlocaltax1 Local tax 1 rate + * @param double $txlocaltax2 Local tax 2 rate + * @param string $price_base_type HT or TTC + * @param int $info_bits Miscellaneous informations + * @param int $type Type of line (0=product, 1=service) + * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). + * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) + * @param int $fk_fournprice Id of origin supplier price + * @param int $pa_ht Price (without tax) of product when it was bought + * @param string $label Label of the line (deprecated, do not use) + * @param int $special_code Special code (also used by externals modules!) * @param array $array_option extrafields array - * @return int < 0 if KO, > 0 if OK - */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - - global $mysoc; - - dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG); - - if ($this->brouillon) - { - $this->db->begin(); - - // Clean parameters - if (empty($qty)) $qty=0; - if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; - if (empty($special_code) || $special_code == 3) $special_code=0; - - $remise_percent = price2num($remise_percent); - $qty = price2num($qty); - $pu = price2num($pu); - $pa_ht = price2num($pa_ht); - $txtva = price2num($txtva); - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); - - // Check parameters - if ($type < 0) return -1; - - // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva - // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker - // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - - $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); - - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); - $total_ht = $tabprice[0]; - $total_tva = $tabprice[1]; - $total_ttc = $tabprice[2]; - $total_localtax1=$tabprice[9]; - $total_localtax2=$tabprice[10]; - $pu_ht = $tabprice[3]; - $pu_tva = $tabprice[4]; - $pu_ttc = $tabprice[5]; - - // Update line into database - $this->line=new FactureLigne($this->db); - - // Stock previous line records - $staticline=new FactureLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; - - // Reorder if fk_parent_line change - if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) - { - $rangmax = $this->line_max($fk_parent_line); - $this->line->rang = $rangmax + 1; - } - - $this->line->rowid = $rowid; - $this->line->label = $label; - $this->line->desc = $desc; - $this->line->qty = ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative - $this->line->tva_tx = $txtva; - $this->line->localtax1_tx = $txlocaltax1; - $this->line->localtax2_tx = $txlocaltax2; - $this->line->localtax1_type = $localtaxes_type[0]; - $this->line->localtax2_type = $localtaxes_type[2]; - $this->line->remise_percent = $remise_percent; - $this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise - $this->line->date_start = $date_start; - $this->line->date_end = $date_end; - $this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative - $this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); - $this->line->total_localtax1 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); - $this->line->total_localtax2 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); - $this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); - $this->line->info_bits = $info_bits; - $this->line->special_code = $special_code; - $this->line->product_type = $type; - $this->line->fk_parent_line = $fk_parent_line; - $this->line->skip_update_total = $skip_update_total; - - // infos marge - $this->line->fk_fournprice = $fk_fournprice; - $this->line->pa_ht = $pa_ht; - - if (is_array($array_option) && count($array_option)>0) { - $this->line->array_options=$array_option; - } - - $result=$this->line->update(); - if ($result > 0) - { - // Reorder if child line - if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); - - // Mise a jour info denormalisees au niveau facture - $this->update_price(1); - $this->db->commit(); - return $result; - } - else - { - $this->error=$this->line->error; - $this->db->rollback(); - return -1; - } - } - else - { - $this->error="Invoice statut makes operation forbidden"; - return -2; - } - } - - /** - * Delete line in database - * - * @param int $rowid Id of line to delete - * @return int <0 if KO, >0 if OK - */ - function deleteline($rowid) - { - global $langs, $conf; - - dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); - - if (! $this->brouillon) - { - $this->error='ErrorBadStatus'; - return -1; - } - - $this->db->begin(); - - // Libere remise liee a ligne de facture - $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; - $sql.= ' SET fk_facture_line = NULL'; - $sql.= ' WHERE fk_facture_line = '.$rowid; - - dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); - $result = $this->db->query($sql); - if (! $result) - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -1; - } - - $line=new FactureLigne($this->db); - - // For triggers - $line->fetch($rowid); - - if ($line->delete() > 0) - { - $result=$this->update_price(1); - - if ($result > 0) - { - $this->db->commit(); - return 1; - } - else - { - $this->db->rollback(); - $this->error=$this->db->lasterror(); - return -1; - } - } - else - { - $this->db->rollback(); - $this->error=$line->error; - return -1; - } - } - - /** - * Set percent discount - * - * @param User $user User that set discount - * @param double $remise Discount - * @return int <0 if ko, >0 if ok - */ - function set_remise($user, $remise) - { - // Clean parameters - if (empty($remise)) $remise=0; - - if ($user->rights->facture->creer) - { - $remise=price2num($remise); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET remise_percent = '.$remise; - $sql.= ' WHERE rowid = '.$this->id; - $sql.= ' AND fk_statut = 0'; - - if ($this->db->query($sql)) - { - $this->remise_percent = $remise; - $this->update_price(1); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - } - - - /** - * Set absolute discount - * - * @param User $user User that set discount - * @param double $remise Discount - * @return int <0 if KO, >0 if OK - */ - function set_remise_absolue($user, $remise) - { - if (empty($remise)) $remise=0; - - if ($user->rights->facture->creer) - { - $remise=price2num($remise); - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; - $sql.= ' SET remise_absolue = '.$remise; - $sql.= ' WHERE rowid = '.$this->id; - $sql.= ' AND fk_statut = 0'; - - dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); - - if ($this->db->query($sql)) - { - $this->remise_absolue = $remise; - $this->update_price(1); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - } - - /** - * Return list of payments - * - * @param string $filtertype 1 to filter on type of payment == 'PRE' - * @return array Array with list of payments - */ - function getListOfPayments($filtertype='') - { - $retarray=array(); - - $table='paiement_facture'; - $table2='paiement'; - $field='fk_facture'; - $field2='fk_paiement'; - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') - { - $table='paiementfourn_facturefourn'; - $table2='paiementfourn'; - $field='fk_facturefourn'; - $field2='fk_paiementfourn'; - } - - $sql = 'SELECT pf.amount, p.fk_paiement, p.datep, t.code'; - $sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t'; - $sql.= ' WHERE pf.'.$field.' = '.$this->id; - $sql.= ' AND pf.'.$field2.' = p.rowid'; - $sql.= ' AND p.fk_paiement = t.id'; - if ($filtertype) $sql.=" AND t.code='PRE'"; - - dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); - $retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep); - $i++; - } - $this->db->free($resql); - return $retarray; - } - else - { - $this->error=$this->db->lasterror(); - dol_print_error($this->db); - return array(); - } - } - - - /** - * Return amount (with tax) of all credit notes and deposits invoices used by invoice - * - * @return int <0 if KO, Sum of credit notes and deposits amount otherwise - */ - function getSumCreditNotesUsed() - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - - $discountstatic=new DiscountAbsolute($this->db); - $result=$discountstatic->getSumCreditNotesUsed($this); - if ($result >= 0) - { - return $result; - } - else - { - $this->error=$discountstatic->error; - return -1; - } - } - - /** - * Return amount (with tax) of all deposits invoices used by invoice - * - * @return int <0 if KO, Sum of deposits amount otherwise - */ - function getSumDepositsUsed() - { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - - $discountstatic=new DiscountAbsolute($this->db); - $result=$discountstatic->getSumDepositsUsed($this); - if ($result >= 0) - { - return $result; - } - else - { - $this->error=$discountstatic->error; - return -1; - } - } - - /** - * Return next reference of customer invoice not already used (or last reference) - * according to numbering module defined into constant FACTURE_ADDON - * - * @param Society $soc object company - * @param string $mode 'next' for next value or 'last' for last value - * @return string free ref or last ref - */ - function getNextNumRef($soc,$mode='next') - { - global $conf, $db, $langs; - $langs->load("bills"); - - // Clean parameters (if not defined or using deprecated value) - if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; - - $mybool=false; - - $file = $conf->global->FACTURE_ADDON.".php"; - $classname = $conf->global->FACTURE_ADDON; - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/facture/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } - - // For compatibility - if (! $mybool) - { - $file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php"; - $classname = "mod_facture_".$conf->global->FACTURE_ADDON; - $classname = preg_replace('/\-.*$/','',$classname); - // Include file with class - foreach ($conf->file->dol_document_root as $dirroot) - { - $dir = $dirroot."/core/modules/facture/"; - // Load file with numbering class (if found) - $mybool|=@include_once $dir.$file; - } - } - //print "xx".$mybool.$dir.$file."-".$classname; - - if (! $mybool) - { - dol_print_error('',"Failed to include file ".$file); - return ''; - } - - $obj = new $classname(); - $numref = ""; - $numref = $obj->getNumRef($soc,$this,$mode); - - if ($numref != "") - { - return $numref; - } - else - { - //dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); - return false; - } - } - - /** - * Load miscellaneous information for tab "Info" - * - * @param int $id Id of object to load - * @return void - */ - function info($id) - { - $sql = 'SELECT c.rowid, datec, date_valid as datev, tms as datem,'; - $sql.= ' fk_user_author, fk_user_valid'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as c'; - $sql.= ' WHERE c.rowid = '.$id; - - $result=$this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - if ($obj->fk_user_author) - { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - if ($obj->fk_user_valid) - { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); // Should be in log table - } - $this->db->free($result); - } - else - { - dol_print_error($this->db); - } - } - - /** - * Renvoi si les lignes de facture sont ventilees et/ou exportees en compta - * - * @return int <0 if KO, 0=no, 1=yes - */ - function getVentilExportCompta() - { - // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees - $ventilExportCompta = 0 ; - $num=count($this->lines); - for ($i = 0; $i < $num; $i++) - { - if (! empty($this->lines[$i]->export_compta) && ! empty($this->lines[$i]->code_ventilation)) - { - $ventilExportCompta++; - } - } - - if ($ventilExportCompta <> 0) - { - return 1; - } - else - { - return 0; - } - } - - - /** - * Return if an invoice can be deleted - * Rule is: - * If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can - * If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule - * If invoice is draft and ha a temporary ref -> yes - * - * @return int <0 if KO, 0=no, 1=yes - */ - function is_erasable() - { - global $conf; - - if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1; - if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0; - - // on verifie si la facture est en numerotation provisoire - $facref = substr($this->ref, 1, 4); - - // If not a draft invoice and not temporary invoice - if ($facref != 'PROV') - { - $maxfacnumber = $this->getNextNumRef($this->client,'last'); - $ventilExportCompta = $this->getVentilExportCompta(); - // If there is no invoice into the reset range and not already dispatched, we can delete - if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; - // If invoice to delete is last one and not already dispatched, we can delete - if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1; - } - else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire - { - return 1; - } - - return 0; - } - - - /** - * Return list of invoices (eventually filtered on a user) into an array - * - * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) - * @param int $draft 0=not draft, 1=draft - * @param User $excluser Objet user to exclude - * @param int $socid Id third pary - * @param int $limit For pagination - * @param int $offset For pagination - * @param string $sortfield Sort criteria - * @param string $sortorder Sort order - * @return int -1 if KO, array with result if OK - */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') - { - global $conf,$user; - - $ga = array(); - - $sql = "SELECT s.rowid, s.nom as name, s.client,"; - $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; - if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_soc = s.rowid"; - if (! $user->rights->societe->client->voir && ! $socid) //restriction - { - $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } - if ($socid) $sql.= " AND s.rowid = ".$socid; - if ($draft) $sql.= " AND f.fk_statut = 0"; - if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; - $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit,$offset); - - $result=$this->db->query($sql); - if ($result) - { - $numc = $this->db->num_rows($result); - if ($numc) - { - $i = 0; - while ($i < $numc) - { - $obj = $this->db->fetch_object($result); - - if ($shortlist == 1) - { - $ga[$obj->fid] = $obj->ref; - } - else if ($shortlist == 2) - { - $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; - } - else - { - $ga[$i]['id'] = $obj->fid; - $ga[$i]['ref'] = $obj->ref; - $ga[$i]['name'] = $obj->name; - } - $i++; - } - } - return $ga; - } - else - { - dol_print_error($this->db); - return -1; - } - } - - - /** - * Renvoi liste des factures remplacables - * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee - * - * @param int $socid Id societe - * @return array Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) - */ - function list_replacable_invoices($socid=0) - { - global $conf; - - $return = array(); - - $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut,"; - $sql.= " ff.rowid as rowidnext"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source"; - $sql.= " WHERE (f.fk_statut = 1 OR (f.fk_statut = 3 AND f.close_code = 'abandon'))"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.paye = 0"; // Pas classee payee completement - $sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait - $sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement - if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; - $sql.= " ORDER BY f.facnumber"; - - dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $return[$obj->rowid]=array( 'id' => $obj->rowid, - 'ref' => $obj->facnumber, - 'status' => $obj->fk_statut); - } - //print_r($return); - return $return; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - - - /** - * Renvoi liste des factures qualifiables pour correction par avoir - * Les factures qui respectent les regles suivantes sont retournees: - * (validee + paiement en cours) ou classee (payee completement ou payee partiellement) + pas deja remplacee + pas deja avoir - * - * @param int $socid Id societe - * @return array Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) - */ - function list_qualified_avoir_invoices($socid=0) - { - global $conf; - - $return = array(); - - $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut, f.type, f.paye, pf.fk_paiement"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")"; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut in (1,2)"; - // $sql.= " WHERE f.fk_statut >= 1"; - // $sql.= " AND (f.paye = 1"; // Classee payee completement - // $sql.= " OR f.close_code IS NOT NULL)"; // Classee payee partiellement - $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement - $sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir - if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; - $sql.= " ORDER BY f.facnumber"; - - dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $qualified=0; - if ($obj->fk_statut == 1) $qualified=1; - if ($obj->fk_statut == 2) $qualified=1; - if ($qualified) - { - //$ref=$obj->facnumber; - $paymentornot=($obj->fk_paiement?1:0); - $return[$obj->rowid]=array('ref'=>$obj->facnumber,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot); - } - } - - return $return; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } - - - /** - * Create a withdrawal request for a standing order - * - * @param User $user User asking standing order - * @return int <0 if KO, >0 if OK - */ - function demande_prelevement($user) - { - dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); - - if ($this->statut > 0 && $this->paye == 0) - { - require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; - $bac = new CompanyBankAccount($this->db); - $bac->fetch(0,$this->socid); - - $sql = 'SELECT count(*)'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; - $sql.= ' WHERE fk_facture = '.$this->id; - $sql.= ' AND traite = 0'; - - dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $row = $this->db->fetch_row($resql); - if ($row[0] == 0) - { - $now=dol_now(); + * @return int < 0 if KO, > 0 if OK + */ + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + + global $mysoc; + + dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1, $txlocaltax2, $price_base_type, $info_bits, $type, $fk_parent_line", LOG_DEBUG); + + if ($this->brouillon) + { + $this->db->begin(); + + // Clean parameters + if (empty($qty)) $qty=0; + if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0; + if (empty($special_code) || $special_code == 3) $special_code=0; + + $remise_percent = price2num($remise_percent); + $qty = price2num($qty); + $pu = price2num($pu); + $pa_ht = price2num($pa_ht); + $txtva = price2num($txtva); + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); + + // Check parameters + if ($type < 0) return -1; + + // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + + $localtaxes_type=getLocalTaxesFromRate($txtva,0,$this->thirdparty, $mysoc); + + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type,'',$localtaxes_type); + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + $total_localtax1=$tabprice[9]; + $total_localtax2=$tabprice[10]; + $pu_ht = $tabprice[3]; + $pu_tva = $tabprice[4]; + $pu_ttc = $tabprice[5]; + + // Update line into database + $this->line=new FactureLigne($this->db); + + // Stock previous line records + $staticline=new FactureLigne($this->db); + $staticline->fetch($rowid); + $this->line->oldline = $staticline; + + // Reorder if fk_parent_line change + if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) + { + $rangmax = $this->line_max($fk_parent_line); + $this->line->rang = $rangmax + 1; + } + + $this->line->rowid = $rowid; + $this->line->label = $label; + $this->line->desc = $desc; + $this->line->qty = ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative + $this->line->tva_tx = $txtva; + $this->line->localtax1_tx = $txlocaltax1; + $this->line->localtax2_tx = $txlocaltax2; + $this->line->localtax1_type = $localtaxes_type[0]; + $this->line->localtax2_type = $localtaxes_type[2]; + $this->line->remise_percent = $remise_percent; + $this->line->subprice = ($this->type==2?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise + $this->line->date_start = $date_start; + $this->line->date_end = $date_end; + $this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative + $this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); + $this->line->total_localtax1 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); + $this->line->total_localtax2 = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); + $this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); + $this->line->info_bits = $info_bits; + $this->line->special_code = $special_code; + $this->line->product_type = $type; + $this->line->fk_parent_line = $fk_parent_line; + $this->line->skip_update_total = $skip_update_total; + + // infos marge + $this->line->fk_fournprice = $fk_fournprice; + $this->line->pa_ht = $pa_ht; + + if (is_array($array_option) && count($array_option)>0) { + $this->line->array_options=$array_option; + } + + $result=$this->line->update(); + if ($result > 0) + { + // Reorder if child line + if (! empty($fk_parent_line)) $this->line_order(true,'DESC'); + + // Mise a jour info denormalisees au niveau facture + $this->update_price(1); + $this->db->commit(); + return $result; + } + else + { + $this->error=$this->line->error; + $this->db->rollback(); + return -1; + } + } + else + { + $this->error="Invoice statut makes operation forbidden"; + return -2; + } + } + + /** + * Delete line in database + * + * @param int $rowid Id of line to delete + * @return int <0 if KO, >0 if OK + */ + function deleteline($rowid) + { + global $langs, $conf; + + dol_syslog(get_class($this)."::deleteline rowid=".$rowid, LOG_DEBUG); + + if (! $this->brouillon) + { + $this->error='ErrorBadStatus'; + return -1; + } + + $this->db->begin(); + + // Libere remise liee a ligne de facture + $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; + $sql.= ' SET fk_facture_line = NULL'; + $sql.= ' WHERE fk_facture_line = '.$rowid; + + dol_syslog(get_class($this)."::deleteline", LOG_DEBUG); + $result = $this->db->query($sql); + if (! $result) + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + + $line=new FactureLigne($this->db); + + // For triggers + $line->fetch($rowid); + + if ($line->delete() > 0) + { + $result=$this->update_price(1); + + if ($result > 0) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + $this->error=$this->db->lasterror(); + return -1; + } + } + else + { + $this->db->rollback(); + $this->error=$line->error; + return -1; + } + } + + /** + * Set percent discount + * + * @param User $user User that set discount + * @param double $remise Discount + * @return int <0 if ko, >0 if ok + */ + function set_remise($user, $remise) + { + // Clean parameters + if (empty($remise)) $remise=0; + + if ($user->rights->facture->creer) + { + $remise=price2num($remise); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET remise_percent = '.$remise; + $sql.= ' WHERE rowid = '.$this->id; + $sql.= ' AND fk_statut = 0'; + + if ($this->db->query($sql)) + { + $this->remise_percent = $remise; + $this->update_price(1); + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + } + + + /** + * Set absolute discount + * + * @param User $user User that set discount + * @param double $remise Discount + * @return int <0 if KO, >0 if OK + */ + function set_remise_absolue($user, $remise) + { + if (empty($remise)) $remise=0; + + if ($user->rights->facture->creer) + { + $remise=price2num($remise); + + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; + $sql.= ' SET remise_absolue = '.$remise; + $sql.= ' WHERE rowid = '.$this->id; + $sql.= ' AND fk_statut = 0'; + + dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG); + + if ($this->db->query($sql)) + { + $this->remise_absolue = $remise; + $this->update_price(1); + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + } + + /** + * Return list of payments + * + * @param string $filtertype 1 to filter on type of payment == 'PRE' + * @return array Array with list of payments + */ + function getListOfPayments($filtertype='') + { + $retarray=array(); + + $table='paiement_facture'; + $table2='paiement'; + $field='fk_facture'; + $field2='fk_paiement'; + if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') + { + $table='paiementfourn_facturefourn'; + $table2='paiementfourn'; + $field='fk_facturefourn'; + $field2='fk_paiementfourn'; + } + + $sql = 'SELECT pf.amount, p.fk_paiement, p.datep, t.code'; + $sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t'; + $sql.= ' WHERE pf.'.$field.' = '.$this->id; + $sql.= ' AND pf.'.$field2.' = p.rowid'; + $sql.= ' AND p.fk_paiement = t.id'; + if ($filtertype) $sql.=" AND t.code='PRE'"; + + dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); + $retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep); + $i++; + } + $this->db->free($resql); + return $retarray; + } + else + { + $this->error=$this->db->lasterror(); + dol_print_error($this->db); + return array(); + } + } + + + /** + * Return amount (with tax) of all credit notes and deposits invoices used by invoice + * + * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + */ + function getSumCreditNotesUsed() + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getSumCreditNotesUsed($this); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } + + /** + * Return amount (with tax) of all deposits invoices used by invoice + * + * @return int <0 if KO, Sum of deposits amount otherwise + */ + function getSumDepositsUsed() + { + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + + $discountstatic=new DiscountAbsolute($this->db); + $result=$discountstatic->getSumDepositsUsed($this); + if ($result >= 0) + { + return $result; + } + else + { + $this->error=$discountstatic->error; + return -1; + } + } + + /** + * Return next reference of customer invoice not already used (or last reference) + * according to numbering module defined into constant FACTURE_ADDON + * + * @param Society $soc object company + * @param string $mode 'next' for next value or 'last' for last value + * @return string free ref or last ref + */ + function getNextNumRef($soc,$mode='next') + { + global $conf, $db, $langs; + $langs->load("bills"); + + // Clean parameters (if not defined or using deprecated value) + if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre'; + else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; + else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; + + $mybool=false; + + $file = $conf->global->FACTURE_ADDON.".php"; + $classname = $conf->global->FACTURE_ADDON; + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot."/core/modules/facture/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + + // For compatibility + if (! $mybool) + { + $file = $conf->global->FACTURE_ADDON."/".$conf->global->FACTURE_ADDON.".modules.php"; + $classname = "mod_facture_".$conf->global->FACTURE_ADDON; + $classname = preg_replace('/\-.*$/','',$classname); + // Include file with class + foreach ($conf->file->dol_document_root as $dirroot) + { + $dir = $dirroot."/core/modules/facture/"; + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + } + //print "xx".$mybool.$dir.$file."-".$classname; + + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = ""; + $numref = $obj->getNumRef($soc,$this,$mode); + + if ($numref != "") + { + return $numref; + } + else + { + //dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error); + return false; + } + } + + /** + * Load miscellaneous information for tab "Info" + * + * @param int $id Id of object to load + * @return void + */ + function info($id) + { + $sql = 'SELECT c.rowid, datec, date_valid as datev, tms as datem,'; + $sql.= ' fk_user_author, fk_user_valid'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as c'; + $sql.= ' WHERE c.rowid = '.$id; + + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) + { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + if ($obj->fk_user_valid) + { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); // Should be in log table + } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } + + /** + * Renvoi si les lignes de facture sont ventilees et/ou exportees en compta + * + * @return int <0 if KO, 0=no, 1=yes + */ + function getVentilExportCompta() + { + // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees + $ventilExportCompta = 0 ; + $num=count($this->lines); + for ($i = 0; $i < $num; $i++) + { + if (! empty($this->lines[$i]->export_compta) && ! empty($this->lines[$i]->code_ventilation)) + { + $ventilExportCompta++; + } + } + + if ($ventilExportCompta <> 0) + { + return 1; + } + else + { + return 0; + } + } + + + /** + * Return if an invoice can be deleted + * Rule is: + * If hidden option INVOICE_CAN_ALWAYS_BE_REMOVED is on, we can + * If invoice has a definitive ref, is last, without payment and not dipatched into accountancy -> yes end of rule + * If invoice is draft and ha a temporary ref -> yes + * + * @return int <0 if KO, 0=no, 1=yes + */ + function is_erasable() + { + global $conf; + + if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1; + if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0; + + // on verifie si la facture est en numerotation provisoire + $facref = substr($this->ref, 1, 4); + + // If not a draft invoice and not temporary invoice + if ($facref != 'PROV') + { + $maxfacnumber = $this->getNextNumRef($this->client,'last'); + $ventilExportCompta = $this->getVentilExportCompta(); + // If there is no invoice into the reset range and not already dispatched, we can delete + if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; + // If invoice to delete is last one and not already dispatched, we can delete + if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1; + } + else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire + { + return 1; + } + + return 0; + } + + + /** + * Return list of invoices (eventually filtered on a user) into an array + * + * @param int $shortlist 0=Return array[id]=ref, 1=Return array[](id=>id,ref=>ref,name=>name) + * @param int $draft 0=not draft, 1=draft + * @param User $excluser Objet user to exclude + * @param int $socid Id third pary + * @param int $limit For pagination + * @param int $offset For pagination + * @param string $sortfield Sort criteria + * @param string $sortorder Sort order + * @return int -1 if KO, array with result if OK + */ + function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + { + global $conf,$user; + + $ga = array(); + + $sql = "SELECT s.rowid, s.nom as name, s.client,"; + $sql.= " f.rowid as fid, f.facnumber as ref, f.datef as df"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f"; + if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_soc = s.rowid"; + if (! $user->rights->societe->client->voir && ! $socid) //restriction + { + $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + } + if ($socid) $sql.= " AND s.rowid = ".$socid; + if ($draft) $sql.= " AND f.fk_statut = 0"; + if (is_object($excluser)) $sql.= " AND f.fk_user_author <> ".$excluser->id; + $sql.= $this->db->order($sortfield,$sortorder); + $sql.= $this->db->plimit($limit,$offset); + + $result=$this->db->query($sql); + if ($result) + { + $numc = $this->db->num_rows($result); + if ($numc) + { + $i = 0; + while ($i < $numc) + { + $obj = $this->db->fetch_object($result); + + if ($shortlist == 1) + { + $ga[$obj->fid] = $obj->ref; + } + else if ($shortlist == 2) + { + $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; + } + else + { + $ga[$i]['id'] = $obj->fid; + $ga[$i]['ref'] = $obj->ref; + $ga[$i]['name'] = $obj->name; + } + $i++; + } + } + return $ga; + } + else + { + dol_print_error($this->db); + return -1; + } + } + + + /** + * Renvoi liste des factures remplacables + * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee + * + * @param int $socid Id societe + * @return array Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) + */ + function list_replacable_invoices($socid=0) + { + global $conf; + + $return = array(); + + $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut,"; + $sql.= " ff.rowid as rowidnext"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source"; + $sql.= " WHERE (f.fk_statut = 1 OR (f.fk_statut = 3 AND f.close_code = 'abandon'))"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.paye = 0"; // Pas classee payee completement + $sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait + $sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement + if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; + $sql.= " ORDER BY f.facnumber"; + + dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $return[$obj->rowid]=array( 'id' => $obj->rowid, + 'ref' => $obj->facnumber, + 'status' => $obj->fk_statut); + } + //print_r($return); + return $return; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + + + /** + * Renvoi liste des factures qualifiables pour correction par avoir + * Les factures qui respectent les regles suivantes sont retournees: + * (validee + paiement en cours) ou classee (payee completement ou payee partiellement) + pas deja remplacee + pas deja avoir + * + * @param int $socid Id societe + * @return array Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) + */ + function list_qualified_avoir_invoices($socid=0) + { + global $conf; + + $return = array(); + + $sql = "SELECT f.rowid as rowid, f.facnumber, f.fk_statut, f.type, f.paye, pf.fk_paiement"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=".self::TYPE_REPLACEMENT.")"; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= " AND f.fk_statut in (1,2)"; + // $sql.= " WHERE f.fk_statut >= 1"; + // $sql.= " AND (f.paye = 1"; // Classee payee completement + // $sql.= " OR f.close_code IS NOT NULL)"; // Classee payee partiellement + $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement + $sql.= " AND f.type != ".self::TYPE_CREDIT_NOTE; // Type non 2 si facture non avoir + if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid; + $sql.= " ORDER BY f.facnumber"; + + dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $qualified=0; + if ($obj->fk_statut == 1) $qualified=1; + if ($obj->fk_statut == 2) $qualified=1; + if ($qualified) + { + //$ref=$obj->facnumber; + $paymentornot=($obj->fk_paiement?1:0); + $return[$obj->rowid]=array('ref'=>$obj->facnumber,'status'=>$obj->fk_statut,'type'=>$obj->type,'paye'=>$obj->paye,'paymentornot'=>$paymentornot); + } + } + + return $return; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } + + + /** + * Create a withdrawal request for a standing order + * + * @param User $user User asking standing order + * @return int <0 if KO, >0 if OK + */ + function demande_prelevement($user) + { + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); + + if ($this->statut > 0 && $this->paye == 0) + { + require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; + $bac = new CompanyBankAccount($this->db); + $bac->fetch(0,$this->socid); + + $sql = 'SELECT count(*)'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; + $sql.= ' WHERE fk_facture = '.$this->id; + $sql.= ' AND traite = 0'; + + dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $row = $this->db->fetch_row($resql); + if ($row[0] == 0) + { + $now=dol_now(); $totalpaye = $this->getSommePaiement(); $totalcreditnotes = $this->getSumCreditNotesUsed(); @@ -2846,7 +2842,7 @@ class Facture extends CommonInvoice return 1; } else - { + { $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::demandeprelevement Erreur'); return -1; @@ -2873,344 +2869,344 @@ class Facture extends CommonInvoice } } - /** - * Supprime une demande de prelevement - * - * @param Use $user utilisateur creant la demande - * @param int $did id de la demande a supprimer - * @return int <0 if OK, >0 if KO - */ - function demande_prelevement_delete($user, $did) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; - $sql .= ' WHERE rowid = '.$did; - $sql .= ' AND traite = 0'; - if ( $this->db->query($sql) ) - { - return 0; - } - else - { - $this->error=$this->db->lasterror(); - dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); - return -1; - } - } + /** + * Supprime une demande de prelevement + * + * @param Use $user utilisateur creant la demande + * @param int $did id de la demande a supprimer + * @return int <0 if OK, >0 if KO + */ + function demande_prelevement_delete($user, $did) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; + $sql .= ' WHERE rowid = '.$did; + $sql .= ' AND traite = 0'; + if ( $this->db->query($sql) ) + { + return 0; + } + else + { + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); + return -1; + } + } - /** - * Load indicators for dashboard (this->nbtodo and this->nbtodolate) - * - * @param User $user Object user - * @return int <0 if KO, >0 if OK - */ - function load_board($user) - { - global $conf, $user; + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @param User $user Object user + * @return int <0 if KO, >0 if OK + */ + function load_board($user) + { + global $conf, $user; - $now=dol_now(); + $now=dol_now(); - $this->nbtodo=$this->nbtodolate=0; - $clause = " WHERE"; + $this->nbtodo=$this->nbtodolate=0; + $clause = " WHERE"; - $sql = "SELECT f.rowid, f.date_lim_reglement as datefin"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - if (!$user->rights->societe->client->voir && !$user->societe_id) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON f.fk_soc = sc.fk_soc"; - $sql.= " WHERE sc.fk_user = " .$user->id; - $clause = " AND"; - } - $sql.= $clause." f.paye=0"; - $sql.= " AND f.entity = ".$conf->entity; - $sql.= " AND f.fk_statut = 1"; - if ($user->societe_id) $sql.= " AND f.fk_soc = ".$user->societe_id; + $sql = "SELECT f.rowid, f.date_lim_reglement as datefin"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON f.fk_soc = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = " AND"; + } + $sql.= $clause." f.paye=0"; + $sql.= " AND f.entity = ".$conf->entity; + $sql.= " AND f.fk_statut = 1"; + if ($user->societe_id) $sql.= " AND f.fk_soc = ".$user->societe_id; - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $this->nbtodo++; - if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++; - } - return 1; - } - else - { - dol_print_error($this->db); - $this->error=$this->db->error(); - return -1; - } - } + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nbtodo++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++; + } + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } - /* gestion des contacts d'une facture */ + /* gestion des contacts d'une facture */ - /** - * Retourne id des contacts clients de facturation - * - * @return array Liste des id contacts facturation - */ - function getIdBillingContact() - { - return $this->getIdContact('external','BILLING'); - } + /** + * Retourne id des contacts clients de facturation + * + * @return array Liste des id contacts facturation + */ + function getIdBillingContact() + { + return $this->getIdContact('external','BILLING'); + } - /** - * Retourne id des contacts clients de livraison - * - * @return array Liste des id contacts livraison - */ - function getIdShippingContact() - { - return $this->getIdContact('external','SHIPPING'); - } + /** + * Retourne id des contacts clients de livraison + * + * @return array Liste des id contacts livraison + */ + function getIdShippingContact() + { + return $this->getIdContact('external','SHIPPING'); + } - /** - * Initialise an instance with random values. - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. - * - * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines - * @return void - */ - function initAsSpecimen($option='') - { - global $user,$langs,$conf; + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines + * @return void + */ + function initAsSpecimen($option='') + { + global $user,$langs,$conf; - $now=dol_now(); - $arraynow=dol_getdate($now); - $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); + $now=dol_now(); + $arraynow=dol_getdate($now); + $nownotime=dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); - $prodids = array(); - $sql = "SELECT rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE entity IN (".getEntity('product', 1).")"; - $resql = $this->db->query($sql); - if ($resql) - { - $num_prods = $this->db->num_rows($resql); - $i = 0; - while ($i < $num_prods) - { - $i++; - $row = $this->db->fetch_row($resql); - $prodids[$i] = $row[0]; - } - } + $prodids = array(); + $sql = "SELECT rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."product"; + $sql.= " WHERE entity IN (".getEntity('product', 1).")"; + $resql = $this->db->query($sql); + if ($resql) + { + $num_prods = $this->db->num_rows($resql); + $i = 0; + while ($i < $num_prods) + { + $i++; + $row = $this->db->fetch_row($resql); + $prodids[$i] = $row[0]; + } + } - // Initialize parameters - $this->id=0; - $this->ref = 'SPECIMEN'; - $this->specimen=1; - $this->socid = 1; - $this->date = $nownotime; - $this->date_lim_reglement = $nownotime + 3600 * 24 *30; - $this->cond_reglement_id = 1; - $this->cond_reglement_code = 'RECEP'; - $this->date_lim_reglement=$this->calculate_date_lim_reglement(); - $this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR - $this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR - $this->note_public='This is a comment (public)'; - $this->note_private='This is a comment (private)'; - $this->note='This is a comment (private)'; + // Initialize parameters + $this->id=0; + $this->ref = 'SPECIMEN'; + $this->specimen=1; + $this->socid = 1; + $this->date = $nownotime; + $this->date_lim_reglement = $nownotime + 3600 * 24 *30; + $this->cond_reglement_id = 1; + $this->cond_reglement_code = 'RECEP'; + $this->date_lim_reglement=$this->calculate_date_lim_reglement(); + $this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR + $this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR + $this->note_public='This is a comment (public)'; + $this->note_private='This is a comment (private)'; + $this->note='This is a comment (private)'; - if (empty($option) || $option != 'nolines') - { - // Lines - $nbp = 5; - $xnbp = 0; - while ($xnbp < $nbp) - { - $line=new FactureLigne($this->db); - $line->desc=$langs->trans("Description")." ".$xnbp; - $line->qty=1; - $line->subprice=100; - $line->tva_tx=19.6; - $line->localtax1_tx=0; - $line->localtax2_tx=0; - $line->remise_percent=0; - if ($xnbp == 1) // Qty is negative (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->qty=-1; - $line->total_ht=-100; - $line->total_ttc=-119.6; - $line->total_tva=-19.6; - } - else if ($xnbp == 2) // UP is negative (free line) - { - $line->subprice=-100; - $line->total_ht=-100; - $line->total_ttc=-119.6; - $line->total_tva=-19.6; - $line->remise_percent=0; - } - else if ($xnbp == 3) // Discount is 50% (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->total_ht=50; - $line->total_ttc=59.8; - $line->total_tva=9.8; - $line->remise_percent=50; - } - else // (product line) - { - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; - $line->total_ht=100; - $line->total_ttc=119.6; - $line->total_tva=19.6; - $line->remise_percent=00; - } + if (empty($option) || $option != 'nolines') + { + // Lines + $nbp = 5; + $xnbp = 0; + while ($xnbp < $nbp) + { + $line=new FactureLigne($this->db); + $line->desc=$langs->trans("Description")." ".$xnbp; + $line->qty=1; + $line->subprice=100; + $line->tva_tx=19.6; + $line->localtax1_tx=0; + $line->localtax2_tx=0; + $line->remise_percent=0; + if ($xnbp == 1) // Qty is negative (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->qty=-1; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + } + else if ($xnbp == 2) // UP is negative (free line) + { + $line->subprice=-100; + $line->total_ht=-100; + $line->total_ttc=-119.6; + $line->total_tva=-19.6; + $line->remise_percent=0; + } + else if ($xnbp == 3) // Discount is 50% (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->total_ht=50; + $line->total_ttc=59.8; + $line->total_tva=9.8; + $line->remise_percent=50; + } + else // (product line) + { + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; + $line->total_ht=100; + $line->total_ttc=119.6; + $line->total_tva=19.6; + $line->remise_percent=00; + } - $this->lines[$xnbp]=$line; - $xnbp++; + $this->lines[$xnbp]=$line; + $xnbp++; - $this->total_ht += $line->total_ht; - $this->total_tva += $line->total_tva; - $this->total_ttc += $line->total_ttc; - } - $this->revenuestamp = 0; + $this->total_ht += $line->total_ht; + $this->total_tva += $line->total_tva; + $this->total_ttc += $line->total_ttc; + } + $this->revenuestamp = 0; - // Add a line "offered" - $line=new FactureLigne($this->db); - $line->desc=$langs->trans("Description")." (offered line)"; - $line->qty=1; - $line->subprice=100; - $line->tva_tx=19.6; - $line->localtax1_tx=0; - $line->localtax2_tx=0; - $line->remise_percent=100; - $line->total_ht=0; - $line->total_ttc=0; // 90 * 1.196 - $line->total_tva=0; - $prodid = rand(1, $num_prods); - $line->fk_product=$prodids[$prodid]; + // Add a line "offered" + $line=new FactureLigne($this->db); + $line->desc=$langs->trans("Description")." (offered line)"; + $line->qty=1; + $line->subprice=100; + $line->tva_tx=19.6; + $line->localtax1_tx=0; + $line->localtax2_tx=0; + $line->remise_percent=100; + $line->total_ht=0; + $line->total_ttc=0; // 90 * 1.196 + $line->total_tva=0; + $prodid = rand(1, $num_prods); + $line->fk_product=$prodids[$prodid]; - $this->lines[$xnbp]=$line; - $xnbp++; - } - } + $this->lines[$xnbp]=$line; + $xnbp++; + } + } - /** - * Load indicators for dashboard (this->nbtodo and this->nbtodolate) - * - * @return int <0 if KO, >0 if OK - */ - function load_state_board() - { - global $conf, $user; + /** + * Load indicators for dashboard (this->nbtodo and this->nbtodolate) + * + * @return int <0 if KO, >0 if OK + */ + function load_state_board() + { + global $conf, $user; - $this->nb=array(); + $this->nb=array(); - $clause = "WHERE"; + $clause = "WHERE"; - $sql = "SELECT count(f.rowid) as nb"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$user->societe_id) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; - $sql.= " WHERE sc.fk_user = " .$user->id; - $clause = "AND"; - } - $sql.= " ".$clause." f.entity = ".$conf->entity; + $sql = "SELECT count(f.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$user->societe_id) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; + $sql.= " WHERE sc.fk_user = " .$user->id; + $clause = "AND"; + } + $sql.= " ".$clause." f.entity = ".$conf->entity; - $resql=$this->db->query($sql); - if ($resql) - { - while ($obj=$this->db->fetch_object($resql)) - { - $this->nb["invoices"]=$obj->nb; - } + $resql=$this->db->query($sql); + if ($resql) + { + while ($obj=$this->db->fetch_object($resql)) + { + $this->nb["invoices"]=$obj->nb; + } $this->db->free($resql); - return 1; - } - else - { - dol_print_error($this->db); - $this->error=$this->db->error(); - return -1; - } - } + return 1; + } + else + { + dol_print_error($this->db); + $this->error=$this->db->error(); + return -1; + } + } - /** - * Create an array of invoice lines - * - * @return int >0 if OK, <0 if KO - */ - function getLinesArray() - { - $sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,'; - $sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,'; - $sql.= ' l.remise_percent, l.remise_amount, l.subprice, l.info_bits, l.rang, l.special_code, l.fk_parent_line,'; - $sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; - $sql.= ' l.date_start, l.date_end,'; - $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; - $sql.= ' p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; - $sql.= ' WHERE l.fk_facture = '.$this->id; - $sql.= ' ORDER BY l.rang ASC, l.rowid'; + /** + * Create an array of invoice lines + * + * @return int >0 if OK, <0 if KO + */ + function getLinesArray() + { + $sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,'; + $sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,'; + $sql.= ' l.remise_percent, l.subprice, l.info_bits, l.rang, l.special_code, l.fk_parent_line,'; + $sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' l.date_start, l.date_end,'; + $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; + $sql.= ' p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON l.fk_product=p.rowid'; + $sql.= ' WHERE l.fk_facture = '.$this->id; + $sql.= ' ORDER BY l.rang ASC, l.rowid'; - dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; + dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); - $this->lines[$i] = new FactureLigne($this->db); - $this->lines[$i]->id = $obj->rowid; - $this->lines[$i]->label = $obj->custom_label; // deprecated - $this->lines[$i]->description = $obj->description; - $this->lines[$i]->fk_product = $obj->fk_product; - $this->lines[$i]->ref = $obj->product_ref; - $this->lines[$i]->product_label = $obj->product_label; - $this->lines[$i]->product_desc = $obj->product_desc; - $this->lines[$i]->fk_product_type = $obj->fk_product_type; - $this->lines[$i]->product_type = $obj->product_type; - $this->lines[$i]->qty = $obj->qty; - $this->lines[$i]->subprice = $obj->subprice; - $this->lines[$i]->fk_remise_except = $obj->fk_remise_except; - $this->lines[$i]->remise_percent = $obj->remise_percent; - $this->lines[$i]->tva_tx = $obj->tva_tx; - $this->lines[$i]->info_bits = $obj->info_bits; - $this->lines[$i]->total_ht = $obj->total_ht; - $this->lines[$i]->total_tva = $obj->total_tva; - $this->lines[$i]->total_ttc = $obj->total_ttc; - $this->lines[$i]->fk_parent_line = $obj->fk_parent_line; - $this->lines[$i]->special_code = $obj->special_code; - $this->lines[$i]->rang = $obj->rang; - $this->lines[$i]->date_start = $this->db->jdate($obj->date_start); - $this->lines[$i]->date_end = $this->db->jdate($obj->date_end); - $this->lines[$i]->fk_fournprice = $obj->fk_fournprice; - $marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht); - $this->lines[$i]->pa_ht = $marginInfos[0]; - $this->lines[$i]->marge_tx = $marginInfos[1]; - $this->lines[$i]->marque_tx = $marginInfos[2]; + $this->lines[$i] = new FactureLigne($this->db); + $this->lines[$i]->id = $obj->rowid; + $this->lines[$i]->label = $obj->custom_label; // deprecated + $this->lines[$i]->description = $obj->description; + $this->lines[$i]->fk_product = $obj->fk_product; + $this->lines[$i]->ref = $obj->product_ref; + $this->lines[$i]->product_label = $obj->product_label; + $this->lines[$i]->product_desc = $obj->product_desc; + $this->lines[$i]->fk_product_type = $obj->fk_product_type; + $this->lines[$i]->product_type = $obj->product_type; + $this->lines[$i]->qty = $obj->qty; + $this->lines[$i]->subprice = $obj->subprice; + $this->lines[$i]->fk_remise_except = $obj->fk_remise_except; + $this->lines[$i]->remise_percent = $obj->remise_percent; + $this->lines[$i]->tva_tx = $obj->tva_tx; + $this->lines[$i]->info_bits = $obj->info_bits; + $this->lines[$i]->total_ht = $obj->total_ht; + $this->lines[$i]->total_tva = $obj->total_tva; + $this->lines[$i]->total_ttc = $obj->total_ttc; + $this->lines[$i]->fk_parent_line = $obj->fk_parent_line; + $this->lines[$i]->special_code = $obj->special_code; + $this->lines[$i]->rang = $obj->rang; + $this->lines[$i]->date_start = $this->db->jdate($obj->date_start); + $this->lines[$i]->date_end = $this->db->jdate($obj->date_end); + $this->lines[$i]->fk_fournprice = $obj->fk_fournprice; + $marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht); + $this->lines[$i]->pa_ht = $marginInfos[0]; + $this->lines[$i]->marge_tx = $marginInfos[1]; + $this->lines[$i]->marque_tx = $marginInfos[2]; - $i++; - } - $this->db->free($resql); + $i++; + } + $this->db->free($resql); - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } - } + return 1; + } + else + { + $this->error=$this->db->error(); + return -1; + } + } } @@ -3223,387 +3219,382 @@ class Facture extends CommonInvoice */ class FactureLigne extends CommonInvoiceLine { - var $db; - var $error; + var $db; + var $error; public $element='facturedet'; public $table_element='facturedet'; - var $oldline; + var $oldline; - //! From llx_facturedet - var $rowid; - //! Id facture - var $fk_facture; - //! Id parent line - var $fk_parent_line; - var $label; // deprecated - //! Description ligne - var $desc; - var $fk_product; // Id of predefined product - var $product_type = 0; // Type 0 = product, 1 = Service + //! From llx_facturedet + var $rowid; + //! Id facture + var $fk_facture; + //! Id parent line + var $fk_parent_line; + var $label; // deprecated + //! Description ligne + var $desc; + var $fk_product; // Id of predefined product + var $product_type = 0; // Type 0 = product, 1 = Service - var $qty; // Quantity (example 2) - var $tva_tx; // Taux tva produit/service (example 19.6) - var $localtax1_tx; // Local tax 1 - var $localtax2_tx; // Local tax 2 - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $subprice; // P.U. HT (example 100) - var $remise_percent; // % de la remise ligne (example 20%) - var $remise_amount; // montant de la remise ligne - var $fk_remise_except; // Link to line into llx_remise_except - var $rang = 0; + var $qty; // Quantity (example 2) + var $tva_tx; // Taux tva produit/service (example 19.6) + var $localtax1_tx; // Local tax 1 + var $localtax2_tx; // Local tax 2 + var $localtax1_type; // Local tax 1 type + var $localtax2_type; // Local tax 2 type + var $subprice; // P.U. HT (example 100) + var $remise_percent; // % de la remise ligne (example 20%) + var $fk_remise_except; // Link to line into llx_remise_except + var $rang = 0; - var $fk_fournprice; - var $pa_ht; - var $marge_tx; - var $marque_tx; + var $fk_fournprice; + var $pa_ht; + var $marge_tx; + var $marque_tx; - var $info_bits = 0; // Liste d'options cumulables: - // Bit 0: 0 si TVA normal - 1 si TVA NPR - // Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + var $info_bits = 0; // Liste d'options cumulables: + // Bit 0: 0 si TVA normal - 1 si TVA NPR + // Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) - var $special_code; // Liste d'options non cumulabels: - // 1: frais de port - // 2: ecotaxe - // 3: ?? + var $special_code; // Liste d'options non cumulabels: + // 1: frais de port + // 2: ecotaxe + // 3: ?? - var $origin; - var $origin_id; + var $origin; + var $origin_id; - //! Total HT de la ligne toute quantite et incluant la remise ligne - var $total_ht; - //! Total TVA de la ligne toute quantite et incluant la remise ligne - var $total_tva; - var $total_localtax1; //Total Local tax 1 de la ligne - var $total_localtax2; //Total Local tax 2 de la ligne - //! Total TTC de la ligne toute quantite et incluant la remise ligne - var $total_ttc; + //! Total HT de la ligne toute quantite et incluant la remise ligne + var $total_ht; + //! Total TVA de la ligne toute quantite et incluant la remise ligne + var $total_tva; + var $total_localtax1; //Total Local tax 1 de la ligne + var $total_localtax2; //Total Local tax 2 de la ligne + //! Total TTC de la ligne toute quantite et incluant la remise ligne + var $total_ttc; - var $fk_code_ventilation = 0; + var $fk_code_ventilation = 0; - var $date_start; - var $date_end; + var $date_start; + var $date_end; - // Ne plus utiliser - //var $price; // P.U. HT apres remise % de ligne (exemple 80) - //var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) + // Ne plus utiliser + //var $price; // P.U. HT apres remise % de ligne (exemple 80) + //var $remise; // Montant calcule de la remise % sur PU HT (exemple 20) - // From llx_product - var $ref; // Product ref (deprecated) - var $product_ref; // Product ref - var $libelle; // Product label (deprecated) - var $product_label; // Product label - var $product_desc; // Description produit + // From llx_product + var $ref; // Product ref (deprecated) + var $product_ref; // Product ref + var $libelle; // Product label (deprecated) + var $product_label; // Product label + var $product_desc; // Description produit - var $skip_update_total; // Skip update price total for special lines + var $skip_update_total; // Skip update price total for special lines - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + } - /** - * Load invoice line from database - * - * @param int $rowid id of invoice line to get - * @return int <0 if KO, >0 if OK - */ - function fetch($rowid) - { - $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,'; - $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.remise_amount, fd.fk_remise_except, fd.subprice,'; - $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; - $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; - $sql.= ' fd.fk_code_ventilation,'; - $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; - $sql.= ' WHERE fd.rowid = '.$rowid; + /** + * Load invoice line from database + * + * @param int $rowid id of invoice line to get + * @return int <0 if KO, >0 if OK + */ + function fetch($rowid) + { + $sql = 'SELECT fd.rowid, fd.fk_facture, fd.fk_parent_line, fd.fk_product, fd.product_type, fd.label as custom_label, fd.description, fd.price, fd.qty, fd.tva_tx,'; + $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,'; + $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; + $sql.= ' fd.info_bits, fd.special_code, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; + $sql.= ' fd.fk_code_ventilation,'; + $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; + $sql.= ' WHERE fd.rowid = '.$rowid; - $result = $this->db->query($sql); - if ($result) - { - $objp = $this->db->fetch_object($result); + $result = $this->db->query($sql); + if ($result) + { + $objp = $this->db->fetch_object($result); - $this->rowid = $objp->rowid; - $this->fk_facture = $objp->fk_facture; - $this->fk_parent_line = $objp->fk_parent_line; - $this->label = $objp->custom_label; - $this->desc = $objp->description; - $this->qty = $objp->qty; - $this->subprice = $objp->subprice; - $this->tva_tx = $objp->tva_tx; - $this->localtax1_tx = $objp->localtax1_tx; - $this->localtax2_tx = $objp->localtax2_tx; - $this->remise_percent = $objp->remise_percent; - $this->remise_amount = $objp->remise_amount; - $this->fk_remise_except = $objp->fk_remise_except; - $this->fk_product = $objp->fk_product; - $this->product_type = $objp->product_type; - $this->date_start = $this->db->jdate($objp->date_start); - $this->date_end = $this->db->jdate($objp->date_end); - $this->info_bits = $objp->info_bits; - $this->special_code = $objp->special_code; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_localtax1 = $objp->total_localtax1; - $this->total_localtax2 = $objp->total_localtax2; - $this->total_ttc = $objp->total_ttc; - $this->fk_code_ventilation = $objp->fk_code_ventilation; - $this->rang = $objp->rang; - $this->fk_fournprice = $objp->fk_fournprice; - $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); - $this->pa_ht = $marginInfos[0]; - $this->marge_tx = $marginInfos[1]; - $this->marque_tx = $marginInfos[2]; + $this->rowid = $objp->rowid; + $this->fk_facture = $objp->fk_facture; + $this->fk_parent_line = $objp->fk_parent_line; + $this->label = $objp->custom_label; + $this->desc = $objp->description; + $this->qty = $objp->qty; + $this->subprice = $objp->subprice; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->remise_percent = $objp->remise_percent; + $this->fk_remise_except = $objp->fk_remise_except; + $this->fk_product = $objp->fk_product; + $this->product_type = $objp->product_type; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); + $this->info_bits = $objp->info_bits; + $this->special_code = $objp->special_code; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_localtax1 = $objp->total_localtax1; + $this->total_localtax2 = $objp->total_localtax2; + $this->total_ttc = $objp->total_ttc; + $this->fk_code_ventilation = $objp->fk_code_ventilation; + $this->rang = $objp->rang; + $this->fk_fournprice = $objp->fk_fournprice; + $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); + $this->pa_ht = $marginInfos[0]; + $this->marge_tx = $marginInfos[1]; + $this->marque_tx = $marginInfos[2]; - $this->ref = $objp->product_ref; // deprecated - $this->product_ref = $objp->product_ref; - $this->libelle = $objp->product_libelle; // deprecated - $this->product_label = $objp->product_libelle; - $this->product_desc = $objp->product_desc; + $this->ref = $objp->product_ref; // deprecated + $this->product_ref = $objp->product_ref; + $this->libelle = $objp->product_libelle; // deprecated + $this->product_label = $objp->product_libelle; + $this->product_desc = $objp->product_desc; - $this->db->free($result); - } - else - { - dol_print_error($this->db); - } - } + $this->db->free($result); + } + else + { + dol_print_error($this->db); + } + } - /** - * Insert line into database - * - * @param int $notrigger 1 no triggers - * @return int <0 if KO, >0 if OK - */ - function insert($notrigger=0) - { - global $langs,$user,$conf; + /** + * Insert line into database + * + * @param int $notrigger 1 no triggers + * @return int <0 if KO, >0 if OK + */ + function insert($notrigger=0) + { + global $langs,$user,$conf; - $error=0; + $error=0; - dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG); + dol_syslog(get_class($this)."::insert rang=".$this->rang, LOG_DEBUG); - // Clean parameters - $this->desc=trim($this->desc); - if (empty($this->tva_tx)) $this->tva_tx=0; - if (empty($this->localtax1_tx)) $this->localtax1_tx=0; - if (empty($this->localtax2_tx)) $this->localtax2_tx=0; - if (empty($this->localtax1_type)) $this->localtax1_type=0; - if (empty($this->localtax2_type)) $this->localtax2_type=0; - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; - if (empty($this->rang)) $this->rang=0; - if (empty($this->remise_percent)) $this->remise_percent=0; - if (empty($this->remise_amount)) $this->remise_amount=0; - if (empty($this->info_bits)) $this->info_bits=0; - if (empty($this->subprice)) $this->subprice=0; - if (empty($this->special_code)) $this->special_code=0; - if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + // Clean parameters + $this->desc=trim($this->desc); + if (empty($this->tva_tx)) $this->tva_tx=0; + if (empty($this->localtax1_tx)) $this->localtax1_tx=0; + if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; + if (empty($this->rang)) $this->rang=0; + if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->info_bits)) $this->info_bits=0; + if (empty($this->subprice)) $this->subprice=0; + if (empty($this->special_code)) $this->special_code=0; + if (empty($this->fk_parent_line)) $this->fk_parent_line=0; - if (empty($this->pa_ht)) $this->pa_ht=0; + if (empty($this->pa_ht)) $this->pa_ht=0; - // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente - if ($this->pa_ht == 0) { - if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) - $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); - } + // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente + if ($this->pa_ht == 0) { + if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) + $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); + } - // Check parameters - if ($this->product_type < 0) - { - $this->error='ErrorProductTypeMustBe0orMore'; - return -1; - } - if (! empty($this->fk_product)) - { - // Check product exists - $result=Product::isExistingObject('product', $this->fk_product); - if ($result <= 0) - { - $this->error='ErrorProductIdDoesNotExists'; - return -1; - } - } + // Check parameters + if ($this->product_type < 0) + { + $this->error='ErrorProductTypeMustBe0orMore'; + return -1; + } + if (! empty($this->fk_product)) + { + // Check product exists + $result=Product::isExistingObject('product', $this->fk_product); + if ($result <= 0) + { + $this->error='ErrorProductIdDoesNotExists'; + return -1; + } + } - $this->db->begin(); + $this->db->begin(); - // Insertion dans base de la ligne - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; - $sql.= ' (fk_facture, fk_parent_line, label, description, qty,'; - $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; - $sql.= ' fk_product, product_type, remise_percent, remise_amount, subprice, fk_remise_except,'; - $sql.= ' date_start, date_end, fk_code_ventilation, '; - $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; - $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; - $sql.= " VALUES (".$this->fk_facture.","; - $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; - $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; - $sql.= " '".$this->db->escape($this->desc)."',"; - $sql.= " ".price2num($this->qty).","; - $sql.= " ".price2num($this->tva_tx).","; - $sql.= " ".price2num($this->localtax1_tx).","; - $sql.= " ".price2num($this->localtax2_tx).","; - $sql.= " '".$this->localtax1_type."',"; - $sql.= " '".$this->localtax2_type."',"; - $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; - $sql.= " ".$this->product_type.","; - $sql.= " ".price2num($this->remise_percent).","; - $sql.= " ".price2num($this->remise_amount).","; - $sql.= " ".price2num($this->subprice).","; - $sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; - $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; - $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; - $sql.= ' '.$this->fk_code_ventilation.','; - $sql.= ' '.$this->rang.','; - $sql.= ' '.$this->special_code.','; - $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; - $sql.= ' '.price2num($this->pa_ht).','; - $sql.= " '".$this->info_bits."',"; - $sql.= " ".price2num($this->total_ht).","; - $sql.= " ".price2num($this->total_tva).","; - $sql.= " ".price2num($this->total_ttc).","; - $sql.= " ".price2num($this->total_localtax1).","; - $sql.= " ".price2num($this->total_localtax2); - $sql.= ')'; + // Insertion dans base de la ligne + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; + $sql.= ' (fk_facture, fk_parent_line, label, description, qty,'; + $sql.= ' tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type,'; + $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; + $sql.= ' date_start, date_end, fk_code_ventilation, '; + $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; + $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; + $sql.= " VALUES (".$this->fk_facture.","; + $sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").","; + $sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").","; + $sql.= " '".$this->db->escape($this->desc)."',"; + $sql.= " ".price2num($this->qty).","; + $sql.= " ".price2num($this->tva_tx).","; + $sql.= " ".price2num($this->localtax1_tx).","; + $sql.= " ".price2num($this->localtax2_tx).","; + $sql.= " '".$this->localtax1_type."',"; + $sql.= " '".$this->localtax2_type."',"; + $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; + $sql.= " ".$this->product_type.","; + $sql.= " ".price2num($this->remise_percent).","; + $sql.= " ".price2num($this->subprice).","; + $sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; + $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; + $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; + $sql.= ' '.$this->fk_code_ventilation.','; + $sql.= ' '.$this->rang.','; + $sql.= ' '.$this->special_code.','; + $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; + $sql.= ' '.price2num($this->pa_ht).','; + $sql.= " '".$this->info_bits."',"; + $sql.= " ".price2num($this->total_ht).","; + $sql.= " ".price2num($this->total_tva).","; + $sql.= " ".price2num($this->total_ttc).","; + $sql.= " ".price2num($this->total_localtax1).","; + $sql.= " ".price2num($this->total_localtax2); + $sql.= ')'; - dol_syslog(get_class($this)."::insert", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); + dol_syslog(get_class($this)."::insert", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } } - // Si fk_remise_except defini, on lie la remise a la facture - // ce qui la flague comme "consommee". - if ($this->fk_remise_except) - { - $discount=new DiscountAbsolute($this->db); - $result=$discount->fetch($this->fk_remise_except); - if ($result >= 0) - { - // Check if discount was found - if ($result > 0) - { - // Check if discount not already affected to another invoice - if ($discount->fk_facture) - { - $this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id); - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - else - { - $result=$discount->link_to_invoice($this->rowid,0); - if ($result < 0) - { - $this->error=$discount->error; - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } - } - else - { - $this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } - else - { - $this->error=$discount->error; - dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } + // Si fk_remise_except defini, on lie la remise a la facture + // ce qui la flague comme "consommee". + if ($this->fk_remise_except) + { + $discount=new DiscountAbsolute($this->db); + $result=$discount->fetch($this->fk_remise_except); + if ($result >= 0) + { + // Check if discount was found + if ($result > 0) + { + // Check if discount not already affected to another invoice + if ($discount->fk_facture) + { + $this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + else + { + $result=$discount->link_to_invoice($this->rowid,0); + if ($result < 0) + { + $this->error=$discount->error; + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } + } + else + { + $this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } + else + { + $this->error=$discount->error; + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; + } + } - if (! $notrigger) - { + if (! $notrigger) + { // Call trigger $result=$this->call_trigger('LINEBILL_INSERT',$user); if ($result < 0) - { - $this->db->rollback(); - return -2; - } + { + $this->db->rollback(); + return -2; + } // End call triggers - } + } - $this->db->commit(); - return $this->rowid; + $this->db->commit(); + return $this->rowid; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } - /** - * Update line into database - * - * @param User $user User object - * @param int $notrigger Disable triggers - * @return int <0 if KO, >0 if OK - */ - function update($user='',$notrigger=0) - { - global $user,$langs,$conf; + /** + * Update line into database + * + * @param User $user User object + * @param int $notrigger Disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user='',$notrigger=0) + { + global $user,$langs,$conf; - $error=0; + $error=0; - // Clean parameters - $this->desc=trim($this->desc); - if (empty($this->tva_tx)) $this->tva_tx=0; - if (empty($this->localtax1_tx)) $this->localtax1_tx=0; - if (empty($this->localtax2_tx)) $this->localtax2_tx=0; - if (empty($this->localtax1_type)) $this->localtax1_type=0; - if (empty($this->localtax2_type)) $this->localtax2_type=0; - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; - if (empty($this->remise_percent)) $this->remise_percent=0; - if (empty($this->remise_amount)) $this->remise_amount=0; - if (empty($this->info_bits)) $this->info_bits=0; - if (empty($this->special_code)) $this->special_code=0; - if (empty($this->product_type)) $this->product_type=0; - if (empty($this->fk_parent_line)) $this->fk_parent_line=0; + // Clean parameters + $this->desc=trim($this->desc); + if (empty($this->tva_tx)) $this->tva_tx=0; + if (empty($this->localtax1_tx)) $this->localtax1_tx=0; + if (empty($this->localtax2_tx)) $this->localtax2_tx=0; + if (empty($this->localtax1_type)) $this->localtax1_type=0; + if (empty($this->localtax2_type)) $this->localtax2_type=0; + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; + if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->info_bits)) $this->info_bits=0; + if (empty($this->special_code)) $this->special_code=0; + if (empty($this->product_type)) $this->product_type=0; + if (empty($this->fk_parent_line)) $this->fk_parent_line=0; - // Check parameters - if ($this->product_type < 0) return -1; + // Check parameters + if ($this->product_type < 0) return -1; - if (empty($this->pa_ht)) $this->pa_ht=0; + if (empty($this->pa_ht)) $this->pa_ht=0; - // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente - if ($this->pa_ht == 0) { - if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) - $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); - } + // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente + if ($this->pa_ht == 0) { + if ($this->subprice > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) + $this->pa_ht = $this->subprice * (1 - $this->remise_percent / 100); + } - $this->db->begin(); + $this->db->begin(); // Mise a jour ligne en base $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; @@ -3611,14 +3602,13 @@ class FactureLigne extends CommonInvoiceLine $sql.= ",label=".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null"); $sql.= ",subprice=".price2num($this->subprice).""; $sql.= ",remise_percent=".price2num($this->remise_percent).""; - $sql.= ",remise_amount=".price2num($this->remise_amount).""; if ($this->fk_remise_except) $sql.= ",fk_remise_except=".$this->fk_remise_except; else $sql.= ",fk_remise_except=null"; $sql.= ",tva_tx=".price2num($this->tva_tx).""; $sql.= ",localtax1_tx=".price2num($this->localtax1_tx).""; $sql.= ",localtax2_tx=".price2num($this->localtax2_tx).""; - $sql.= ",localtax1_type='".$this->localtax1_type."'"; - $sql.= ",localtax2_type='".$this->localtax2_type."'"; + $sql.= ",localtax1_type='".$this->localtax1_type."'"; + $sql.= ",localtax2_type='".$this->localtax2_type."'"; $sql.= ",qty=".price2num($this->qty).""; $sql.= ",date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null"); $sql.= ",date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null"); @@ -3627,129 +3617,129 @@ class FactureLigne extends CommonInvoiceLine $sql.= ",special_code='".$this->special_code."'"; if (empty($this->skip_update_total)) { - $sql.= ",total_ht=".price2num($this->total_ht).""; - $sql.= ",total_tva=".price2num($this->total_tva).""; - $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; - $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; + $sql.= ",total_ht=".price2num($this->total_ht).""; + $sql.= ",total_tva=".price2num($this->total_tva).""; + $sql.= ",total_ttc=".price2num($this->total_ttc).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } - $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); - $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; - $sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); - if (! empty($this->rang)) $sql.= ", rang=".$this->rang; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?"'".$this->db->escape($this->fk_fournprice)."'":"null"); + $sql.= " , buy_price_ht='".price2num($this->pa_ht)."'"; + $sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null"); + if (! empty($this->rang)) $sql.= ", rang=".$this->rang; + $sql.= " WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $this->id=$this->rowid; - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $this->id=$this->rowid; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } - if (! $notrigger) - { + if (! $notrigger) + { // Call trigger $result=$this->call_trigger('LINEBILL_UPDATE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -2; - } + if ($result < 0) + { + $this->db->rollback(); + return -2; + } // End call triggers - } - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + } + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } - /** - * Delete line in database - * - * @return int <0 if KO, >0 if OK - */ - function delete() - { - global $conf,$langs,$user; + /** + * Delete line in database + * + * @return int <0 if KO, >0 if OK + */ + function delete() + { + global $conf,$langs,$user; - $error=0; + $error=0; - $this->db->begin(); + $this->db->begin(); + + // Call trigger + $result=$this->call_trigger('LINEBILL_DELETE',$user); + if ($result < 0) + { + $this->db->rollback(); + return -1; + } + // End call triggers + - // Call trigger - $result=$this->call_trigger('LINEBILL_DELETE',$user); - if ($result < 0) - { - $this->db->rollback(); - return -1; - } - // End call triggers + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + if ($this->db->query($sql) ) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error()." sql=".$sql; + $this->db->rollback(); + return -1; + } + } + /** + * Mise a jour en base des champs total_xxx de ligne de facture + * + * @return int <0 if KO, >0 if OK + */ + function update_total() + { + $this->db->begin(); + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - if ($this->db->query($sql) ) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error()." sql=".$sql; - $this->db->rollback(); - return -1; - } - } + // Clean parameters + if (empty($this->total_localtax1)) $this->total_localtax1=0; + if (empty($this->total_localtax2)) $this->total_localtax2=0; - /** - * Mise a jour en base des champs total_xxx de ligne de facture - * - * @return int <0 if KO, >0 if OK - */ - function update_total() - { - $this->db->begin(); - dol_syslog(get_class($this)."::update_total", LOG_DEBUG); + // Mise a jour ligne en base + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; + $sql.= " total_ht=".price2num($this->total_ht).""; + $sql.= ",total_tva=".price2num($this->total_tva).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; + $sql.= ",total_ttc=".price2num($this->total_ttc).""; + $sql.= " WHERE rowid = ".$this->rowid; - // Clean parameters - if (empty($this->total_localtax1)) $this->total_localtax1=0; - if (empty($this->total_localtax2)) $this->total_localtax2=0; + dol_syslog(get_class($this)."::update_total", LOG_DEBUG); - // Mise a jour ligne en base - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; - $sql.= " total_ht=".price2num($this->total_ht).""; - $sql.= ",total_tva=".price2num($this->total_tva).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; - $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; - $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= " WHERE rowid = ".$this->rowid; - - dol_syslog(get_class($this)."::update_total", LOG_DEBUG); - - $resql=$this->db->query($sql); - if ($resql) - { - $this->db->commit(); - return 1; - } - else - { - $this->error=$this->db->error(); - $this->db->rollback(); - return -2; - } - } + $resql=$this->db->query($sql); + if ($resql) + { + $this->db->commit(); + return 1; + } + else + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -2; + } + } } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3b44f2c81db..1641aeb132c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1425,38 +1425,6 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) } } -/** - * Return line remise value - * - * @param Object $object Object - * @param int $i Current line number - * @param Translate $outputlangs Object langs for output - * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return string - */ -function pdf_getlineremisevalue($object,$i,$outputlangs,$hidedetails=0) -{ - global $hookmanager; - - include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - - if ($object->lines[$i]->special_code != 3) - { - if (is_object($hookmanager) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) ) - { - $special_code = $object->lines[$i]->special_code; - if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); - $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); - $action=''; - return $hookmanager->executeHooks('pdf_getlineremisevalue',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - } - else - { - if (empty($hidedetails) || $hidedetails > 1) return price($object->lines[$i]->subprice * $object->lines[$i]->qty - $object->lines[$i]->total_ht); - } - } -} - /** * Return line total excluding tax * diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1742d4448a4..d07bd93825c 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -49,86 +49,86 @@ class pdf_crabe extends ModelePDFFactures var $page_largeur; var $page_hauteur; var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; - var $emetteur; // Objet societe qui emet + var $emetteur; // Objet societe qui emet - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - global $conf,$langs,$mysoc; + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $conf,$langs,$mysoc; - $langs->load("main"); - $langs->load("bills"); + $langs->load("main"); + $langs->load("bills"); - $this->db = $db; - $this->name = "crabe"; - $this->description = $langs->trans('PDFCrabeDescription'); + $this->db = $db; + $this->name = "crabe"; + $this->description = $langs->trans('PDFCrabeDescription'); - // Dimension page pour format A4 - $this->type = 'pdf'; - $formatarray=pdf_getFormat(); - $this->page_largeur = $formatarray['width']; - $this->page_hauteur = $formatarray['height']; - $this->format = array($this->page_largeur,$this->page_hauteur); - $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; - $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; - $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; - $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; + // Dimension page pour format A4 + $this->type = 'pdf'; + $formatarray=pdf_getFormat(); + $this->page_largeur = $formatarray['width']; + $this->page_hauteur = $formatarray['height']; + $this->format = array($this->page_largeur,$this->page_hauteur); + $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; + $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; + $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; + $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte - $this->option_credit_note = 1; // Support credit notes - $this->option_freetext = 1; // Support add of a personalised text - $this->option_draft_watermark = 1; // Support add of a watermark on drafts + $this->option_logo = 1; // Affiche logo + $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION + $this->option_modereg = 1; // Affiche mode reglement + $this->option_condreg = 1; // Affiche conditions reglement + $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_credit_note = 1; // Support credit notes + $this->option_freetext = 1; // Support add of a personalised text + $this->option_draft_watermark = 1; // Support add of a watermark on drafts - $this->franchise=!$mysoc->tva_assuj; + $this->franchise=!$mysoc->tva_assuj; - // Get source company - $this->emetteur=$mysoc; - if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined + // Get source company + $this->emetteur=$mysoc; + if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined - // Define position of columns - $this->posxdesc=$this->marge_gauche+1; - $this->posxtva=95; - $this->posxup=109; - $this->posxqty=128; - $this->posxdiscount=148; - $this->postotalht=174; - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; - $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images - if ($this->page_largeur < 210) // To work with US executive format - { - $this->posxpicture-=20; - $this->posxtva-=20; - $this->posxup-=20; - $this->posxqty-=20; - $this->posxdiscount-=20; - $this->postotalht-=20; - } + // Define position of columns + $this->posxdesc=$this->marge_gauche+1; + $this->posxtva=112; + $this->posxup=126; + $this->posxqty=145; + $this->posxdiscount=162; + $this->postotalht=174; + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxtva=$this->posxup; + $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images + if ($this->page_largeur < 210) // To work with US executive format + { + $this->posxpicture-=20; + $this->posxtva-=20; + $this->posxup-=20; + $this->posxqty-=20; + $this->posxdiscount-=20; + $this->postotalht-=20; + } - $this->tva=array(); - $this->localtax1=array(); - $this->localtax2=array(); - $this->atleastoneratenotnull=0; - $this->atleastonediscount=0; - } + $this->tva=array(); + $this->localtax1=array(); + $this->localtax2=array(); + $this->atleastoneratenotnull=0; + $this->atleastonediscount=0; + } - /** + /** * Function to build pdf onto disk * * @param Object $object Object to generate @@ -138,59 +138,59 @@ class pdf_crabe extends ModelePDFFactures * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref * @return int 1=OK, 0=KO - */ - function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) - { - global $user,$langs,$conf,$mysoc,$db,$hookmanager; + */ + function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) + { + global $user,$langs,$conf,$mysoc,$db,$hookmanager; - if (! is_object($outputlangs)) $outputlangs=$langs; - // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO - if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; + if (! is_object($outputlangs)) $outputlangs=$langs; + // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO + if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - $outputlangs->load("main"); - $outputlangs->load("dict"); - $outputlangs->load("companies"); - $outputlangs->load("bills"); - $outputlangs->load("products"); + $outputlangs->load("main"); + $outputlangs->load("dict"); + $outputlangs->load("companies"); + $outputlangs->load("bills"); + $outputlangs->load("products"); - if ($conf->facture->dir_output) - { - $object->fetch_thirdparty(); + if ($conf->facture->dir_output) + { + $object->fetch_thirdparty(); - $deja_regle = $object->getSommePaiement(); - $amount_credit_notes_included = $object->getSumCreditNotesUsed(); - $amount_deposits_included = $object->getSumDepositsUsed(); + $deja_regle = $object->getSommePaiement(); + $amount_credit_notes_included = $object->getSumCreditNotesUsed(); + $amount_deposits_included = $object->getSumDepositsUsed(); - // Definition of $dir and $file - if ($object->specimen) - { - $dir = $conf->facture->dir_output; - $file = $dir . "/SPECIMEN.pdf"; - } - else - { - $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->facture->dir_output . "/" . $objectref; - $file = $dir . "/" . $objectref . ".pdf"; - } - if (! file_exists($dir)) - { - if (dol_mkdir($dir) < 0) - { - $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); - return 0; - } - } + // Definition of $dir and $file + if ($object->specimen) + { + $dir = $conf->facture->dir_output; + $file = $dir . "/SPECIMEN.pdf"; + } + else + { + $objectref = dol_sanitizeFileName($object->ref); + $dir = $conf->facture->dir_output . "/" . $objectref; + $file = $dir . "/" . $objectref . ".pdf"; + } + if (! file_exists($dir)) + { + if (dol_mkdir($dir) < 0) + { + $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); + return 0; + } + } - if (file_exists($dir)) - { - $nblignes = count($object->lines); + if (file_exists($dir)) + { + $nblignes = count($object->lines); $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page - $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) + $heightforinfotot = 50; // Height reserved to output the info and total part + $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page + $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1,0); if (class_exists('TCPDF')) @@ -203,1273 +203,1260 @@ class pdf_crabe extends ModelePDFFactures // Set path to the background PDF File if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); - $tplidx = $pdf->importPage(1); + $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $tplidx = $pdf->importPage(1); } - $pdf->Open(); - $pagenb=0; - $pdf->SetDrawColor(128,128,128); + $pdf->Open(); + $pagenb=0; + $pdf->SetDrawColor(128,128,128); - $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); - $pdf->SetSubject($outputlangs->transnoentities("Invoice")); - $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); - if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); + $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); + $pdf->SetSubject($outputlangs->transnoentities("Invoice")); + $pdf->SetCreator("Dolibarr ".DOL_VERSION); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); - $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right + $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right - // Positionne $this->atleastonediscount si on a au moins une remise - for ($i = 0 ; $i < $nblignes ; $i++) - { - if ($object->lines[$i]->remise_percent) - { - $this->atleastonediscount++; - } - } - if (empty($this->atleastonediscount)) - { - $this->posxpicture+=($this->postotalht - $this->posxdiscount); - $this->posxtva+=($this->postotalht - $this->posxdiscount); - $this->posxup+=($this->postotalht - $this->posxdiscount); - $this->posxqty+=($this->postotalht - $this->posxdiscount); - $this->posxdiscount+=($this->postotalht - $this->posxdiscount); - //$this->postotalht; - } + // Positionne $this->atleastonediscount si on a au moins une remise + for ($i = 0 ; $i < $nblignes ; $i++) + { + if ($object->lines[$i]->remise_percent) + { + $this->atleastonediscount++; + } + } + if (empty($this->atleastonediscount)) + { + $this->posxpicture+=($this->postotalht - $this->posxdiscount); + $this->posxtva+=($this->postotalht - $this->posxdiscount); + $this->posxup+=($this->postotalht - $this->posxdiscount); + $this->posxqty+=($this->postotalht - $this->posxdiscount); + $this->posxdiscount+=($this->postotalht - $this->posxdiscount); + //$this->postotalht; + } - // New page - $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - $pagenb++; + // New page + $pdf->AddPage(); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell(0, 3, ''); // Set interline to 3 - $pdf->SetTextColor(0,0,0); + $this->_pagehead($pdf, $object, 1, $outputlangs); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(0, 3, ''); // Set interline to 3 + $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); + $tab_height = 130; + $tab_height_newpage = 150; - // Affiche notes - $notetoshow=empty($object->note_public)?'':$object->note_public; - if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) - { - // Get first sale rep - if (is_object($object->thirdparty)) - { - $salereparray=$object->thirdparty->getSalesRepresentatives($user); - $salerepobj=new User($this->db); - $salerepobj->fetch($salereparray[0]['id']); - if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature); - } - } - if ($notetoshow) - { - $tab_top = 88; + // Affiche notes + $notetoshow=empty($object->note_public)?'':$object->note_public; + if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) + { + // Get first sale rep + if (is_object($object->thirdparty)) + { + $salereparray=$object->thirdparty->getSalesRepresentatives($user); + $salerepobj=new User($this->db); + $salerepobj->fetch($salereparray[0]['id']); + if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature); + } + } + if ($notetoshow) + { + $tab_top = 88; - $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); - $nexY = $pdf->GetY(); - $height_note=$nexY-$tab_top; + $pdf->SetFont('','', $default_font_size - 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $nexY = $pdf->GetY(); + $height_note=$nexY-$tab_top; - // Rect prend une longueur en 3eme param - $pdf->SetDrawColor(192,192,192); - $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); + // Rect prend une longueur en 3eme param + $pdf->SetDrawColor(192,192,192); + $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; - } + $tab_height = $tab_height - $height_note; + $tab_top = $nexY+6; + } + else + { + $height_note=0; + } - $iniY = $tab_top + 7; - $curY = $tab_top + 7; - $nexY = $tab_top + 7; + $iniY = $tab_top + 7; + $curY = $tab_top + 7; + $nexY = $tab_top + 7; - // Loop on each lines - for ($i = 0; $i < $nblignes; $i++) - { - $curY = $nexY; - $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage - $pdf->SetTextColor(0,0,0); + // Loop on each lines + for ($i = 0; $i < $nblignes; $i++) + { + $curY = $nexY; + $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage + $pdf->SetTextColor(0,0,0); - $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. - $pageposbefore=$pdf->getPage(); + $pdf->setTopMargin($tab_top_newpage); + $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pageposbefore=$pdf->getPage(); - // Description of product line - $curX = $this->posxdesc-1; + // Description of product line + $curX = $this->posxdesc-1; - $showpricebeforepagebreak=1; + $showpricebeforepagebreak=1; - $pdf->startTransaction(); - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,8,$curX,$curY,$hideref,$hidedesc); - $pageposafter=$pdf->getPage(); - if ($pageposafter > $pageposbefore) // There is a pagebreak - { - $pdf->rollbackTransaction(true); - $pageposafter=$pageposbefore; - //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); - $pageposafter=$pdf->getPage(); - $posyafter=$pdf->GetY(); - //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; - if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text - { - if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page - { - $pdf->AddPage('','',true); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - $pdf->setPage($pageposafter+1); - } - } - else - { - // We found a page break - $showpricebeforepagebreak=0; - } - } - else // No pagebreak - { - $pdf->commitTransaction(); - } + $pdf->startTransaction(); + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + if ($pageposafter > $pageposbefore) // There is a pagebreak + { + $pdf->rollbackTransaction(true); + $pageposafter=$pageposbefore; + //print $pageposafter.'-'.$pageposbefore;exit; + $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc); + $pageposafter=$pdf->getPage(); + $posyafter=$pdf->GetY(); + //var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit; + if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text + { + if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page + { + $pdf->AddPage('','',true); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + $pdf->setPage($pageposafter+1); + } + } + else + { + // We found a page break + $showpricebeforepagebreak=0; + } + } + else // No pagebreak + { + $pdf->commitTransaction(); + } - $nexY = $pdf->GetY(); - $pageposafter=$pdf->getPage(); - $pdf->setPage($pageposbefore); - $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $nexY = $pdf->GetY(); + $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); + $pdf->setTopMargin($this->marge_haute); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut - // VAT Rate - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); - } + // VAT Rate + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxtva, $curY); + $pdf->MultiCell($this->posxup-$this->posxtva-0.8, 3, $vat_rate, 0, 'R'); + } - // Unit price before discount - $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); + // Unit price before discount + $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxup, $curY); + $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); - // Quantity - $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->posxqty, $curY); - $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars + // Quantity + $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->posxqty, $curY); + $pdf->MultiCell($this->posxdiscount-$this->posxqty-0.8, 3, $qty, 0, 'R'); // Enough for 6 chars - // Discount % on line - if ($object->lines[$i]->remise_percent) - { + // Discount on line + if ($object->lines[$i]->remise_percent) + { $pdf->SetXY($this->posxdiscount-2, $curY); - $remise_amount = pdf_getlineremisevalue($object, $i, $outputlangs, $hidedetails); - $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails)."\n Soit : ".$remise_amount; - $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); - } - // Total HT line - $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); - $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R'); + } - // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva - $tvaligne=$object->lines[$i]->total_tva; - $localtax1ligne=$object->lines[$i]->total_localtax1; - $localtax2ligne=$object->lines[$i]->total_localtax2; - $localtax1_rate=$object->lines[$i]->localtax1_tx; - $localtax2_rate=$object->lines[$i]->localtax2_tx; - $localtax1_type=$object->lines[$i]->localtax1_type; - $localtax2_type=$object->lines[$i]->localtax2_type; + // Total HT line + $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); + $pdf->SetXY($this->postotalht, $curY); + $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); - if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; - if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; - if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva + $tvaligne=$object->lines[$i]->total_tva; + $localtax1ligne=$object->lines[$i]->total_localtax1; + $localtax2ligne=$object->lines[$i]->total_localtax2; + $localtax1_rate=$object->lines[$i]->localtax1_tx; + $localtax2_rate=$object->lines[$i]->localtax2_tx; + $localtax1_type=$object->lines[$i]->localtax1_type; + $localtax2_type=$object->lines[$i]->localtax2_type; - $vatrate=(string) $object->lines[$i]->tva_tx; + if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; + if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100; + if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; - // Retrieve type from database for backward compatibility with old records - if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined - && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax - { - $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0, $object->thirdparty, $mysoc); - $localtax1_type = $localtaxtmp_array[0]; - $localtax2_type = $localtaxtmp_array[2]; - } + $vatrate=(string) $object->lines[$i]->tva_tx; - // retrieve global local tax - if ($localtax1_type && $localtax1ligne != 0) - $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2_type && $localtax2ligne != 0) - $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; + // Retrieve type from database for backward compatibility with old records + if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined + && (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax + { + $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0, $object->thirdparty, $mysoc); + $localtax1_type = $localtaxtmp_array[0]; + $localtax2_type = $localtaxtmp_array[2]; + } - if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; - if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; - $this->tva[$vatrate] += $tvaligne; + // retrieve global local tax + if ($localtax1_type && $localtax1ligne != 0) + $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; + if ($localtax2_type && $localtax2ligne != 0) + $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; - // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) - { - $pdf->setPage($pageposafter); - $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); - //$pdf->SetDrawColor(190,190,200); - $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); - $pdf->SetLineStyle(array('dash'=>0)); - } + if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; + if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=''; + $this->tva[$vatrate] += $tvaligne; - $nexY+=2; // Passe espace entre les lignes + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + { + $pdf->setPage($pageposafter); + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } - // Detect if some page were added automatically and output _tableau for past pages - while ($pagenb < $pageposafter) - { - $pdf->setPage($pagenb); - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); - } - $this->_pagefoot($pdf,$object,$outputlangs,1); - $pagenb++; - $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - } - if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) - { - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); - } - $this->_pagefoot($pdf,$object,$outputlangs,1); - // New page - $pdf->AddPage(); - if (! empty($tplidx)) $pdf->useTemplate($tplidx); - $pagenb++; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); - } - } + $nexY+=2; // Passe espace entre les lignes - // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; - } + // Detect if some page were added automatically and output _tableau for past pages + while ($pagenb < $pageposafter) + { + $pdf->setPage($pagenb); + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + } + $this->_pagefoot($pdf,$object,$outputlangs,1); + $pagenb++; + $pdf->setPage($pagenb); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + } + if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak) + { + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1); + } + $this->_pagefoot($pdf,$object,$outputlangs,1); + // New page + $pdf->AddPage(); + if (! empty($tplidx)) $pdf->useTemplate($tplidx); + $pagenb++; + if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); + } + } - // Affiche zone infos - $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); + // Show square + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1; + } - // Affiche zone totaux - $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); + // Affiche zone infos + $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); - // Affiche zone versements - if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) - { - $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); - } + // Affiche zone totaux + $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); - // Pied de page - $this->_pagefoot($pdf,$object,$outputlangs); - if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); + // Affiche zone versements + if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) + { + $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); + } - $pdf->Close(); + // Pied de page + $this->_pagefoot($pdf,$object,$outputlangs); + if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages(); - $pdf->Output($file,'F'); + $pdf->Close(); - // Add pdfgeneration hook - if (! is_object($hookmanager)) - { - include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; - $hookmanager=new HookManager($this->db); - } - $hookmanager->initHooks(array('pdfgeneration')); - $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - global $action; - $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $pdf->Output($file,'F'); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($file, octdec($conf->global->MAIN_UMASK)); + // Add pdfgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks - return 1; // Pas d'erreur - } - else - { - $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); - return 0; - } - } - else - { - $this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); - return 0; - } - $this->error=$langs->trans("ErrorUnknown"); - return 0; // Erreur par defaut - } + if (! empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + return 1; // Pas d'erreur + } + else + { + $this->error=$langs->trans("ErrorCanNotCreateDir",$dir); + return 0; + } + } + else + { + $this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); + return 0; + } + $this->error=$langs->trans("ErrorUnknown"); + return 0; // Erreur par defaut + } - /** - * Show payments table - * + /** + * Show payments table + * * @param PDF &$pdf Object PDF * @param Object $object Object invoice * @param int $posy Position y in PDF * @param Translate $outputlangs Object langs for output * @return int <0 if KO, >0 if OK - */ - function _tableau_versements(&$pdf, $object, $posy, $outputlangs) - { - global $conf; + */ + function _tableau_versements(&$pdf, $object, $posy, $outputlangs) + { + global $conf; $sign=1; if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; $tab3_posx = 120; - $tab3_top = $posy + 8; - $tab3_width = 80; - $tab3_height = 4; - if ($this->page_largeur < 210) // To work with US executive format - { - $tab3_posx -= 20; - } + $tab3_top = $posy + 8; + $tab3_width = 80; + $tab3_height = 4; + if ($this->page_largeur < 210) // To work with US executive format + { + $tab3_posx -= 20; + } - $default_font_size = pdf_getPDFFontSize($outputlangs); + $default_font_size = pdf_getPDFFontSize($outputlangs); - $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); - if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); + $title=$outputlangs->transnoentities("PaymentsAlreadyDone"); + if ($object->type == 2) $title=$outputlangs->transnoentities("PaymentsBackAlreadyDone"); - $pdf->SetFont('','', $default_font_size - 3); - $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->SetFont('','', $default_font_size - 3); + $pdf->SetXY($tab3_posx, $tab3_top - 4); + $pdf->MultiCell(60, 3, $title, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); + $pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); - $pdf->SetFont('','', $default_font_size - 4); - $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->SetFont('','', $default_font_size - 4); + $pdf->SetXY($tab3_posx, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); + $pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); - $y=0; + $y=0; - $pdf->SetFont('','', $default_font_size - 4); + $pdf->SetFont('','', $default_font_size - 4); - // Loop on each deposits and credit notes included - $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; - $sql.= " re.description, re.fk_facture_source,"; - $sql.= " f.type, f.datef"; - $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; - $sql.= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - $invoice=new Facture($this->db); - while ($i < $num) - { - $y+=3; - $obj = $this->db->fetch_object($resql); + // Loop on each deposits and credit notes included + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql.= " re.description, re.fk_facture_source,"; + $sql.= " f.type, f.datef"; + $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f"; + $sql.= " WHERE re.fk_facture_source = f.rowid AND re.fk_facture = ".$object->id; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + $invoice=new Facture($this->db); + while ($i < $num) + { + $y+=3; + $obj = $this->db->fetch_object($resql); - if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); - elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); - else $text=$outputlangs->trans("UnknownType"); + if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); + elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); + else $text=$outputlangs->trans("UnknownType"); - $invoice->fetch($obj->fk_facture_source); + $invoice->fetch($obj->fk_facture_source); - $pdf->SetXY($tab3_posx, $tab3_top+$y); - $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); - $pdf->MultiCell(20, 3, $text, 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); - $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); + $pdf->SetXY($tab3_posx, $tab3_top+$y); + $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top+$y); + $pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top+$y); + $pdf->MultiCell(20, 3, $text, 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top+$y); + $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); - $i++; - } - } - else - { - $this->error=$this->db->lasterror(); - return -1; - } + $i++; + } + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } - // Loop on each payment - $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; - $sql.= " cp.code"; - $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; - $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; - $sql.= " ORDER BY p.datep"; - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i=0; - while ($i < $num) { - $y+=3; - $row = $this->db->fetch_object($resql); + // Loop on each payment + $sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,"; + $sql.= " cp.code"; + $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id"; + $sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id; + $sql.= " ORDER BY p.datep"; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + $i=0; + while ($i < $num) { + $y+=3; + $row = $this->db->fetch_object($resql); - $pdf->SetXY($tab3_posx, $tab3_top+$y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); - $pdf->SetXY($tab3_posx+21, $tab3_top+$y); - $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); - $pdf->SetXY($tab3_posx+40, $tab3_top+$y); - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); + $pdf->SetXY($tab3_posx, $tab3_top+$y); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); + $pdf->SetXY($tab3_posx+21, $tab3_top+$y); + $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); + $pdf->SetXY($tab3_posx+40, $tab3_top+$y); + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); - $pdf->SetXY($tab3_posx+58, $tab3_top+$y); - $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->SetXY($tab3_posx+58, $tab3_top+$y); + $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); - $i++; - } - } - else - { - $this->error=$this->db->lasterror(); - return -1; - } + $i++; + } + } + else + { + $this->error=$this->db->lasterror(); + return -1; + } - } + } - /** - * Show miscellaneous information (payment mode, payment term, ...) - * - * @param PDF &$pdf Object PDF - * @param Object $object Object to show - * @param int $posy Y - * @param Translate $outputlangs Langs object - * @return void - */ - function _tableau_info(&$pdf, $object, $posy, $outputlangs) - { - global $conf; + /** + * Show miscellaneous information (payment mode, payment term, ...) + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $posy Y + * @param Translate $outputlangs Langs object + * @return void + */ + function _tableau_info(&$pdf, $object, $posy, $outputlangs) + { + global $conf; - $default_font_size = pdf_getPDFFontSize($outputlangs); + $default_font_size = pdf_getPDFFontSize($outputlangs); - $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetFont('','', $default_font_size - 1); - // If France, show VAT mention if not applicable - if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + // If France, show VAT mention if not applicable + if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); - $posy=$pdf->GetY()+4; - } + $posy=$pdf->GetY()+4; + } - $posxval=52; + $posxval=52; - // Show payments conditions - if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + // Show payments conditions + if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement)) + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentConditions").':'; + $pdf->MultiCell(80, 4, $titre, 0, 'L'); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); - $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posxval, $posy); + $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); + $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); - $posy=$pdf->GetY()+3; - } + $posy=$pdf->GetY()+3; + } - if ($object->type != 2) - { - // Check a payment mode is defined - if (empty($object->mode_reglement_code) - && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) - { - $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); - } - // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) - { - $outputlangs->load("errors"); + if ($object->type != 2) + { + // Check a payment mode is defined + if (empty($object->mode_reglement_code) + && empty($conf->global->FACTURE_CHQ_NUMBER) + && empty($conf->global->FACTURE_RIB_NUMBER)) + { + $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); + } + // Avoid having any valid PDF with setup that is not complete + elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) + || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) + { + $outputlangs->load("errors"); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B', $default_font_size - 2); - $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); - $pdf->MultiCell(80, 3, $this->error,0,'L',0); - $pdf->SetTextColor(0,0,0); + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetTextColor(200,0,0); + $pdf->SetFont('','B', $default_font_size - 2); + $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup",$object->mode_reglement_code); + $pdf->MultiCell(80, 3, $this->error,0,'L',0); + $pdf->SetTextColor(0,0,0); - $posy=$pdf->GetY()+1; - } + $posy=$pdf->GetY()+1; + } - // Show payment mode - if ($object->mode_reglement_code - && $object->mode_reglement_code != 'CHQ' - && $object->mode_reglement_code != 'VIR') - { - $pdf->SetFont('','B', $default_font_size - 2); - $pdf->SetXY($this->marge_gauche, $posy); - $titre = $outputlangs->transnoentities("PaymentMode").':'; - $pdf->MultiCell(80, 5, $titre, 0, 'L'); + // Show payment mode + if ($object->mode_reglement_code + && $object->mode_reglement_code != 'CHQ' + && $object->mode_reglement_code != 'VIR') + { + $pdf->SetFont('','B', $default_font_size - 2); + $pdf->SetXY($this->marge_gauche, $posy); + $titre = $outputlangs->transnoentities("PaymentMode").':'; + $pdf->MultiCell(80, 5, $titre, 0, 'L'); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posxval, $posy); - $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); - $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posxval, $posy); + $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement); + $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L'); - $posy=$pdf->GetY()+2; - } + $posy=$pdf->GetY()+2; + } - // Show payment mode CHQ - if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') - { - // Si mode reglement non force ou si force a CHQ - if (! empty($conf->global->FACTURE_CHQ_NUMBER)) - { - $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + // Show payment mode CHQ + if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') + { + // Si mode reglement non force ou si force a CHQ + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) + { + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); - if ($conf->global->FACTURE_CHQ_NUMBER > 0) - { - $account = new Account($this->db); - $account->fetch($conf->global->FACTURE_CHQ_NUMBER); + if ($conf->global->FACTURE_CHQ_NUMBER > 0) + { + $account = new Account($this->db); + $account->fetch($conf->global->FACTURE_CHQ_NUMBER); - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); - $posy=$pdf->GetY()+1; + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); + $posy=$pdf->GetY()+1; - if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); - $posy=$pdf->GetY()+2; - } - } - if ($conf->global->FACTURE_CHQ_NUMBER == -1) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); - $posy=$pdf->GetY()+1; + if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $posy=$pdf->GetY()+2; + } + } + if ($conf->global->FACTURE_CHQ_NUMBER == -1) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); + $posy=$pdf->GetY()+1; - if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) - { - $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); - $posy=$pdf->GetY()+2; - } - } - } - } + if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) + { + $pdf->SetXY($this->marge_gauche, $posy); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $posy=$pdf->GetY()+2; + } + } + } + } - // If payment mode not forced or forced to VIR, show payment with BAN - if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') - { - if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) - { - $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); - $account = new Account($this->db); - $account->fetch($bankid); + // If payment mode not forced or forced to VIR, show payment with BAN + if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') + { + if (! empty($object->fk_bank) || ! empty($conf->global->FACTURE_RIB_NUMBER)) + { + $bankid=(empty($object->fk_bank)?$conf->global->FACTURE_RIB_NUMBER:$object->fk_bank); + $account = new Account($this->db); + $account->fetch($bankid); - $curx=$this->marge_gauche; - $cury=$posy; + $curx=$this->marge_gauche; + $cury=$posy; - $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size); + $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size); - $posy+=2; - } - } - } + $posy+=2; + } + } + } - return $posy; - } + return $posy; + } - /** - * Show total to pay - * - * @param PDF &$pdf Object PDF - * @param Facture $object Object invoice - * @param int $deja_regle Montant deja regle - * @param int $posy Position depart - * @param Translate $outputlangs Objet langs - * @return int Position pour suite - */ - function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) - { - global $conf,$mysoc; + /** + * Show total to pay + * + * @param PDF &$pdf Object PDF + * @param Facture $object Object invoice + * @param int $deja_regle Montant deja regle + * @param int $posy Position depart + * @param Translate $outputlangs Objet langs + * @return int Position pour suite + */ + function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) + { + global $conf,$mysoc; $sign=1; if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1; $default_font_size = pdf_getPDFFontSize($outputlangs); - $tab2_top = $posy; - $tab2_hl = 4; - $pdf->SetFont('','', $default_font_size - 1); + $tab2_top = $posy; + $tab2_hl = 4; + $pdf->SetFont('','', $default_font_size - 1); - // Tableau total - $col1x = 120; $col2x = 170; - if ($this->page_largeur < 210) // To work with US executive format + // Tableau total + $col1x = 120; $col2x = 170; + if ($this->page_largeur < 210) // To work with US executive format + { + $col2x-=20; + } + $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); + + $useborder=0; + $index = 0; + + // Total HT + $pdf->SetFillColor(255,255,255); + $pdf->SetXY($col1x, $tab2_top + 0); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); + + // Show VAT by rates and total + $pdf->SetFillColor(248,248,248); + + $this->atleastoneratenotnull=0; + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); + if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) + { + // Nothing to do + } + else + { + //Local tax 1 before VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ + foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey!=0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + } + //} + //Local tax 2 before VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ + foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey!=0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + + } + } + } + //} + // VAT + foreach($this->tva as $tvakey => $tvaval) + { + if ($tvakey > 0) // On affiche pas taux 0 + { + $this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat.=vatrate($tvakey,1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + + //Local tax 1 after VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ + foreach( $this->localtax1 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('2','4','6'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + if ($tvakey != 0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + } + //} + //Local tax 2 after VAT + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ + foreach( $this->localtax2 as $localtax_type => $localtax_rate ) + { + if (in_array((string) $localtax_type, array('2','4','6'))) continue; + + foreach( $localtax_rate as $tvakey => $tvaval ) + { + // retrieve global local tax + if ($tvakey != 0) // On affiche pas taux 0 + { + //$this->atleastoneratenotnull++; + + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + + $tvacompl=''; + if (preg_match('/\*/',$tvakey)) + { + $tvakey=str_replace('*','',$tvakey); + $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; + } + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + } + } + //} + } + + // Revenue stamp + if (price2num($object->revenuestamp) != 0) + { + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + } + + // Total TTC + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->SetTextColor(0,0,60); + $pdf->SetFillColor(224,224,224); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); + } + } + + $pdf->SetTextColor(0,0,0); + + $creditnoteamount=$object->getSumCreditNotesUsed(); + $depositsamount=$object->getSumDepositsUsed(); + //print "x".$creditnoteamount."-".$depositsamount;exit; + $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); + if ($object->paye) $resteapayer=0; + + if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) + { + // Already paid + Deposits + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + + // Credit note + if ($creditnoteamount) + { + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + } + + // Escompte + if ($object->close_code == 'discount_vat') + { + $index++; + $pdf->SetFillColor(255,255,255); + + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + + $resteapayer=0; + } + + $index++; + $pdf->SetTextColor(0,0,60); + $pdf->SetFillColor(224,224,224); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + + // Fin + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetTextColor(0,0,0); + } + + $index++; + return ($tab2_top + ($tab2_hl * $index)); + } + + /** + * Show table for lines + * + * @param PDF &$pdf Object PDF + * @param string $tab_top Top position of table + * @param string $tab_height Height of table (rectangle) + * @param int $nexY Y (not used) + * @param Translate $outputlangs Langs object + * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title + * @param int $hidebottom Hide bottom bar of array + * @return void + */ + function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) + { + global $conf; + + // Force to disable hidetop and hidebottom + $hidebottom=0; + if ($hidetop) $hidetop=-1; + + $default_font_size = pdf_getPDFFontSize($outputlangs); + + // Amount in (at tab_top - 1) + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + + if (empty($hidetop)) + { + $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); + $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); + $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); + + //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; + if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); + } + + $pdf->SetDrawColor(128,128,128); + $pdf->SetFont('','', $default_font_size - 1); + + // Output Rect + $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param + + if (empty($hidetop)) + { + $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param + + $pdf->SetXY($this->posxdesc-1, $tab_top+1); + $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); + } + + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxtva-3, $tab_top+1); + $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); + } + } + + $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxup-1, $tab_top+1); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); + } + + $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + $pdf->SetXY($this->posxqty-1, $tab_top+1); + $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); + } + + $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); + if (empty($hidetop)) + { + if ($this->atleastonediscount) + { + $pdf->SetXY($this->posxdiscount-1, $tab_top+1); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + } + } + if ($this->atleastonediscount) + { + $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); + } + if (empty($hidetop)) + { + $pdf->SetXY($this->postotalht-1, $tab_top+1); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); + } + } + + /** + * Show top header of page. + * + * @param PDF &$pdf Object PDF + * @param Object $object Object to show + * @param int $showaddress 0=no, 1=yes + * @param Translate $outputlangs Object lang for output + * @return void + */ + function _pagehead(&$pdf, $object, $showaddress, $outputlangs) + { + global $conf,$langs; + + $outputlangs->load("main"); + $outputlangs->load("bills"); + $outputlangs->load("propal"); + $outputlangs->load("companies"); + + $default_font_size = pdf_getPDFFontSize($outputlangs); + + pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); + + // Show Draft Watermark + if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) { - $col2x-=20; - } - $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); - - $useborder=0; - $index = 0; - - // Total HT - $pdf->SetFillColor(255,255,255); - $pdf->SetXY($col1x, $tab2_top + 0); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + 0); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($object->total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); - - // Show VAT by rates and total - $pdf->SetFillColor(248,248,248); - - $this->atleastoneratenotnull=0; - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false); - if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull) - { - // Nothing to do - } - else - { - //Local tax 1 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey!=0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - } - //} - //Local tax 2 before VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey!=0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - - } - } - } - //} - // VAT - foreach($this->tva as $tvakey => $tvaval) - { - if ($tvakey > 0) // On affiche pas taux 0 - { - $this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - - //Local tax 1 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - //{ - foreach( $this->localtax1 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - } - //} - //Local tax 2 after VAT - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - //{ - foreach( $this->localtax2 as $localtax_type => $localtax_rate ) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach( $localtax_rate as $tvakey => $tvaval ) - { - // retrieve global local tax - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/',$tvakey)) - { - $tvakey=str_replace('*','',$tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; - - $totalvat.=vatrate(abs($tvakey),1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - //} - } - - // Revenue stamp - if (price2num($object->revenuestamp) != 0) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); - } - - // Total TTC - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0,0,60); - $pdf->SetFillColor(224,224,224); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); - - if($this->atleastonediscount){ - // Total Discount - $index++; - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0,0,60); - $pdf->SetFillColor(224,224,224); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); - } - } + pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); } - $pdf->SetTextColor(0,0,0); + $pdf->SetTextColor(0,0,60); + $pdf->SetFont('','B', $default_font_size + 3); - $creditnoteamount=$object->getSumCreditNotesUsed(); - $depositsamount=$object->getSumDepositsUsed(); - //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); - if ($object->paye) $resteapayer=0; - - if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) - { - // Already paid + Deposits - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); - - // Credit note - if ($creditnoteamount) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); - } - - // Escompte - if ($object->close_code == 'discount_vat') - { - $index++; - $pdf->SetFillColor(255,255,255); - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOffered"), $useborder, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); - - $resteapayer=0; - } - - $index++; - $pdf->SetTextColor(0,0,60); - $pdf->SetFillColor(224,224,224); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); - - // Fin - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetTextColor(0,0,0); - } - - $index++; - return ($tab2_top + ($tab2_hl * $index)); - } - - /** - * Show table for lines - * - * @param PDF &$pdf Object PDF - * @param string $tab_top Top position of table - * @param string $tab_height Height of table (rectangle) - * @param int $nexY Y (not used) - * @param Translate $outputlangs Langs object - * @param int $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title - * @param int $hidebottom Hide bottom bar of array - * @return void - */ - function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0) - { - global $conf; - - // Force to disable hidetop and hidebottom - $hidebottom=0; - if ($hidetop) $hidetop=-1; - - $default_font_size = pdf_getPDFFontSize($outputlangs); - - // Amount in (at tab_top - 1) - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - - if (empty($hidetop)) - { - $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency)); - $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); - $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); - - //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; - if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)); - } - - $pdf->SetDrawColor(128,128,128); - $pdf->SetFont('','', $default_font_size - 1); - - // Output Rect - $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param - - if (empty($hidetop)) - { - $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param - - $pdf->SetXY($this->posxdesc-1, $tab_top+1); - $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); - } - - if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) - { - $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxtva-3, $tab_top+1); - $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C'); - } - } - - $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxup-1, $tab_top+1); - $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); - } - - $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - $pdf->SetXY($this->posxqty-1, $tab_top+1); - $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); - } - - $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); - if (empty($hidetop)) - { - if ($this->atleastonediscount) - { - $pdf->SetXY($this->posxdiscount-1, $tab_top+1); - $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); - } - } - if ($this->atleastonediscount) - { - $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); - } - if (empty($hidetop)) - { - $pdf->SetXY($this->postotalht-1, $tab_top+1); - $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); - } - } - - /** - * Show top header of page. - * - * @param PDF &$pdf Object PDF - * @param Object $object Object to show - * @param int $showaddress 0=no, 1=yes - * @param Translate $outputlangs Object lang for output - * @return void - */ - function _pagehead(&$pdf, $object, $showaddress, $outputlangs) - { - global $conf,$langs; - - $outputlangs->load("main"); - $outputlangs->load("bills"); - $outputlangs->load("propal"); - $outputlangs->load("companies"); - - $default_font_size = pdf_getPDFFontSize($outputlangs); - - pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); - - // Show Draft Watermark - if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) ) - { - pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK); - } - - $pdf->SetTextColor(0,0,60); - $pdf->SetFont('','B', $default_font_size + 3); - - $posy=$this->marge_haute; + $posy=$this->marge_haute; $posx=$this->page_largeur-$this->marge_droite-100; - $pdf->SetXY($this->marge_gauche,$posy); + $pdf->SetXY($this->marge_gauche,$posy); - // Logo - $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; - if ($this->emetteur->logo) - { - if (is_readable($logo)) - { - $height=pdf_getHeightForLogo($logo); - $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) - } - else - { - $pdf->SetTextColor(200,0,0); - $pdf->SetFont('','B',$default_font_size - 2); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); - } - } - else - { - $text=$this->emetteur->name; - $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); - } + // Logo + $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; + if ($this->emetteur->logo) + { + if (is_readable($logo)) + { + $height=pdf_getHeightForLogo($logo); + $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) + } + else + { + $pdf->SetTextColor(200,0,0); + $pdf->SetFont('','B',$default_font_size - 2); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L'); + } + } + else + { + $text=$this->emetteur->name; + $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); + } - $pdf->SetFont('','B', $default_font_size + 3); - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $title=$outputlangs->transnoentities("Invoice"); - if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); - if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); - if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); - if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); - $pdf->MultiCell(100, 3, $title, '', 'R'); + $pdf->SetFont('','B', $default_font_size + 3); + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $title=$outputlangs->transnoentities("Invoice"); + if ($object->type == 1) $title=$outputlangs->transnoentities("InvoiceReplacement"); + if ($object->type == 2) $title=$outputlangs->transnoentities("InvoiceAvoir"); + if ($object->type == 3) $title=$outputlangs->transnoentities("InvoiceDeposit"); + if ($object->type == 4) $title=$outputlangs->transnoentities("InvoiceProFormat"); + $pdf->MultiCell(100, 3, $title, '', 'R'); - $pdf->SetFont('','B',$default_font_size); + $pdf->SetFont('','B',$default_font_size); - $posy+=5; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); + $posy+=5; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R'); - $posy+=1; - $pdf->SetFont('','', $default_font_size - 2); + $posy+=1; + $pdf->SetFont('','', $default_font_size - 2); - if ($object->ref_client) - { - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); - } + if ($object->ref_client) + { + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R'); + } - $objectidnext=$object->getIdReplacingInvoice('validated'); - if ($object->type == 0 && $objectidnext) - { - $objectreplacing=new Facture($this->db); - $objectreplacing->fetch($objectidnext); + $objectidnext=$object->getIdReplacingInvoice('validated'); + if ($object->type == 0 && $objectidnext) + { + $objectreplacing=new Facture($this->db); + $objectreplacing->fetch($objectidnext); - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); - } - if ($object->type == 1) - { - $objectreplaced=new Facture($this->db); - $objectreplaced->fetch($object->fk_facture_source); + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementByInvoice").' : '.$outputlangs->convToOutputCharset($objectreplacing->ref), '', 'R'); + } + if ($object->type == 1) + { + $objectreplaced=new Facture($this->db); + $objectreplaced->fetch($object->fk_facture_source); - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); - } - if ($object->type == 2) - { - $objectreplaced=new Facture($this->db); - $objectreplaced->fetch($object->fk_facture_source); + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ReplacementInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); + } + if ($object->type == 2) + { + $objectreplaced=new Facture($this->db); + $objectreplaced->fetch($object->fk_facture_source); - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); - } + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CorrectionInvoice").' : '.$outputlangs->convToOutputCharset($objectreplaced->ref), '', 'R'); + } - $posy+=4; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R'); + $posy+=4; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateInvoice")." : " . dol_print_date($object->date,"day",false,$outputlangs), '', 'R'); - if ($object->type != 2) - { - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); - } + if ($object->type != 2) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R'); + } - if ($object->client->code_client) - { - $posy+=3; - $pdf->SetXY($posx,$posy); - $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); - } + if ($object->client->code_client) + { + $posy+=3; + $pdf->SetXY($posx,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); + } - $posy+=1; + $posy+=1; - // Show list of linked objects - $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + // Show list of linked objects + $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); - if ($showaddress) - { - // Sender properties - $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); + if ($showaddress) + { + // Sender properties + $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur); - // Show sender - $posy=42; - $posx=$this->marge_gauche; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; - $hautcadre=40; + // Show sender + $posy=42; + $posx=$this->marge_gauche; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; + $hautcadre=40; - // Show sender frame - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posx,$posy-5); - $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); - $pdf->SetXY($posx,$posy); - $pdf->SetFillColor(230,230,230); - $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0,0,60); + // Show sender frame + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posx,$posy-5); + $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); + $pdf->SetXY($posx,$posy); + $pdf->SetFillColor(230,230,230); + $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); + $pdf->SetTextColor(0,0,60); - // Show sender name - $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); - $posy=$pdf->getY(); + // Show sender name + $pdf->SetXY($posx+2,$posy+3); + $pdf->SetFont('','B', $default_font_size); + $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); + $posy=$pdf->getY(); - // Show sender information - $pdf->SetXY($posx+2,$posy); - $pdf->SetFont('','', $default_font_size - 1); - $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); + // Show sender information + $pdf->SetXY($posx+2,$posy); + $pdf->SetFont('','', $default_font_size - 1); + $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); - // If BILLING contact defined on invoice, we use it - $usecontact=false; - $arrayidcontact=$object->getIdContact('external','BILLING'); - if (count($arrayidcontact) > 0) - { - $usecontact=true; - $result=$object->fetch_contact($arrayidcontact[0]); - } + // If BILLING contact defined on invoice, we use it + $usecontact=false; + $arrayidcontact=$object->getIdContact('external','BILLING'); + if (count($arrayidcontact) > 0) + { + $usecontact=true; + $result=$object->fetch_contact($arrayidcontact[0]); + } - // Recipient name - if (! empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; - else $socname = $object->client->nom; - $carac_client_name=$outputlangs->convToOutputCharset($socname); - } - else - { - $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); - } + // Recipient name + if (! empty($usecontact)) + { + // On peut utiliser le nom de la societe du contact + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; + else $socname = $object->client->nom; + $carac_client_name=$outputlangs->convToOutputCharset($socname); + } + else + { + $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); + } - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target'); - // Show recipient - $widthrecbox=100; - if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; - $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; - if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; + // Show recipient + $widthrecbox=100; + if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format + $posy=42; + $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; + if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; - // Show recipient frame - $pdf->SetTextColor(0,0,0); - $pdf->SetFont('','', $default_font_size - 2); - $pdf->SetXY($posx+2,$posy-5); - $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); - $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); + // Show recipient frame + $pdf->SetTextColor(0,0,0); + $pdf->SetFont('','', $default_font_size - 2); + $pdf->SetXY($posx+2,$posy-5); + $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L'); + $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); - // Show recipient name - $pdf->SetXY($posx+2,$posy+3); - $pdf->SetFont('','B', $default_font_size); - $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); + // Show recipient name + $pdf->SetXY($posx+2,$posy+3); + $pdf->SetFont('','B', $default_font_size); + $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); - // Show recipient information - $pdf->SetFont('','', $default_font_size - 1); - $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); - $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); - } + // Show recipient information + $pdf->SetFont('','', $default_font_size - 1); + $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4)); + $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); + } - $pdf->SetTextColor(0,0,0); - } + $pdf->SetTextColor(0,0,0); + } - /** - * Show footer of page. Need this->emetteur object + /** + * Show footer of page. Need this->emetteur object * - * @param PDF &$pdf PDF - * @param Object $object Object to show - * @param Translate $outputlangs Object lang for output - * @param int $hidefreetext 1=Hide free text - * @return int Return height of bottom margin including footer text - */ - function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) - { - return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); - } + * @param PDF &$pdf PDF + * @param Object $object Object to show + * @param Translate $outputlangs Object lang for output + * @param int $hidefreetext 1=Hide free text + * @return int Return height of bottom margin including footer text + */ + function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) + { + return pdf_pagefoot($pdf,$outputlangs,'FACTURE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); + } } From b8a0f6aec9d1858ab33a118c6622f3b86aa5fc1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Aug 2014 19:03:15 +0200 Subject: [PATCH 392/502] New: Add option to foce delivery receipt to yes --- htdocs/core/class/html.formmail.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index fd1d90b1aef..7d5f1a3bf2e 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -474,7 +474,11 @@ class FormMail } else { - $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:0), 1); + $defaultvaluefordeliveryreceipt=0; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; + $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); } $out.= "\n"; From 9436b1d046c1d67d62f232963743d2120100f83c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 09:26:40 +0200 Subject: [PATCH 393/502] New: Prepare to be able to defined a bcc for each type of email sent from dolibarr. --- htdocs/core/actions_sendmails.inc.php | 10 ++++++++-- htdocs/societe/soc.php | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 3af164abfab..337cf59c9b0 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -26,7 +26,8 @@ // $id must be defined // $actiontypecode must be defined - +// $paramname must be defined +// $mode must be defined /* * Add file in email form @@ -115,6 +116,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; $message = $_POST['message']; $sendtocc = $_POST['sendtocc']; + $sendtobcc=''; + if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); + if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); + if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); + $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send' || $action == 'relance') @@ -141,7 +147,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); if ($mailfile->error) { $mesgs[]='
'.$mailfile->error.'
'; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 7ca032cf422..d1bdfa898d4 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -513,6 +513,7 @@ if (empty($reshook)) $id=$socid; $actiontypecode='AC_OTH_AUTO'; $paramname='socid'; + $mode='emailfromthirdparty'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; From 20d6920a0cbfd57bac67eda377208234fe6fb697 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 09:27:40 +0200 Subject: [PATCH 394/502] Add comment --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index c16af4c5b24..a289b43c4a9 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -170,7 +170,7 @@ class CMailFile } } - // Add autocopy to + // Add autocopy to (Note: Adding bcc for specific modules are also done from pages) if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO; // Action according to choosed sending method From 17aed0f360b9499a19990d83819f63282cfdbb44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 09:28:07 +0200 Subject: [PATCH 395/502] Prepare to be able to send bcc according to email type. --- htdocs/langs/en_US/admin.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 00a5a2dc3b4..1176a3ab7e9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -257,6 +257,9 @@ MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s) MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to +MAIN_MAIL_AUTOCOPY_PROPOSAL_TO= Send systematically a hidden carbon-copy of proposals sent by email to +MAIN_MAIL_AUTOCOPY_ORDER_TO= Send systematically a hidden carbon-copy of orders sent by email to +MAIN_MAIL_AUTOCOPY_INVOICE_TO= Send systematically a hidden carbon-copy of invoice sent by emails to MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos) MAIN_MAIL_SENDMODE=Method to use to send EMails MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required From 164c9e0b750c129608c9a07ed6c9fdf89d5fa527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 09:28:58 +0200 Subject: [PATCH 396/502] New: Can defined a bcc for each email type. --- htdocs/comm/propal.php | 3 ++- htdocs/commande/fiche.php | 7 ++++--- htdocs/compta/facture.php | 7 ++++--- htdocs/compta/facture/impayees.php | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 486ca39c18e..b1747ca066d 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -565,6 +565,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>'; $message = $_POST ['message']; $sendtocc = $_POST ['sendtocc']; + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); $deliveryreceipt = $_POST ['deliveryreceipt']; if (dol_strlen($_POST ['subject'])) @@ -591,7 +592,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Envoi de la propal require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a82eb5dda05..05429abbd7e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -617,7 +617,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) { } } } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -1192,6 +1192,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>'; $message = GETPOST('message'); $sendtocc = GETPOST('sendtocc'); + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); $deliveryreceipt = GETPOST('deliveryreceipt'); if ($action == 'send') { @@ -1220,7 +1221,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { @@ -2434,7 +2435,7 @@ if ($action == 'create' && $user->rights->commande->creer) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/')); $file = $fileparams ['fullname']; - + // Define output language $outputlangs = $langs; $newlang = ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 056d5168234..989f7f46abd 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1152,7 +1152,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) $pu_ttc = $prod->price_ttc; $price_min = $prod->price_min; $price_base_type = $prod->price_base_type; - + // We define price for product if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level)) { @@ -1181,7 +1181,7 @@ else if ($action == 'addline' && $user->rights->facture->creer) } } } - + // if price ht is forced (ie: calculated by margin rate and cost price) if (! empty($price_ht)) { $pu_ht = price2num($price_ht, 'MU'); @@ -1559,6 +1559,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; $message = $_POST['message']; $sendtocc = $_POST['sendtocc']; + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send') { @@ -1601,7 +1602,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // Send mail require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, - 1); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, - 1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); } else { diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index b3d95870838..99f3a0ba082 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -121,6 +121,7 @@ if ($action == 'presend' && GETPOST('sendmail')) $subject = GETPOST('subject'); $message = GETPOST('message'); $sendtocc = GETPOST('sentocc'); + $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $substitutionarray=array( '__ID__' => $object->id, @@ -151,7 +152,7 @@ if ($action == 'presend' && GETPOST('sendmail')) // Send mail require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); if ($mailfile->error) { $resultmasssend.='
'.$mailfile->error.'
'; From d09f4bed21567ee2c0544a89a1effee4b761d7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 5 Aug 2014 10:50:41 +0200 Subject: [PATCH 397/502] Fixed typo --- htdocs/comm/address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 438f22d28c2..289c2acb7ef 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -148,7 +148,7 @@ if ($action == 'add' || $action == 'update') { $reload = 0; setEventMessage($object->error, 'errors'); - $actino= "edit"; + $action= "edit"; } } From f863604621112a217938d6df84ce2f45093c2e58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 12:28:10 +0200 Subject: [PATCH 398/502] Prepare table for email templates. --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 17 ++++++++--------- .../mysql/tables/llx_c_email_template.sql | 15 +++++++-------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 97186c9ae75..e8a62f9d05d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -925,21 +925,20 @@ DROP TABLE llx_texts; DROP TABLE llx_c_email_templates; -CREATE table llx_c_email_templates +create table llx_c_email_templates ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id - module varchar(32), -- Nom du module en rapport avec le modele + module varchar(32), -- Nom du module en rapport avec le modele type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...) - sortorder smallint, -- Ordre affichage - - private smallint DEFAULT 0 NOT NULL, -- Template public or private - fk_user integer, -- Id utilisateur si modele prive, sinon null + private smallint DEFAULT 0 NOT NULL, -- Template public or private + fk_user integer, -- Id utilisateur si modele prive, sinon null datec datetime, tms timestamp, - - label varchar(255), - content text + label varchar(255), -- Label of predefined email + position smallint, -- Position + topic text, -- Predefined topic + content text -- Predefined text )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_email_template.sql b/htdocs/install/mysql/tables/llx_c_email_template.sql index 9390f934bc3..875314bf4c8 100644 --- a/htdocs/install/mysql/tables/llx_c_email_template.sql +++ b/htdocs/install/mysql/tables/llx_c_email_template.sql @@ -21,15 +21,14 @@ create table llx_c_email_templates ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id - module varchar(32), -- Nom du module en rapport avec le modele + module varchar(32), -- Nom du module en rapport avec le modele type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...) - sortorder smallint, -- Ordre affichage - - private smallint DEFAULT 0 NOT NULL, -- Template public or private - fk_user integer, -- Id utilisateur si modele prive, sinon null + private smallint DEFAULT 0 NOT NULL, -- Template public or private + fk_user integer, -- Id utilisateur si modele prive, sinon null datec datetime, tms timestamp, - - label varchar(255), - content text + label varchar(255), -- Label of predefined email + position smallint, -- Position + topic text, -- Predefined topic + content text -- Predefined text )ENGINE=innodb; From 90c397d1a43ecc96bb6df7fee542c5df5f6dfd9d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 5 Aug 2014 15:24:49 +0200 Subject: [PATCH 399/502] New: Intervention documents are now available in ECM module --- ChangeLog | 1 + htdocs/core/ajax/ajaxdirpreview.php | 4 +++- htdocs/core/class/html.formfile.class.php | 8 +++++++- htdocs/ecm/index_auto.php | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2dd282a06e..c21bd2f76f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ For users: Differentiate text and img. Use label into quick search form. Use accesskey on form search. +- New: Intervention documents are now available in ECM module - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index d1a64f6b256..e5972ad17f9 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -153,7 +153,7 @@ if ($type == 'directory') $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); // Right area. If module is defined, we are in automatic ecm. - $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project'); + $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter'); // TODO change for multicompany sharing // Auto area for suppliers invoices @@ -184,6 +184,8 @@ if ($type == 'directory') else if ($module == 'tax') $upload_dir = $conf->tax->dir_output; // Auto area for projects else if ($module == 'project') $upload_dir = $conf->projet->dir_output; + // Auto area for interventions + else if ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output; if (in_array($module, $automodules)) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8806879aa4b..d3e2f39e26d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -936,6 +936,11 @@ class FormFile include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $object_instance=new Project($this->db); } + else if ($modulepart == 'fichinter') + { + include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $object_instance=new Fichinter($this->db); + } $var=true; foreach($filearray as $key => $file) @@ -962,7 +967,8 @@ class FormFile if ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } - if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} if (! $id && ! $ref) continue; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 3e6e6cfa05b..1afbd376838 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -409,6 +409,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED)) if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); } + if (! empty($conf->ficheinter->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } } print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager")); From 4f47bddd0ae58e78a72312fe54759e512a6bc407 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 5 Aug 2014 16:00:56 +0200 Subject: [PATCH 400/502] New : Intervention documents are now available in ECM module (files downloadable) --- htdocs/core/lib/files.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index a6082fa0c29..7ea3bea9052 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1582,6 +1582,16 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } + // Wrapping for interventions + else if ($modulepart == 'fichinter') + { + if ($fuser->rights->ficheinter->lire || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + $original_file=$conf->ficheinter->dir_output.'/'.$original_file; + $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; + } // Wrapping pour les commandes fournisseurs else if ($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') From 1b3efbb9a35b33987bec5315acb72fb232795b01 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 5 Aug 2014 16:01:40 +0200 Subject: [PATCH 401/502] New : add attachments on user cards --- htdocs/core/ajax/ajaxdirpreview.php | 4 +- htdocs/core/class/html.formfile.class.php | 6 + htdocs/core/lib/usergroups.lib.php | 22 ++- htdocs/ecm/index_auto.php | 2 + htdocs/user/document.php | 174 ++++++++++++++++++++++ 5 files changed, 203 insertions(+), 5 deletions(-) create mode 100644 htdocs/user/document.php diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index e5972ad17f9..63641d00ab8 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -153,7 +153,7 @@ if ($type == 'directory') $sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC); // Right area. If module is defined, we are in automatic ecm. - $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter'); + $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user'); // TODO change for multicompany sharing // Auto area for suppliers invoices @@ -186,6 +186,8 @@ if ($type == 'directory') else if ($module == 'project') $upload_dir = $conf->projet->dir_output; // Auto area for interventions else if ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output; + // Auto area for users + else if ($module == 'user') $upload_dir = $conf->user->dir_output; if (in_array($module, $automodules)) { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d3e2f39e26d..21d272a4198 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -941,6 +941,11 @@ class FormFile include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $object_instance=new Fichinter($this->db); } + else if ($modulepart == 'user') + { + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $object_instance=new User($this->db); + } $var=true; foreach($filearray as $key => $file) @@ -969,6 +974,7 @@ class FormFile if ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:''); } if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');} + if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} if (! $id && ! $ref) continue; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 75a78627f52..0b8c759f21a 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -88,10 +88,24 @@ function user_prepare_head($object) //Info on users is visible only by internal user if (empty($user->societe_id)) { - $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; - $head[$h][1] = $langs->trans("Note"); - $head[$h][2] = 'note'; - $h++; + // Notes + $nbNote = 0; + if(!empty($object->note)) $nbNote++; + $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; + $head[$h][1] = $langs->trans("Note"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; + $head[$h][2] = 'note'; + $h++; + + // Attached files + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $upload_dir = $conf->user->dir_output . "/" . $object->id; + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$')); + $head[$h][0] = DOL_URL_ROOT.'/user/document.php?userid='.$object->id; + $head[$h][1] = $langs->trans("Documents"); + if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')'; + $head[$h][2] = 'document'; + $h++; $head[$h][0] = DOL_URL_ROOT.'/user/info.php?id='.$object->id; $head[$h][1] = $langs->trans("Info"); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 1afbd376838..7d0fc5c64bf 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -410,6 +410,8 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED)) if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); } if (! empty($conf->ficheinter->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } + $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers")); + } print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager")); diff --git a/htdocs/user/document.php b/htdocs/user/document.php new file mode 100644 index 00000000000..b18424625ce --- /dev/null +++ b/htdocs/user/document.php @@ -0,0 +1,174 @@ + + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador + * + * 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 . + */ + +/** + * \file htdocs/user/document.php + * \brief Tab for documents linked to user + * \ingroup user + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + +$langs->load("users"); +$langs->load('other'); + + +$action=GETPOST('action'); +$confirm=GETPOST('confirm'); +$id=(GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('id','int')); +$ref = GETPOST('ref', 'alpha'); + +// Define value to know what current user can do on users +$canadduser=(! empty($user->admin) || $user->rights->user->user->creer); +$canreaduser=(! empty($user->admin) || $user->rights->user->user->lire); +$canedituser=(! empty($user->admin) || $user->rights->user->user->creer); +$candisableuser=(! empty($user->admin) || $user->rights->user->user->supprimer); +$canreadgroup=$canreaduser; +$caneditgroup=$canedituser; +if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) +{ + $canreadgroup=(! empty($user->admin) || $user->rights->user->group_advance->read); + $caneditgroup=(! empty($user->admin) || $user->rights->user->group_advance->write); +} +// Define value to know what current user can do on properties of edited user +if ($id) +{ + // $user est le user qui edite, $id est l'id de l'utilisateur edite + $caneditfield=((($user->id == $id) && $user->rights->user->self->creer) + || (($user->id != $id) && $user->rights->user->user->creer)); + $caneditpassword=((($user->id == $id) && $user->rights->user->self->password) + || (($user->id != $id) && $user->rights->user->user->password)); +} + +// Security check +$socid=0; +if ($user->societe_id > 0) $socid = $user->societe_id; +$feature2='user'; +if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card +if (!$canreaduser) { + $result = restrictedArea($user, 'user', $id, '&user', $feature2); +} +if ($user->id <> $id && ! $canreaduser) accessforbidden(); + +// Get parameters +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $conf->liste_limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="name"; + +$object = new User($db); +if ($id > 0 || ! empty($ref)) +{ + $result = $object->fetch($id, $ref); + + $upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ; +} + + +/* + * Actions + */ + +include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php'; + + +/* + * View + */ + +$form = new Form($db); + +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Files"),$help_url); + +if ($object->id) +{ + /* + * Affichage onglets + */ + if (! empty($conf->notification->enabled)) $langs->load("mails"); + $head = user_prepare_head($object); + + $form=new Form($db); + + dol_fiche_head($head, 'document', $langs->trans("User"),0,'user'); + + + // Construit liste des fichiers + $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + + print '
 
  '; @@ -132,6 +135,9 @@ if ($result) print '
'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").''; + if ($obj->login2) + { + $user2->login=$obj->login2; + //$user2->lastname=$obj->lastname2; + //$user2->firstname=$obj->firstname2; + $user2->lastname=$user2->login; + $user2->firstname=''; + print $user2->getNomUrl(1); + } + print ''.$userstatic->getLibStatut(5).''.$userstatic->getLibStatut(5).' 
'; + + // Reference + print ''; + print ''; + print ''; + + // Lastname + print ''; + print ''; + + // Firstname + print ''; + + // Login + print ''; + + // Nbre fichiers + print ''; + + //Total taille + print ''; + + print '
'.$langs->trans('Ref').''; + print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); + print '
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print ''; + + $modulepart = 'societe'; + $permission = $user->rights->societe->creer; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; +} +else +{ + accessforbidden('',0,0); +} + + +llxFooter(); +$db->close(); From e95a9cad03bb5a11c5f80ad629cb888db687e1e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 19:32:24 +0200 Subject: [PATCH 402/502] New: When force of bcc is set, we show it onto email form. --- htdocs/core/class/html.formmail.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 7d5f1a3bf2e..69880f8fd29 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -439,7 +439,7 @@ class FormMail } $out.= "\n"; } - + // CCC if (! empty($this->withtoccc) || is_array($this->withtoccc)) { @@ -459,7 +459,12 @@ class FormMail $out.= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1); } } - //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1); + + $showinfobcc=''; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; + if ($showinfobcc) $out.=' + '.$showinfobcc; $out.= "\n"; } @@ -475,9 +480,9 @@ class FormMail else { $defaultvaluefordeliveryreceipt=0; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1; if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); } From 2624632fdea270c3fed5c6926033e6d614ef741c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 19:55:14 +0200 Subject: [PATCH 403/502] Fix: bad test commande_send -> order_send --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 69880f8fd29..261754801a9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -462,7 +462,7 @@ class FormMail $showinfobcc=''; if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO; - if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; + if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO; if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO; if ($showinfobcc) $out.=' + '.$showinfobcc; $out.= "\n"; @@ -481,7 +481,7 @@ class FormMail { $defaultvaluefordeliveryreceipt=0; if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1; - if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1; + if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1; if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1; $out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1); } From 0397fa7dc356e98597b0644b2d17ba03f562e123 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Aug 2014 21:18:36 +0200 Subject: [PATCH 404/502] Fix: mb_strtolower function does not exists on all PHP versions. --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1641aeb132c..cdf05a2c29d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -838,7 +838,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass } // Show page nb only on iso languages (so default Helvetica font) - if (mb_strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') + if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') { $pdf->SetXY(-20,-$posy); //print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit; From 0514fa02d5953c9c761dd1088934b1912c8f8ba9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 00:06:27 +0200 Subject: [PATCH 405/502] Clean path dolibarr_main_url_root to avoid duplicate /. --- htdocs/conf/conf.php.example | 4 ++-- htdocs/filefunc.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 990a10c2500..32adc4b87c9 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -12,8 +12,8 @@ //################### // dolibarr_main_url_root -// This parameter defines the root URL of your Dolibarr index.php page. -// It must link to the htdocs directory htdocs. +// This parameter defines the root URL of your Dolibarr index.php page without ending "/". +// It must link to the directory htdocs. // In most cases, this is autodetected but it's still required // * to show full url bookmarks for some services (ie: agenda rss export url, ...) // * or when using Apache dir aliases (autodetect fails) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c30388050cf..6f8a2bb9b2c 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -92,7 +92,7 @@ if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off'); // Clean parameters $dolibarr_main_data_root=trim($dolibarr_main_data_root); -$dolibarr_main_url_root=trim($dolibarr_main_url_root); +$dolibarr_main_url_root=trim(preg_replace('/\/+$/','',$dolibarr_main_url_root)); $dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibarr_main_url_root_alt)); $dolibarr_main_document_root=trim($dolibarr_main_document_root); $dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt)); From 1751b58ef8ab1dd0876dfed16851effd2fb3023e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 00:46:00 +0200 Subject: [PATCH 406/502] New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. --- ChangeLog | 1 + htdocs/comm/propal.php | 8 ++++++-- htdocs/commande/fiche.php | 8 ++++++-- htdocs/compta/facture.php | 15 +++++++++++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 136d94828bc..aba40b26e58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ For users: Differentiate text and img. Use label into quick search form. Use accesskey on form search. +- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index b1747ca066d..35ab381a35f 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2289,6 +2289,8 @@ if ($action == 'create') { */ if ($action == 'presend') { + $object->fetch_projet(); + $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/')); @@ -2341,7 +2343,7 @@ if ($action == 'create') { if (empty($object->ref_client)) { $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__ (__REFCLIENT__)'); } $formmail->withfile = 2; $formmail->withbody = 1; @@ -2352,6 +2354,8 @@ if ($action == 'create') { $formmail->substit ['__PROPREF__'] = $object->ref; $formmail->substit ['__SIGNATURE__'] = $user->signature; $formmail->substit ['__REFCLIENT__'] = $object->ref_client; + $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name; + $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); $formmail->substit ['__PERSONALIZED__'] = ''; $formmail->substit ['__CONTACTCIVNAME__'] = ''; @@ -2362,7 +2366,7 @@ if ($action == 'create') { if (is_array($contactarr) && count($contactarr) > 0) { foreach ($contactarr as $contact) { - if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) { + if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) { // TODO Use code and not label $contactstatic = new Contact($db); $contactstatic->fetch($contact ['id']); $custcontact = $contactstatic->getFullName($langs, 1); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 05429abbd7e..1d59311404e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2431,6 +2431,8 @@ if ($action == 'create' && $user->rights->commande->creer) { */ if ($action == 'presend') { + $object->fetch_projet(); + $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/')); @@ -2483,7 +2485,7 @@ if ($action == 'create' && $user->rights->commande->creer) { if (empty($object->ref_client)) { $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)'); } $formmail->withfile = 2; $formmail->withbody = 1; @@ -2493,6 +2495,8 @@ if ($action == 'create' && $user->rights->commande->creer) { $formmail->substit ['__ORDERREF__'] = $object->ref; $formmail->substit ['__SIGNATURE__'] = $user->signature; $formmail->substit ['__REFCLIENT__'] = $object->ref_client; + $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name; + $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); $formmail->substit ['__PERSONALIZED__'] = ''; $formmail->substit ['__CONTACTCIVNAME__'] = ''; @@ -2502,7 +2506,7 @@ if ($action == 'create' && $user->rights->commande->creer) { if (is_array($contactarr) && count($contactarr) > 0) { foreach ($contactarr as $contact) { - if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { + if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label $contactstatic = new Contact($db); $contactstatic->fetch($contact ['id']); $custcontact = $contactstatic->getFullName($langs, 1); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 989f7f46abd..de636bf5bdb 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3638,11 +3638,15 @@ if ($action == 'create') $somethingshown = $formactions->showactions($object, 'invoice', $socid); print ''; - } else { + } + else + { /* - * Affiche formulaire mail + * Action presend (or prerelance) */ + $object->fetch_projet(); + // By default if $action=='presend' $titreform = 'SendBillByMail'; $topicmail = 'SendBillRef'; @@ -3710,8 +3714,9 @@ if ($action == 'create') if (empty($object->ref_client)) { $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__'); } else if (! empty($object->ref_client)) { - $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)'); + $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__ (__REFCLIENT__)'); } + $formmail->withfile = 2; $formmail->withbody = 1; $formmail->withdeliveryreceipt = 1; @@ -3720,6 +3725,8 @@ if ($action == 'create') $formmail->substit ['__FACREF__'] = $object->ref; $formmail->substit ['__SIGNATURE__'] = $user->signature; $formmail->substit ['__REFCLIENT__'] = $object->ref_client; + $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name; + $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:''); $formmail->substit ['__PERSONALIZED__'] = ''; $formmail->substit ['__CONTACTCIVNAME__'] = ''; @@ -3730,7 +3737,7 @@ if ($action == 'create') if (is_array($contactarr) && count($contactarr) > 0) { foreach ($contactarr as $contact) { - if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) { + if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) { // TODO Use code and not label require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; From 83564b2b049863a0c33acf0b1a472529178bd839 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 02:43:50 +0200 Subject: [PATCH 407/502] Fix: Table holiday_user was not initialized anymore. --- htdocs/holiday/class/holiday.class.php | 61 ++++++++++++++++---------- htdocs/holiday/define_holiday.php | 7 ++- htdocs/holiday/fiche.php | 3 +- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 553555c47ab..fdc43fe8106 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -79,7 +79,7 @@ class Holiday extends CommonObject /** - * updateSold + * updateSold. Update sold and check table of users for holidays is complete. If not complete. * * @return int Return 1 */ @@ -986,25 +986,31 @@ class Holiday extends CommonObject */ function createCPusers($single=false,$userid='') { - // Si c'est l'ensemble des utilisateurs à ajoutés - if(!$single) + // Si c'est l'ensemble des utilisateurs à ajouter + if (! $single) { dol_syslog(get_class($this).'::createCPusers'); - foreach($this->fetchUsers(false,true) as $users) { + $arrayofusers = $this->fetchUsers(false,true); + + foreach($arrayofusers as $users) + { $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users"; $sql.= " (fk_user, nb_holiday)"; $sql.= " VALUES ('".$users['rowid']."','0')"; - $this->db->query($sql); + $resql=$this->db->query($sql); + if (! $resql) dol_print_error($this->db); } - } else { + } + else + { $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users"; $sql.= " (fk_user, nb_holiday)"; $sql.= " VALUES ('".$userid."','0')"; - $this->db->query($sql); + $resql=$this->db->query($sql); + if (! $resql) dol_print_error($this->db); } - } /** @@ -1051,7 +1057,7 @@ class Holiday extends CommonObject * uniquement pour vérifier si il existe de nouveau utilisateur * * @param boolean $liste si vrai retourne une liste, si faux retourne un array - * @param boolean $type si vrai retourne pour Dolibarr si faux retourne pour CP + * @param boolean $type si vrai retourne pour Dolibarr, si faux retourne pour CP * @return string retourne un tableau de tout les utilisateurs actifs */ function fetchUsers($liste=true,$type=true) @@ -1262,49 +1268,55 @@ class Holiday extends CommonObject function verifNbUsers($userDolibarrWithoutCP,$userCP) { if (empty($userCP)) $userCP=0; - dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarr.' userCP='.$userCP); + dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarrWithoutCP.' userCP='.$userCP); // On vérifie les users Dolibarr sans CP if ($userDolibarrWithoutCP > 0) { - $this->updateConfCP('nbUser',$userDolibarr); + $this->db->begin(); + + $this->updateConfCP('nbUser',$userDolibarrWithoutCP); $listUsersCP = $this->fetchUsers(true,false); // On séléctionne les utilisateurs qui ne sont pas déjà dans le module $sql = "SELECT u.rowid, u.lastname, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")"; - - $result = $this->db->query($sql); - - // Si pas d'erreur SQL - if($result) { + if ($listUsersCP != '') $sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")"; + $resql = $this->db->query($sql); + if ($resql) + { $i = 0; $num = $this->db->num_rows($resql); - while($i < $num) { - + while($i < $num) + { $obj = $this->db->fetch_object($resql); + $uid = $obj->rowid; // On ajoute l'utilisateur - $this->createCPusers(true,$obj->rowid); + //print "Add user rowid = ".$uid." into database holiday"; + + $result = $this->createCPusers(true,$uid); $i++; } - + $this->db->commit(); } else { // Erreur SQL $this->error="Error ".$this->db->lasterror(); + $this->db->rollback(); return -1; } } else { - // Si il y a moins d'utilisateur Dolibarr que dans le module CP + $this->db->begin(); - $this->updateConfCP('nbUser',$userDolibarr); + // Si il y a moins d'utilisateur Dolibarr que dans le module CP + + $this->updateConfCP('nbUser',$userDolibarrWithoutCP); $listUsersDolibarr = $this->fetchUsers(true,true); @@ -1331,10 +1343,11 @@ class Holiday extends CommonObject $i++; } - + $this->db->commit(); } else { // Erreur SQL $this->error="Error ".$this->db->lasterror(); + $this->db->rollback(); return -1; } } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 3c5fda7afd9..62e8fc698c9 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -43,14 +43,17 @@ $action=GETPOST('action'); */ $form = new Form($db); +$userstatic=new User($db); +$holiday = new Holiday($db); + llxHeader(array(),$langs->trans('CPTitreMenu')); print_fiche_titre($langs->trans('MenuConfCP')); -$holiday = new Holiday($db); +$holiday->updateSold(); // Create users into table holiday if they don't exists. TODO Remove if we use field into table user. + $listUsers = $holiday->fetchUsers(false,false); -$userstatic=new User($db); // Si il y a une action de mise à jour if ($action == 'update' && isset($_POST['update_cp'])) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 0092a6e25c9..9fc3e278ac5 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -761,8 +761,9 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; } else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); + //var_dump($cp->getConfCP('nbHolidayDeducted')); $nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted'); - print '   '.$langs->trans('SoldeCPUser', round($nb_holiday,0)).''; + print '   '.$langs->trans('SoldeCPUser', round($nb_holiday,2)).''; print ''; print ''; print ''; From 2bfde7ba309be2ff356b0ee1fd894bfe19f4aab7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 03:01:17 +0200 Subject: [PATCH 408/502] Add table llx_holiday_types to store type of leave. --- htdocs/holiday/admin/tomergewithholiday.php | 226 ++++++++++++++++++ htdocs/holiday/img/add.png | Bin 0 -> 3208 bytes htdocs/holiday/img/delete.png | Bin 0 -> 3350 bytes htdocs/holiday/img/edit.png | Bin 0 -> 3307 bytes .../install/mysql/migration/3.6.0-3.7.0.sql | 14 ++ .../mysql/tables/llx_holiday_types.sql | 30 +++ htdocs/theme/eldy/style.css.php | 35 +++ 7 files changed, 305 insertions(+) create mode 100755 htdocs/holiday/admin/tomergewithholiday.php create mode 100755 htdocs/holiday/img/add.png create mode 100755 htdocs/holiday/img/delete.png create mode 100755 htdocs/holiday/img/edit.png create mode 100755 htdocs/install/mysql/tables/llx_holiday_types.sql diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php new file mode 100755 index 00000000000..7ff795a455b --- /dev/null +++ b/htdocs/holiday/admin/tomergewithholiday.php @@ -0,0 +1,226 @@ + + * Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2012 Regis Houssin + * + * 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 . + */ + +/** + * Page module configuration paid holiday. + * + * \file holiday.php + * \ingroup holiday + * \brief Page module configuration paid holiday. + */ + +require '../../main.inc.php'; +require DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; +require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php'; +require_once DOL_DOCUMENT_ROOT. '/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php'; + +// Si pas administrateur +if (! $user->admin) accessforbidden(); + + +/* + * View + */ + +// Vérification si module activé +if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP'); + +llxheader('',$langs->trans('TitleAdminCP')); + +print_fiche_titre($langs->trans('MenuCPTypes')); + +echo '
'; + +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; +echo ''; + +$types = $db->query( + "SELECT * + FROM llx_congespayes_types + WHERE deleteAt IS NULL + ORDER BY label" +); + +while($type = $db->fetch_array($types)) +{ + echo' + + + + + + + + + + + + + '; +} + +echo ' + + + + + + +
' . $langs->trans('TypeLabel') . '' . $langs->trans('TypeDescription') . '' . $langs->trans('TypeAffect') . '' . $langs->trans('TypeDelay') . '' . $langs->trans('nbCongesDeductedCPMini') . '' . $langs->trans('nbCongesEveryMonthCPMini') . '
'.$type['label'].''.($type['description']?$type['description']:'N/A').' + '.($type['affect']?$langs->trans('TypeAffectYes'):$langs->trans('TypeAffectNo')).' + '.$type['delay'].''.$type['nbCongesDeducted'].''.$type['nbCongesEveryMonth'].' + + +
+ +
+ +'; + +echo '
'; + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/holiday/img/add.png b/htdocs/holiday/img/add.png new file mode 100755 index 0000000000000000000000000000000000000000..d15cb50d8357f798867c21d9adf994fed6cfb45e GIT binary patch literal 3208 zcmc&%O>7%Q6m|(pt5j7hp@LefcGw^;#NNNyu@^h7<8>MX3Bhqmj$Q9g>>=x2cXpgO z5r|SGprSXBDj_OG;sUCuIB-EAS~wtDQ8<89Xc2G+sfDUYl>qa0*WRoX7YYawB~E7M zz4v|Z%{Ol*$ET+bZX4J=5Q#*#6(-ao{NCaIZ0U#3eb-xBB(n7oDb2CD$ww94uEjLN zF5_6UR)_USB)z{`*YpL+-R3JbNGYvIsrsXKj4ClpF;BR-D=a6T@7BXDc1w?a`(A|_G$iyIw4X==j8x2w5ta7KhQj zcyjX3&1l|)XXrdOaScoz zASrf10?8t&RGAaF^@OFKjqe%MSWz{Ga}>iTNKz6+Au5RQ?eST&0tl>ms7GNclUb!Jn~HoQej!D84nVX>i^2eIXDYn^~;g=&6e z$W569y&D?ST&f|Ca!C>uSyn{(K|xdm!He!~7=(40X6d+~W;mFM5n?EER?gP-$Xm=06JK9we0RDw4N7HqF^^+H_X1=56mVb=#1vL34yHXSivqRT|i<2HI#d zt=k4vQA`N!iuJI`F$!^VD_F0hBCa>eCeeGw%hxnw&e{~3(1LcLhcMO$KSbN+J%q&j zsrx%PK^zdwvNz>7mKl7+ANfO*ctt?SJ8%jV#*>?)En>sx+F2q!#Bf`?2^--DU#enI za&S1Lk_f6xDWVt>USOR1M%BAenAn}5$}1_1LIp)Jk7gTP)9jwextV1hOYRHF(kFD z$-1THUR;U^`wHzOYC!L6n2a0s&LvsIaP8J=w&kEKW0aH|-rYB4TTyo&Q=MognzE6K zDOuDQI5<8ple95CmL1SE-%ZJ7sJji?rXh-*oB~meW=-7GECW;Y2yx)9SnLJTaq~dJ zQC$>c?dlF8b$A6xy^B$*5(mLIt71fSxcuj-T|>~*Lw5ztVSm*@4rVdbi(&`Qqqv@u zOVeqTpM)DDL~%^3_@hp17}p3!b|vz?=SC#SM)BHpJOxjJX_Kzj`$DWLJg`=#G0{unKe~4HyZsm5Up;f?_kE}DAJikC zG!8s+=h0^06Zaf_@$56La{RZ?PCaz5X71d%v;VdJUvFN2VRh!nn;+IUefss>*f*OV ze!aPQPk*skye2e%`El3aeV5Sb%CXe;=kxjejh{&Wg)4)nH(z;RXy`=z?r%SMdh61* zSp3WFs&Ve(#kX2Fez^3~fy;YO?tc3&cuu!oKK07+8+XLco!ImF>QhJR( zlO9pldw?gGOyPN#E6|iniBcaxL=T87S_66Uz+sY5bxFr9b3=VK1{GQ%~7-Fd`PBDJJpQ2fcW!>1qZS-qM%(*pVjtOC7gn%JIC504SBTP)OM^B>$lEm{w z9z2!Mk!~dPRFOh6@>#?Aql(iMCHg0YGXY*vT1l~a5430OSyRrmEtUm>)C@}Oilt4HGG&IKOi3nh0{Eq9Kr5V~yGx%j$IhTl!Xb7k(=1Pm| zBA}Veno=-x9Evt3j*V}{^)8D@G*KOJ-Wbd9UN6shAEFtarY&@9!T2X|tcoV8AzezF zIg5lENIc__6`AK)Ce-5h205n17YZ|sKP)u+>5z~1aYBo~R&c=Fq*R zsK0@1hhjVptT2f2Htmuw<18}ubUtHcY=Q`4oZtYE5=0cF(mkpomBkAuMMdq@A#Or_ z;v;2BVk~$E%$t`fAZUnJj?NQjHB?1#!^Dm;%41bW}i0emb4?wH^`e4 z9&BbgMxec+X1jU?Kkn<^FfA}_owvCqR2up?;dsX|4A%bN3;)-`FImnp!pm;;8_0No zGLN7_Ve5_pHQC(4nDOjF)O?G@(mj3mc)a*fLA!?NI^AqID9P#Papi z+Cg4WTCCXe35X>WgTOD8$OqmF^(2AYxZ_~Bo)*K*i-#yDvA}0Z94pC`DVb-94jmE; zYg&}pD5xMOYBGStV~T;#%1k+?f}6$UL^WCL1JXfK&{ZTUp9iZyD;a>VU&*Ad8H9ik zRC?0Z9jHy$+~#utB}G(;Hk}9osANQh9gK1k3#67rha|HxMy(^9?=ZwThyj>1{y$>> zPMsa1<5q|z+t2WA6JKU z2ZiOCuV-%cwVyibnK;?A{KG}QW!qm{_h8fEM=NS_{OkRfd#`*}s^eA8O;;|QnxLM(O+>t-l%sV)AnwxuPb=SK4BiobT zt@)*!nmjt=#Y?WA77mTLK0kILbKvO8lloq6+o4};&R<>qUh>IzPo4+_mQ4AwcJArw z?12-XlAAVz>HCh~G7OdtuI+|f&dMD14e|DsJuBYt%w?|~suD>N9qXV}lwkfkt z`syz1y5JgpW5LfGhjyPcb`9TkdVRM_kYRc*S#VZb!5Eb0!jQ3+-<1e(oN28Bd_fD%F`8VQLCghcoQDvH67D3Ayaeux3VbMI}-?N*h9#JF^A z&pq$^JkR@{_q^xy<&O5JXVlHEb2uC`5=&w!^7*jwKji`PKKI&f!Qq&;0;M}~XL2bo zsyUY+sXfqD%;m|v!x30i%nM>4#GnUekP@V>e0qoiND5LbJxL~+kHRckGNi%fL+xpC zs894u)S^&bpvV(|9K-@B=43_Zi$Ti7<;i#BF--x}1os80ut5kqlN}(cY7jKLI2Y#> znHD$jxLs}!*TOX~035^kXvRys87J%GS&nCYp!7$D>Oeq~dihkWwM0ioK`M)Jo~P-7 zfdSWm+oft5n)UnrG{eyx=Oh+ReNe$d(W&T-284wXgSx1pJVvSl3{0U%E#M$Uk$F%8 z&u3Mv>RB~kp-}Wv)=2*7$~4Wo7~1Zb$YZgYyFpoB_+=zkqzH0M6$?hr z60smfW?T}Ic%PT!VyrvrV_UtkILrFu;fSA!c^R)S-0E)*+hFd|J)!7WP()Z}M})n_ z&v==b+Z*<_`V4j-$42AL5iaVDyIY6|b0dL3Rg%n1s#;VfyG_IirB^jKQ?(5WOIj4+ z!64P437G;k!vGU)Iz&|>S!7$7QpRf7M6pJ2qC-&3f)vabdSoQl#Ea(yB(GF8(uDei z#WhM|JopN&WL~3$XrqUKfVF~4kWT7v(0pVymgR7*HL`{>GLry+x#4({7_)kHp&v?? z*76jpu?%-r1VoJmK9GfEV^r#xOS25m`FIa&E4+%am=%X8}^gF?v68Imh-qHt+DFRCkQ7yhGluK<-ZsHuZ3T=oa2Po-0F9c@c?Zc zLFLK`&=YGbAc;Iiq?6eyEiB{eN;A$aUM9;*x`Z*S zj7q4cj52J1uHrNl=!Kp&qzT$IM1)MWhL8bW4O`v_p-RiFp0`G2B$L)oWDrYtPHP)^ zS!tzWYbPL`MLHlaoGk_3tEo9a+PLjtxRVy$$cqcql33<5C61S5$P|sUMAd8(%WGPZ z7z)dwvV8lyy}|YUjc1&!``g>sKzPDmn;btf8KQ zc?W7&6{qnWY9bP3(5`|Q)KI^GiGyBCVwu#GXp>|##*}%4^DA^A1Jh8;>Hi)qR7eBW$W3^ozO9YiqG#cFCtj}h;sHT}4(r03$dN3h zpdbydJq7~~$D{>`SU6og^X8VWH5(S!zvSMz_f}x)aPu&jGJF}dU3i3Bc=5qAO`|U^ zI6Pq9)|vWG7kuXjM)fPxzsqd`Q|dpXj*fhNl6~#`v==#@K62FY(Af8dvri;8AMcv{P2rc{9^3!UwuY568jgIje(cxDLtpwDmVVLn?Sb4b zw0+a0Ef<3$%YJwT?)*{ee*X0S?l$&pD~8?Me@-2Kbn@-D-@QHi@r`5C8+M~-j%t>>vUw;*@Up=Cae)!bEt*5h&j}Faqd=+w!?&%vE5H~-$E^>CMe0kmRWYaLf oH*x&WW08e#ocdi6Z%$<#yV}=!#@^cJG=8Hb;_b0Lk?!HY0BngN5C8xG literal 0 HcmV?d00001 diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index e8a62f9d05d..54aea6de52d 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -945,3 +945,17 @@ create table llx_c_email_templates UPDATE llx_c_regions SET rowid = 0 where rowid = 1; DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0; ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); + + +CREATE TABLE llx_holiday_types ( + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + label varchar(45) NOT NULL, + description varchar(255) NOT NULL, + affect int(1) NOT NULL, + delay int(1) NOT NULL, + insertAt DATETIME NOT NULL, + updateAt DATETIME, + deleteAt DATETIME, + nbCongesDeducted varchar(255) NOT NULL, + nbCongesEveryMonth varchar(255) NOT NULL +); diff --git a/htdocs/install/mysql/tables/llx_holiday_types.sql b/htdocs/install/mysql/tables/llx_holiday_types.sql new file mode 100755 index 00000000000..4fa2c5e387f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_holiday_types.sql @@ -0,0 +1,30 @@ +-- =================================================================== +-- Copyright (C) 2014 Laurent Destailleur +-- +-- 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 . +-- +-- =================================================================== + +CREATE TABLE llx_holiday_types ( + rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, + label varchar(45) NOT NULL, + description varchar(255) NOT NULL, + affect int(1) NOT NULL, + delay int(1) NOT NULL, + insertAt DATETIME NOT NULL, + updateAt DATETIME, + deleteAt DATETIME, + nbCongesDeducted varchar(255) NOT NULL, + nbCongesEveryMonth varchar(255) NOT NULL +); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 319a58131ab..76a6a43f9bb 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2564,6 +2564,41 @@ a.cke_dialog_ui_button } +/* ============================================================================== */ +/* Holiday */ +/* ============================================================================== */ + +#types .btn { + cursor: pointer; +} + +#types .btn-primary { + font-weight: bold; +} + +#types form { + padding: 20px; +} + +#types label { + display:inline-block; + width:100px; + margin-right: 20px; + padding: 4px; + text-align: right; + vertical-align: top; +} + +#types input.text, #types textarea { + width: 400px; +} + +#types textarea { + height: 100px; +} + + + /* ============================================================================== */ /* JSGantt */ /* ============================================================================== */ From bbb58dd365c65a9aefb1b2eeb178bd084e220ce7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 03:09:59 +0200 Subject: [PATCH 409/502] New: Add navigation on year on page of leaves. --- htdocs/holiday/view_log.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index dba8969adca..5f18a524acc 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -26,6 +26,7 @@ require('../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Protection if external user if ($user->societe_id > 0) accessforbidden(); @@ -33,6 +34,12 @@ if ($user->societe_id > 0) accessforbidden(); // Si l'utilisateur n'a pas le droit de lire cette page if(!$user->rights->holiday->view_log) accessforbidden(); +$year=GETPOST('year'); +if (empty($year)) +{ + $tmpdate=dol_getdate(dol_now()); + $year=$tmpdate['year']; +} /* @@ -41,14 +48,14 @@ if(!$user->rights->holiday->view_log) accessforbidden(); $langs->load('users'); -llxHeader(array(),$langs->trans('CPTitreMenu')); +llxHeader(array(),$langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')'); $cp = new Holiday($db); // Recent changes are more important than old changes -$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC',''); +$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year,1,1))."' AND '".$db->idate(dol_get_last_day($year,12,1))."'"); // Load $cp->logs -print_fiche_titre($langs->trans('LogCP')); +print_fiche_titre($langs->trans('LogCP'),''.img_previous().' '.$langs->trans("Year").':'.$year.' '.img_next().''); print ''; print ''; From 4bd257f00780ea78365d8200000546404f9e1c0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 03:23:16 +0200 Subject: [PATCH 410/502] New: Work on type of leave. --- htdocs/holiday/class/holiday.class.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index fdc43fe8106..aac5464fea5 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1733,6 +1733,30 @@ class Holiday extends CommonObject } } + + /** + * Tous les types + * + * @return boolean Return array with list of types + */ + function getTypes() + { + $result = $this->db->query("SELECT rowid, type, affect FROM " . MAIN_DB_PREFIX . "holiday_types"); + $num = $this->db->num_rows($result); + if ($num) + { + while ($obj = $this->db->fetch_object($result)) + { + $types[] = array('rowid'=> $obj->rowid, 'type'=> $obj->type, 'affect'=>$obj->affect); + } + + return $types; + } + + return array(); + } + + /** * Initialise an instance with random values. * Used to build previews or test instances. From 2169a8668db04c5663f26ec0d58d19b7d3361473 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 09:18:44 +0200 Subject: [PATCH 411/502] Fix: PHPCS --- htdocs/holiday/admin/tomergewithholiday.php | 1 - htdocs/holiday/define_congespayes.php | 126 ++++++++++++++++++ .../mysql/tables/llx_holiday_types.sql | 4 +- 3 files changed, 128 insertions(+), 3 deletions(-) create mode 100755 htdocs/holiday/define_congespayes.php diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php index 7ff795a455b..c301e1ba348 100755 --- a/htdocs/holiday/admin/tomergewithholiday.php +++ b/htdocs/holiday/admin/tomergewithholiday.php @@ -223,4 +223,3 @@ echo ''; llxFooter(); $db->close(); -?> \ No newline at end of file diff --git a/htdocs/holiday/define_congespayes.php b/htdocs/holiday/define_congespayes.php new file mode 100755 index 00000000000..cd3b818b208 --- /dev/null +++ b/htdocs/holiday/define_congespayes.php @@ -0,0 +1,126 @@ + + * Copyright (C) 2011 Dimitri Mouillard + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file define_congespayes.php + * \ingroup congespayes + * \brief File that defines the balance of paid leave of users. + * \version $Id: define_congespayes.php,v 1.00 2011/09/15 11:00:00 dmouillard Exp $ + * \author dmouillard@teclib.com + * \remarks File that defines the balance of paid leave of users. + */ + +require('../main.inc.php'); +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; + +// Protection if external user +if ($user->societe_id > 0) accessforbidden(); + +// If the user does not have perm to read the page +if(!$user->rights->holiday->define_holiday) accessforbidden(); + + +/* + * View + */ + +llxHeader(array(),$langs->trans('CPTitreMenu')); + + +print_fiche_titre($langs->trans('MenuConfCP')); + +$congespayes = new Holidays($db); +$listUsers = $congespayes->fetchUsers(false, true); + +// Si il y a une action de mise à jour +if (isset($_POST['action']) && $_POST['action'] == 'update') { + + $fk_type = $_POST['fk_type']; + + foreach ($_POST['nb_conges'] as $user_id => $compteur) { + if (!empty($compteur)) { + $userValue = str_replace(',', '.', $compteur); + $userValue = number_format($userValue, 2, '.', ''); + } else { + $userValue = '0.00'; + } + $congespayes->updateSoldeCP($user_id,$userValue,$fk_type); + } + + print '
'; + print $langs->trans('UpdateConfCPOK'); + print '
'; + +} + +$var = true; +$i = 0; + +foreach($congespayes->getTypes() as $type) +{ + if($type['affect']==1) + { + print '
'; + + print '

'.$type['label'].'

'; + + print '
' . "\n"; + print ''; + print ''; + + print '
'; + print ""; + print ''; + print ''; + print ''; + + foreach ($listUsers as $users) { + $var = !$var; + print ''; + print ''; + print '' . "\n"; + print ''; + + $i++; + } + + echo ""; + print ''; + echo ""; + + print '
' . $langs->trans('Employee') . '' . $langs->trans('Counter') . '
' . $users['name'] . ' ' . $users['firstname'] . ''; + print ''; + print ' jours
'; + print ''; + + print ''; + } +} + +// Fin de page +$db->close(); +llxFooter(); +?> diff --git a/htdocs/install/mysql/tables/llx_holiday_types.sql b/htdocs/install/mysql/tables/llx_holiday_types.sql index 4fa2c5e387f..242483b5974 100755 --- a/htdocs/install/mysql/tables/llx_holiday_types.sql +++ b/htdocs/install/mysql/tables/llx_holiday_types.sql @@ -20,8 +20,8 @@ CREATE TABLE llx_holiday_types ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, label varchar(45) NOT NULL, description varchar(255) NOT NULL, - affect int(1) NOT NULL, - delay int(1) NOT NULL, + affect integer NOT NULL, + delay integer NOT NULL, insertAt DATETIME NOT NULL, updateAt DATETIME, deleteAt DATETIME, From cffc92a5c0af09f33a55e753f002d2e48055fee0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Aug 2014 09:46:09 +0200 Subject: [PATCH 412/502] Fix: PHPCS --- .../{define_congespayes.php => tomergewithdefine_holiday.php} | 1 - 1 file changed, 1 deletion(-) rename htdocs/holiday/{define_congespayes.php => tomergewithdefine_holiday.php} (99%) diff --git a/htdocs/holiday/define_congespayes.php b/htdocs/holiday/tomergewithdefine_holiday.php similarity index 99% rename from htdocs/holiday/define_congespayes.php rename to htdocs/holiday/tomergewithdefine_holiday.php index cd3b818b208..4bf904528a0 100755 --- a/htdocs/holiday/define_congespayes.php +++ b/htdocs/holiday/tomergewithdefine_holiday.php @@ -123,4 +123,3 @@ foreach($congespayes->getTypes() as $type) // Fin de page $db->close(); llxFooter(); -?> From 3622b472dd5f520948b4fb2b9b8b2a8743eaf0ca Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 Aug 2014 09:57:20 +0200 Subject: [PATCH 413/502] Changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index c21bd2f76f4..44e2d0a7f38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,7 @@ For users: Use label into quick search form. Use accesskey on form search. - New: Intervention documents are now available in ECM module +- New: Add attachments on user card + in ECM module - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem From cfe35f32e8ffd717ce678ac21ca9b5bc932b7578 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 6 Aug 2014 15:59:36 +0200 Subject: [PATCH 414/502] - Add improvement to GETPOST function - Review thirdparty cards for illustration of new GETPOST functionality --- htdocs/core/lib/functions.lib.php | 56 ++++---- htdocs/societe/soc.php | 204 +++++++++++++++--------------- 2 files changed, 133 insertions(+), 127 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7097bd2abae..841b1d6c6d5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11,7 +11,8 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2014 Marcos García - * + * Copyright (C) 2014 Cédric GROSS + * * 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 @@ -169,11 +170,11 @@ function dol_shutdown() * Return value of a param into GET or POST supervariable * * @param string $paramname Name of parameter to found - * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array) + * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @return string||string[] Value found, or '' if check fails */ -function GETPOST($paramname,$check='',$method=0) +function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) { if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; @@ -184,28 +185,33 @@ function GETPOST($paramname,$check='',$method=0) if (! empty($check)) { - // Check if numeric - if ($check == 'int' && ! is_numeric($out)) $out=''; - // Check if alpha - elseif ($check == 'alpha') - { - $out=trim($out); - // '"' is dangerous because param in url can close the href= or src= and add javascript functions. - // '../' is dangerous because it allows dir transversals - if (preg_match('/"/',$out)) $out=''; - else if (preg_match('/\.\.\//',$out)) $out=''; - } - elseif ($check == 'aZ') - { - $out=trim($out); - // '"' is dangerous because param in url can close the href= or src= and add javascript functions. - // '../' is dangerous because it allows dir transversals - if (preg_match('/[^a-z]+/i',$out)) $out=''; - } - elseif ($check == 'array') - { - if (! is_array($out) || empty($out)) $out=array(); - } + switch ($check) + { + case 'int': + if (! is_numeric($out)) { $out=''; } + break; + case 'alpha': + $out=trim($out); + // '"' is dangerous because param in url can close the href= or src= and add javascript functions. + // '../' is dangerous because it allows dir transversals + if (preg_match('/"/',$out)) $out=''; + else if (preg_match('/\.\.\//',$out)) $out=''; + break; + case 'san_alpha': + $out=filter_var($out,FILTER_SANITIZE_STRING); + break; + case 'aZ': + $out=trim($out); + if (preg_match('/[^a-z]+/i',$out)) $out=''; + break; + case 'array': + if (! is_array($out) || empty($out)) $out=array(); + break; + case 'custom': + if (empty($filter)) return 'BadFourthParameterForGETPOST'; + $out=filter_var($out, $filter, $options); + break; + } } return $out; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index cc4a6018d73..f752b149bd4 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -136,64 +136,64 @@ if (empty($reshook)) { $object->particulier = GETPOST("private"); - $object->name = dolGetFirstLastname(GETPOST('firstname'),GETPOST('nom')?GETPOST('nom'):GETPOST('name')); - $object->civility_id = GETPOST('civility_id'); + $object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha')); + $object->civility_id = GETPOST('civility_id', 'int'); // Add non official properties - $object->name_bis = GETPOST('name')?GETPOST('name'):GETPOST('nom'); - $object->firstname = GETPOST('firstname'); + $object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha'); + $object->firstname = GETPOST('firstname','san_alpha'); } else { - $object->name = GETPOST('name')?GETPOST('name'):GETPOST('nom'); + $object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha'); } - $object->address = GETPOST('address'); - $object->zip = GETPOST('zipcode'); - $object->town = GETPOST('town'); - $object->country_id = GETPOST('country_id'); - $object->state_id = GETPOST('state_id'); - $object->skype = GETPOST('skype'); - $object->phone = GETPOST('phone'); - $object->fax = GETPOST('fax'); - $object->email = GETPOST('email'); - $object->url = GETPOST('url'); - $object->idprof1 = GETPOST('idprof1'); - $object->idprof2 = GETPOST('idprof2'); - $object->idprof3 = GETPOST('idprof3'); - $object->idprof4 = GETPOST('idprof4'); - $object->idprof5 = GETPOST('idprof5'); - $object->idprof6 = GETPOST('idprof6'); - $object->prefix_comm = GETPOST('prefix_comm'); - $object->code_client = GETPOST('code_client'); - $object->code_fournisseur = GETPOST('code_fournisseur'); - $object->capital = GETPOST('capital'); - $object->barcode = GETPOST('barcode'); + $object->address = GETPOST('address', 'san_alpha'); + $object->zip = GETPOST('zipcode', 'san_alpha'); + $object->town = GETPOST('town', 'san_alpha'); + $object->country_id = GETPOST('country_id', 'int'); + $object->state_id = GETPOST('state_id', 'int'); + $object->skype = GETPOST('skype', 'san_alpha'); + $object->phone = GETPOST('phone', 'san_alpha'); + $object->fax = GETPOST('fax','san_alpha'); + $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); + $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); + $object->idprof1 = GETPOST('idprof1', 'san_alpha'); + $object->idprof2 = GETPOST('idprof2', 'san_alpha'); + $object->idprof3 = GETPOST('idprof3', 'san_alpha'); + $object->idprof4 = GETPOST('idprof4', 'san_alpha'); + $object->idprof5 = GETPOST('idprof5', 'san_alpha'); + $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); + $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); + $object->capital = GETPOST('capital', 'san_alpha'); + $object->barcode = GETPOST('barcode', 'san_alpha'); - $object->tva_intra = GETPOST('tva_intra'); - $object->tva_assuj = GETPOST('assujtva_value'); - $object->status = GETPOST('status'); + $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->tva_assuj = GETPOST('assujtva_value', 'san_alpha'); + $object->status = GETPOST('status', 'san_alpha'); // Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha'); - $object->localtax1_value = GETPOST('lt1'); - $object->localtax2_value = GETPOST('lt2'); + $object->localtax1_value = GETPOST('lt1', 'san_alpha'); + $object->localtax2_value = GETPOST('lt2', 'san_alpha'); - $object->forme_juridique_code = GETPOST('forme_juridique_code'); - $object->effectif_id = GETPOST('effectif_id'); + $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); + $object->effectif_id = GETPOST('effectif_id', 'int'); if (GETPOST("private") == 1) { $object->typent_id = dol_getIdFromCode($db,'TE_PRIVATE','c_typent'); } else { - $object->typent_id = GETPOST('typent_id'); + $object->typent_id = GETPOST('typent_id', 'int'); } - $object->client = GETPOST('client'); - $object->fournisseur = GETPOST('fournisseur'); + $object->client = GETPOST('client', 'int'); + $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->commercial_id = GETPOST('commercial_id'); + $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); // Fill array 'array_options' with data from add form @@ -645,48 +645,48 @@ else if (GETPOST("type")=='p') { $object->client=2; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } - $object->name = GETPOST('nom'); - $object->firstname = GETPOST('firstname'); + $object->name = GETPOST('nom', 'san_alpha'); + $object->firstname = GETPOST('firstname', 'san_alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm'); $object->client = GETPOST('client')?GETPOST('client'):$object->client; - $object->code_client = GETPOST('code_client'); + $object->code_client = GETPOST('code_client', 'san_alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; - $object->code_fournisseur = GETPOST('code_fournisseur'); - $object->address = GETPOST('address'); - $object->zip = GETPOST('zipcode'); - $object->town = GETPOST('town'); - $object->state_id = GETPOST('state_id'); - $object->skype = GETPOST('skype'); - $object->phone = GETPOST('phone'); - $object->fax = GETPOST('fax'); - $object->email = GETPOST('email'); - $object->url = GETPOST('url'); - $object->capital = GETPOST('capital'); - $object->barcode = GETPOST('barcode'); - $object->idprof1 = GETPOST('idprof1'); - $object->idprof2 = GETPOST('idprof2'); - $object->idprof3 = GETPOST('idprof3'); - $object->idprof4 = GETPOST('idprof4'); - $object->idprof5 = GETPOST('idprof5'); - $object->idprof6 = GETPOST('idprof6'); - $object->typent_id = GETPOST('typent_id'); - $object->effectif_id = GETPOST('effectif_id'); - $object->civility_id = GETPOST('civility_id'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); + $object->address = GETPOST('address', 'san_alpha'); + $object->zip = GETPOST('zipcode', 'san_alpha'); + $object->town = GETPOST('town', 'san_alpha'); + $object->state_id = GETPOST('state_id', 'int'); + $object->skype = GETPOST('skype', 'san_alpha'); + $object->phone = GETPOST('phone', 'san_alpha'); + $object->fax = GETPOST('fax', 'san_alpha'); + $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); + $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); + $object->capital = GETPOST('capital', 'int'); + $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->idprof1 = GETPOST('idprof1', 'san_alpha'); + $object->idprof2 = GETPOST('idprof2', 'san_alpha'); + $object->idprof3 = GETPOST('idprof3', 'san_alpha'); + $object->idprof4 = GETPOST('idprof4', 'san_alpha'); + $object->idprof5 = GETPOST('idprof5', 'san_alpha'); + $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->typent_id = GETPOST('typent_id', 'int'); + $object->effectif_id = GETPOST('effectif_id', 'int'); + $object->civility_id = GETPOST('civility_id', 'int'); - $object->tva_assuj = GETPOST('assujtva_value'); - $object->status = GETPOST('status'); + $object->tva_assuj = GETPOST('assujtva_value', 'int'); + $object->status = GETPOST('status', 'int'); //Local Taxes - $object->localtax1_assuj = GETPOST('localtax1assuj_value'); - $object->localtax2_assuj = GETPOST('localtax2assuj_value'); + $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'int'); + $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'int'); - $object->localtax1_value =GETPOST('lt1'); - $object->localtax2_value =GETPOST('lt2'); + $object->localtax1_value =GETPOST('lt1', 'int'); + $object->localtax2_value =GETPOST('lt2', 'int'); - $object->tva_intra = GETPOST('tva_intra'); + $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); - $object->commercial_id = GETPOST('commercial_id'); + $object->commercial_id = GETPOST('commercial_id', 'int'); $object->default_lang = GETPOST('default_lang'); $object->logo = (isset($_FILES['photo'])?dol_sanitizeFileName($_FILES['photo']['name']):''); @@ -1154,38 +1154,38 @@ else if (GETPOST('nom')) { // We overwrite with values if posted - $object->name = GETPOST('nom'); - $object->prefix_comm = GETPOST('prefix_comm'); - $object->client = GETPOST('client'); - $object->code_client = GETPOST('code_client'); - $object->fournisseur = GETPOST('fournisseur'); - $object->code_fournisseur = GETPOST('code_fournisseur'); - $object->address = GETPOST('address'); - $object->zip = GETPOST('zipcode'); - $object->town = GETPOST('town'); - $object->country_id = GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id; - $object->state_id = GETPOST('state_id'); - $object->skype = GETPOST('skype'); - $object->phone = GETPOST('phone'); - $object->fax = GETPOST('fax'); - $object->email = GETPOST('email'); - $object->url = GETPOST('url'); - $object->capital = GETPOST('capital'); - $object->idprof1 = GETPOST('idprof1'); - $object->idprof2 = GETPOST('idprof2'); - $object->idprof3 = GETPOST('idprof3'); - $object->idprof4 = GETPOST('idprof4'); - $object->idprof5 = GETPOST('idprof5'); - $object->idprof6 = GETPOST('idprof6'); - $object->typent_id = GETPOST('typent_id'); - $object->effectif_id = GETPOST('effectif_id'); - $object->barcode = GETPOST('barcode'); - $object->forme_juridique_code = GETPOST('forme_juridique_code'); - $object->default_lang = GETPOST('default_lang'); + $object->name = GETPOST('nom', 'san_alpha'); + $object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); + $object->client = GETPOST('client', 'int'); + $object->code_client = GETPOST('code_client', 'san_alpha'); + $object->fournisseur = GETPOST('fournisseur', 'int'); + $object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); + $object->address = GETPOST('address', 'san_alpha'); + $object->zip = GETPOST('zipcode', 'san_alpha'); + $object->town = GETPOST('town', 'san_alpha'); + $object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id; + $object->state_id = GETPOST('state_id', 'int'); + $object->skype = GETPOST('skype', 'san_alpha'); + $object->phone = GETPOST('phone', 'san_alpha'); + $object->fax = GETPOST('fax', 'san_alpha'); + $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); + $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); + $object->capital = GETPOST('capital', 'int'); + $object->idprof1 = GETPOST('idprof1', 'san_alpha'); + $object->idprof2 = GETPOST('idprof2', 'san_alpha'); + $object->idprof3 = GETPOST('idprof3', 'san_alpha'); + $object->idprof4 = GETPOST('idprof4', 'san_alpha'); + $object->idprof5 = GETPOST('idprof5', 'san_alpha'); + $object->idprof6 = GETPOST('idprof6', 'san_alpha'); + $object->typent_id = GETPOST('typent_id', 'int'); + $object->effectif_id = GETPOST('effectif_id', 'int'); + $object->barcode = GETPOST('barcode', 'san_alpha'); + $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); + $object->default_lang = GETPOST('default_lang', 'san_alpha'); - $object->tva_assuj = GETPOST('assujtva_value'); - $object->tva_intra = GETPOST('tva_intra'); - $object->status = GETPOST('status'); + $object->tva_assuj = GETPOST('assujtva_value', 'int'); + $object->tva_intra = GETPOST('tva_intra', 'san_alpha'); + $object->status = GETPOST('status', 'int'); //Local Taxes $object->localtax1_assuj = GETPOST('localtax1assuj_value'); From 180cc0b2001f4b0f798fd7e99ae501ada6aca427 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 6 Aug 2014 17:12:28 +0200 Subject: [PATCH 415/502] Add description for new param --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 841b1d6c6d5..acecdea3675 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -172,6 +172,8 @@ function dol_shutdown() * @param string $paramname Name of parameter to found * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) + * @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails) + * @param mixed $options Options to pass to filter_var when $check is set to custom * @return string||string[] Value found, or '' if check fails */ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL) From c94c0699d86aa8e83d45f1021199f00aba743fcb Mon Sep 17 00:00:00 2001 From: KreizIT Date: Wed, 6 Aug 2014 17:33:59 +0200 Subject: [PATCH 416/502] =?UTF-8?q?Fix=20:=20=20[=20bug=20#1549=20]=20It?= =?UTF-8?q?=C3=AFs=20not=20possible=20add=20ExtraFields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/admin/adherent_extrafields.php | 2 +- htdocs/adherents/admin/adherent_type_extrafields.php | 2 +- htdocs/admin/agenda_extrafields.php | 2 +- htdocs/admin/order_extrafields.php | 2 +- htdocs/admin/orderdet_extrafields.php | 2 +- htdocs/admin/supplierinvoice_extrafields.php | 2 +- htdocs/admin/supplierorder_extrafields.php | 2 +- htdocs/categories/admin/categorie_extrafields.php | 2 +- htdocs/comm/admin/propal_extrafields.php | 2 +- htdocs/comm/admin/propaldet_extrafields.php | 2 +- htdocs/compta/facture/admin/facture_cust_extrafields.php | 2 +- htdocs/compta/facture/admin/facturedet_cust_extrafields.php | 2 +- htdocs/contrat/admin/contract_extrafields.php | 2 +- htdocs/fichinter/admin/fichinter_extrafields.php | 2 +- htdocs/product/admin/product_extrafields.php | 2 +- htdocs/projet/admin/project_extrafields.php | 2 +- htdocs/projet/admin/project_task_extrafields.php | 2 +- htdocs/societe/admin/contact_extrafields.php | 2 +- htdocs/societe/admin/societe_extrafields.php | 2 +- htdocs/user/admin/user_extrafields.php | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 059e42d50f5..1c98c2c16ba 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -35,7 +35,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index dca8796b681..b2f839e3c3c 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 2ba8f3d839c..c5f7d808302 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -41,7 +41,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 1169c699203..90ceed434c2 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -42,7 +42,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 794cc1b890a..8f1dfb80538 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -43,7 +43,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 85131440646..ba584bdae8c 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -44,7 +44,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 9cb2dc65880..4a2671942fa 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -42,7 +42,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 6f8369afc89..2da54e77712 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -35,7 +35,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 434d2fc1972..d41dd27b362 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index c9c28105466..e83f31e993f 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -43,7 +43,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index 6da617b740c..4f5d2ba1bcf 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -37,7 +37,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index ccd208c7c6f..9c1240a28c9 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -38,7 +38,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 227ef23f741..afb86224151 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -39,7 +39,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 23c39533e19..cab0886f5ff 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -39,7 +39,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 58b4624f5bc..ed4ac4d2921 100644 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -37,7 +37,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index 5707c6be640..f4dde012d96 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/projet/admin/project_task_extrafields.php b/htdocs/projet/admin/project_task_extrafields.php index 9b9da25e24f..902b86df3b7 100644 --- a/htdocs/projet/admin/project_task_extrafields.php +++ b/htdocs/projet/admin/project_task_extrafields.php @@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index c4712817955..9bb756ac7ee 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -35,7 +35,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 5ca23df284a..b6485e0d489 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -36,7 +36,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index edabfd53256..7caa42b08ea 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -35,7 +35,7 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$tmptype2label=ExtraFields::$type2label; $type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); From 96b49cfabeff693b701b8d043f2d829498e04587 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 11:08:36 +0200 Subject: [PATCH 417/502] Fix: When disabled, all fields must be disabled. Need backport. --- htdocs/core/class/html.form.class.php | 2 +- htdocs/projet/activity/list.php | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2180de2893d..bad36b32e2e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3899,7 +3899,7 @@ class Form } elseif ($typehour=='text') { - print ''; + print ''; } print $langs->trans('Hours'); diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index a88dbf8b0fb..719d178d0ce 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -114,8 +114,6 @@ $title=$langs->trans("TimeSpent"); if ($mine) $title=$langs->trans("MyTimeSpent"); -llxHeader("",$title,""); - //$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project @@ -129,8 +127,18 @@ $tasksarray=$taskstatic->getTasksArray(0,0,($project->id?$project->id:$projectsL $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($user,0,($project->id?$project->id:$projectsListId),0); $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$project->id:$projectsListId),0); + +llxHeader("",$title,""); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); +// Filter on user +dol_fiche_head(''); +print ''; +print ''; +print '
'.$langs->trans("User").''.$user->getLoginUrl(1).'
'; +dol_fiche_end(); + print '
'; print ''; print ''; @@ -148,8 +156,15 @@ print ''.$langs->trans("Progress").''; print ''.$langs->trans("TimeSpent").''; print ''.$langs->trans("AddDuration").''; print "\n"; -projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine); +if (count($tasksarray) > 0) +{ + projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine); +} +else +{ + print ''.$langs->trans("NoTasks").''; +} print ""; print '
'; From b7cb2e6b9d1d0add949f82814e50e90f19467227 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 11:48:19 +0200 Subject: [PATCH 418/502] Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to. --- htdocs/core/lib/project.lib.php | 200 ++++++++++++++++---------------- htdocs/projet/activity/list.php | 18 ++- 2 files changed, 115 insertions(+), 103 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index e4ecb884a1c..ce345a44a68 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -443,16 +443,17 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t /** * Output a task line * - * @param string &$inc ? - * @param string $parent ? - * @param Object $lines ? - * @param int &$level ? - * @param string &$projectsrole ? - * @param string &$tasksrole ? - * @param int $mytask 0 or 1 to enable only if task is a task i am affected to + * @param string &$inc ? + * @param string $parent ? + * @param Object $lines ? + * @param int &$level ? + * @param string &$projectsrole ? + * @param string &$tasksrole ? + * @param string $mine Show only task lines I am assigned to + * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @return $inc */ -function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0) +function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0) { global $user, $bc, $langs; global $form, $projectstatic, $taskstatic; @@ -475,99 +476,104 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr $lastprojectid=$lines[$i]->fk_project; } - print "\n"; - - // Project - print ""; - $projectstatic->id=$lines[$i]->fk_project; - $projectstatic->ref=$lines[$i]->projectref; - $projectstatic->public=$lines[$i]->public; - $projectstatic->label=$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]; - print $projectstatic->getNomUrl(1); - print ""; - - // Ref - print ''; - $taskstatic->id=$lines[$i]->id; - $taskstatic->ref=$lines[$i]->id; - print $taskstatic->getNomUrl(1); - print ''; - - // Label task - print ""; - for ($k = 0 ; $k < $level ; $k++) + // If we want all or we have a role on task, we show it + if (empty($mine) || ! empty($tasksrole[$lines[$i]->id])) { - print "   "; + print "\n"; + + // Project + print ""; + $projectstatic->id=$lines[$i]->fk_project; + $projectstatic->ref=$lines[$i]->projectref; + $projectstatic->public=$lines[$i]->public; + $projectstatic->label=$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]; + print $projectstatic->getNomUrl(1); + print ""; + + // Ref + print ''; + $taskstatic->id=$lines[$i]->id; + $taskstatic->ref=$lines[$i]->id; + print $taskstatic->getNomUrl(1); + print ''; + + // Label task + print ""; + for ($k = 0 ; $k < $level ; $k++) + { + print "   "; + } + $taskstatic->id=$lines[$i]->id; + $taskstatic->ref=$lines[$i]->label; + print $taskstatic->getNomUrl(0); + print "\n"; + + // Date start + print ''; + print dol_print_date($lines[$i]->date_start,'dayhour'); + print ''; + + // Date end + print ''; + print dol_print_date($lines[$i]->date_end,'dayhour'); + print ''; + + // Planned Workload + print ''; + if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); + else print '--:--'; + print ''; + + // Progress declared % + print ''; + print $lines[$i]->progress.' %'; + print ''; + + // Time spent + print ''; + if ($lines[$i]->duration) + { + print ''; + print convertSecondToTime($lines[$i]->duration,'allhourmin'); + print ''; + } + else print '--:--'; + print "\n"; + + $disabledproject=1;$disabledtask=1; + //print "x".$lines[$i]->fk_project; + //var_dump($lines[$i]); + //var_dump($projectsrole[$lines[$i]->fk_project]); + // If at least one role for project + if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer) + { + $disabledproject=0; + $disabledtask=0; + } + // If $restricteditformytask is on and I have no role on task, i disable edit + if ($restricteditformytask && empty($tasksrole[$lines[$i]->id])) + { + $disabledtask=1; + } + + print ''; + $s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); + $s.='   '; + $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text'); + $s.=' '; + print $s; + print ''; + print ''; + if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject")); + else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou")); + print ''; + + print "\n"; } - $taskstatic->id=$lines[$i]->id; - $taskstatic->ref=$lines[$i]->label; - print $taskstatic->getNomUrl(0); - print "\n"; - - // Date start - print ''; - print dol_print_date($lines[$i]->date_start,'dayhour'); - print ''; - - // Date end - print ''; - print dol_print_date($lines[$i]->date_end,'dayhour'); - print ''; - - // Planned Workload - print ''; - if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); - else print '--:--'; - print ''; - - // Progress declared % - print ''; - print $lines[$i]->progress.' %'; - print ''; - - // Time spent - print ''; - if ($lines[$i]->duration) - { - print ''; - print convertSecondToTime($lines[$i]->duration,'allhourmin'); - print ''; - } - else print '--:--'; - print "\n"; - - $disabledproject=1;$disabledtask=1; - //print "x".$lines[$i]->fk_project; - //var_dump($lines[$i]); - //var_dump($projectsrole[$lines[$i]->fk_project]); - // If at least one role for project - if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer) - { - $disabledproject=0; - $disabledtask=0; - } - // If mytask and no role on task - if ($mytask && empty($tasksrole[$lines[$i]->id])) - { - $disabledtask=1; - } - - print ''; - $s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask); - $s.='   '; - $s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text'); - $s.=' '; - print $s; - print ''; - print ''; - if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject")); - else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou")); - print ''; - - print "\n"; + $inc++; $level++; - if ($lines[$i]->id) projectLinesb($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask); + if ($lines[$i]->id) projectLinesb($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask); $level--; } else diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 719d178d0ce..9eebe84bb87 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -133,11 +133,14 @@ llxHeader("",$title,""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); // Filter on user -dol_fiche_head(''); -print ''; -print ''; -print '
'.$langs->trans("User").''.$user->getLoginUrl(1).'
'; -dol_fiche_end(); +/* dol_fiche_head(''); + print ''; + print ''; + print '
'.$langs->trans("User").''; + if ($mine) print $user->getLoginUrl(1); + print '
'; + dol_fiche_end(); +*/ print '
'; print ''; @@ -157,9 +160,12 @@ print ''.$langs->trans("TimeSpent").''; print ''.$langs->trans("AddDuration").''; print "\n"; +// By default, we can edit only tasks we are assigned to +$restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)?1:0); + if (count($tasksarray) > 0) { - projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine); + projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask); } else { From 9bc29572571fd68e1e2a9e26ff9d0609be10d90b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 12:05:42 +0200 Subject: [PATCH 419/502] Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to. --- htdocs/projet/tasks/time.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 73249620cbb..56048ad1cf2 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -65,7 +65,8 @@ if ($action == 'addtimespent' && $user->rights->projet->creer) } if (empty($_POST["userid"])) { - setEventMessage($langs->trans('ErrorUserNotAffectedToTask'),'errors'); + $langs->load("errors"); + setEventMessage($langs->trans('ErrorUserNotAssignedToTask'),'errors'); $error++; } @@ -344,9 +345,13 @@ if ($id > 0 || ! empty($ref)) // Contributor print ''; - $contactoftask=$object->getListContactId('internal'); + $restrictaddtimetocontactoftask=0; + if (empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)) + { + $restrictaddtimetocontactoftask=$object->getListContactId('internal'); + } print img_object('','user'); - print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$contactoftask); + print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$restrictaddtimetocontactoftask); // Note: If user is not allowed it will be disabled into combo list and userid not posted print ''; // Note From 1c59f2df1c1db08c37eefcabd9f386c6f9ba8007 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 13:02:13 +0200 Subject: [PATCH 420/502] New: Add check to return dir into setup that server can't read --- htdocs/admin/system/dolibarr.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 79d5e7cf0aa..12ee7e2d98a 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -324,6 +324,18 @@ foreach($configfileparameters as $key => $value) print ""; if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey}); else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); + else if ($newkey == 'dolibarr_main_document_root_alt') + { + $tmparray=explode(',',${$newkey}); + $i=0; + foreach($tmparray as $value2) + { + if ($i > 0) print ', '; + print $value2; + if (! is_readable($value2)) print ' '.img_warning($langs->trans("ErrorCantReadDirr")); + ++$i; + } + } else print ${$newkey}; if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; print ""; From 885c26f27bc78b4a8e2ec50afa4e7080e99d3287 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 7 Aug 2014 13:50:25 +0200 Subject: [PATCH 421/502] =?UTF-8?q?Ajout=20du=20mode=20de=20r=C3=A8glement?= =?UTF-8?q?=20dans=20la=20liste=20des=20factures=20et=20dans=20la=20liste?= =?UTF-8?q?=20des=20impay=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture/impayees.php | 24 ++++++++++++++++++++++-- htdocs/compta/facture/list.php | 20 ++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 99f3a0ba082..4cac0678f4e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -367,6 +367,7 @@ $now=dol_now(); $search_ref = GETPOST("search_ref"); $search_refcustomer=GETPOST('search_refcustomer'); $search_societe = GETPOST("search_societe"); +$search_paymentmode = GETPOST("search_paymentmode"); $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); $late = GETPOST("late"); @@ -386,7 +387,7 @@ $limit = $conf->liste_limit; $sql = "SELECT s.nom, s.rowid as socid, s.email"; $sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp"; $sql.= ", f.datef as df, f.date_lim_reglement as datelimite"; -$sql.= ", f.paye as paye, f.fk_statut, f.type"; +$sql.= ", f.paye as paye, f.fk_statut, f.type, f.fk_mode_reglement"; $sql.= ", sum(pf.amount) as am"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -412,6 +413,7 @@ if (GETPOST('filtre')) if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$db->escape($search_ref)."%'"; if ($search_refcustomer) $sql .= " AND f.ref_client LIKE '%".$db->escape($search_refcustomer)."%'"; if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; +if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode.""; if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; @@ -441,6 +443,7 @@ if ($resql) if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_refcustomer) $param.='&search_ref='.urlencode($search_refcustomer); if ($search_societe) $param.='&search_societe='.urlencode($search_societe); + if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht); if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc); if ($late) $param.='&late='.urlencode($late); @@ -530,6 +533,7 @@ if ($resql) print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); @@ -557,6 +561,9 @@ if ($resql) print ' '; print ' '; print ''; + print ''; + $form->select_types_paiements($search_paymentmode, 'search_paymentmode'); + print ''; print ''; print ' '; print ''; @@ -636,7 +643,20 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->df),'day').''."\n"; print ''.dol_print_date($db->jdate($objp->datelimite),'day').''."\n"; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).''; + print ''; + $thirdparty=new Societe($db); + $thirdparty->id=$objp->socid; + $thirdparty->nom=$objp->nom; + $thirdparty->client=$objp->client; + $thirdparty->code_client=$objp->code_client; + print $thirdparty->getNomUrl(1,'customer'); + print ''; + + // Payment mode + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none'); + print ''; + print ''.price($objp->total_ht).''; print ''.price($objp->total_tva); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3532125ed8e..92214e2f9d5 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -64,6 +64,7 @@ $userid=GETPOST('userid','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); +$search_paymentmode=GETPOST('search_paymentmode','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); $search_status=GETPOST('search_status','alpha'); @@ -142,7 +143,7 @@ if (! $sall) $sql = 'SELECT'; else $sql = 'SELECT DISTINCT'; $sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; -$sql.= ' f.paye as paye, f.fk_statut,'; +$sql.= ' f.paye as paye, f.fk_statut, f.fk_mode_reglement, '; $sql.= ' s.nom, s.rowid as socid, s.code_client, s.client '; if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -186,6 +187,10 @@ if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } +if ($search_paymentmode) +{ + $sql.= ' AND f.fk_mode_reglement = '.$search_paymentmode; +} if ($search_montant_ht) { $sql.= ' AND f.total = \''.$db->escape(price2num(trim($search_montant_ht))).'\''; @@ -260,6 +265,7 @@ if ($resql) if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer; if ($search_societe) $param.='&search_societe=' .$search_societe; + if ($search_societe) $param.='&search_paymentmode=' .$search_paymentmode; if ($search_sale > 0) $param.='&search_sale=' .$search_sale; if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; @@ -288,7 +294,7 @@ if ($resql) if ($moreforfilter) { print ''; - print ''; + print ''; print $moreforfilter; print ''; } @@ -299,6 +305,7 @@ if ($resql) print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER['PHP_SELF'],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('PaymentMode'),$_SERVER['PHP_SELF'],'f.fk_mode_reglement','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER['PHP_SELF'],'f.total','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountVAT'),$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountTTC'),$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); @@ -322,6 +329,10 @@ if ($resql) print ''; print ' '; print ''; + print ''; + $form->select_types_paiements($search_paymentmode, 'search_paymentmode'); + print ''; + print ''; print ' '; print ''; @@ -404,6 +415,11 @@ if ($resql) print $thirdparty->getNomUrl(1,'customer'); print ''; + // Payment mode + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none'); + print ''; + print ''.price($objp->total_ht,0,$langs).''; print ''.price($objp->total_tva,0,$langs).''; From 7deacdf8516a829ffe1e0b9f381d400097899681 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 7 Aug 2014 14:07:44 +0200 Subject: [PATCH 422/502] New : After commit b7ee10a0747062a2f1d16bcf30b2da801846327f don't add product with qty 0 in invoices --- htdocs/compta/facture.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index de636bf5bdb..d1b01001aef 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -744,7 +744,7 @@ else if ($action == 'add' && $user->rights->facture->creer) } // Standard invoice or Deposit invoice created from a Predefined invoice - if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0) + if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && $_POST['fac_rec'] > 0) { $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) @@ -773,7 +773,7 @@ else if ($action == 'add' && $user->rights->facture->creer) } // Standard or deposit or proforma invoice - if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0) + if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT || $_POST['type'] == Facture::TYPE_PROFORMA) && $_POST['fac_rec'] <= 0) { if (GETPOST('socid', 'int') < 1) { @@ -852,7 +852,7 @@ else if ($action == 'add' && $user->rights->facture->creer) if ($id > 0) { // If deposit invoice - if ($_POST['type'] == 3) + if ($_POST['type'] == Facture::TYPE_DEPOSIT) { $typeamount = GETPOST('typedeposit', 'alpha'); $valuedeposit = GETPOST('valuedeposit', 'int'); @@ -938,6 +938,9 @@ else if ($action == 'add' && $user->rights->facture->creer) $num=count($lines); for ($i=0;$i<$num;$i++) { + // Don't add lines with qty 0 when coming from a shipment including all order lines + if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue; + $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); From 80653409a2ff6a019434022956bfd0f112b7e30e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 14:57:08 +0200 Subject: [PATCH 423/502] Fix: Missing join into request. --- htdocs/compta/facture.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index de636bf5bdb..fbe462ca0e7 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1818,15 +1818,7 @@ $now = dol_now(); llxHeader('', $langs->trans('Bill'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); -print ' - -'; + /** * ******************************************************************* @@ -3572,15 +3564,26 @@ if ($action == 'create') // Linked object block $somethingshown = $object->showLinkedObjectBlock(); - if (empty($somethingshown) && $object->statut > 0) { + if (empty($somethingshown) && ! empty($conf->commande->enabled)) + { print '
' . $langs->trans('LinkedOrder') . ''; + print ' + + '; + print '
'; //print ''; //print '
'; From 973d61fe135fa2da3dce87e165cb6b727b21796d Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 7 Aug 2014 16:23:02 +0200 Subject: [PATCH 425/502] [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice --- ChangeLog | 1 + htdocs/compta/facture.php | 11 ++++++++++- htdocs/langs/en_US/bills.lang | 2 ++ htdocs/langs/fr_FR/bills.lang | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bbfdf2e114f..26fe1616611 100644 --- a/ChangeLog +++ b/ChangeLog @@ -53,6 +53,7 @@ For users: - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - New: [ task #1204 ] add a External reference to contract +- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice For translators: - Update language files. diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index fbe462ca0e7..52db008e955 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2304,7 +2304,16 @@ if ($action == 'create') elseif ($newclassname == 'Fichinter') $newclassname = 'Intervention'; - print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; + print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1); + //We check if Origin document has already an invoice attached to it + $objectsrc->fetchObjectLinked($originid,'','','facture'); + $cntinvoice=count($objectsrc->linkedObjects['facture']); + if ($cntinvoice>=1) + { + setEventMessage('WarningBillExist','warnings'); + echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; + } + echo ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1 diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 9f8353acfda..ededbf9cbdc 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -295,6 +295,8 @@ TotalOfTwoDiscountMustEqualsOriginal=Total of two new discount must be equal to ConfirmRemoveDiscount=Are you sure you want to remove this discount ? RelatedBill=Related invoice RelatedBills=Related invoices +LatestRelatedBill=Latest related invoice +WarningBillExist=Warning, one or more invoice already exist # PaymentConditions PaymentConditionShortRECEP=Immediate diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index c4bf33c56cc..aaea4122b22 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -295,6 +295,8 @@ TotalOfTwoDiscountMustEqualsOriginal=La somme du montant des 2 nouvelles réduct ConfirmRemoveDiscount=Êtes-vous sûr de vouloir supprimer cette réduction ? RelatedBill=Facture associée RelatedBills=Factures associées +LatestRelatedBill=Dernière facture associée +WarningBillExist=Attention, il existe déjà une ou plusieurs factures # PaymentConditions PaymentConditionShortRECEP=A réception From 7d09b4b45c4ad12e3fe3d77c8bd6b73432e501e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Aug 2014 20:11:39 +0200 Subject: [PATCH 426/502] Fix: get_full_tree was not working correctly. --- htdocs/user/class/user.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9e8b5539c20..f5e63de9696 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2176,8 +2176,8 @@ class User extends CommonObject // Load array[child]=parent $sql = "SELECT fk_user as id_parent, rowid as id_son"; $sql.= " FROM ".MAIN_DB_PREFIX."user"; - $sql.= " WHERE fk_user != 0"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " WHERE fk_user <> 0"; + $sql.= " AND entity IN (".getEntity('user',1).")"; dol_syslog(get_class($this)."::load_parentof", LOG_DEBUG); $resql = $this->db->query($sql); @@ -2217,7 +2217,7 @@ class User extends CommonObject // Init this->parentof that is array(id_son=>id_parent, ...) $this->load_parentof(); - + // Init $this->users array $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -2306,13 +2306,13 @@ class User extends CommonObject // Define fullpath and fullname $this->users[$id_user]['fullpath'] = '_'.$id_user; - $this->users[$id_user]['fullname'] = $this->users[$id_user]['label']; + $this->users[$id_user]['fullname'] = $this->users[$id_user]['lastname']; $i=0; $cursor_user=$id_user; - while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) + while ((empty($protection) || $i < $protection) && ! empty($this->parentof[$cursor_user])) // Loop on each parent, one after one { $this->users[$id_user]['fullpath'] = '_'.$this->parentof[$cursor_user].$this->users[$id_user]['fullpath']; - $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['label'].' >> '.$this->users[$id_user]['fullname']; + $this->users[$id_user]['fullname'] = $this->users[$this->parentof[$cursor_user]]['lastname'].' >> '.$this->users[$id_user]['fullname']; $i++; $cursor_user=$this->parentof[$cursor_user]; } From 2eea7cdc7fcda16d92c99f1c83b92cf6e94afdaf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 01:55:45 +0200 Subject: [PATCH 427/502] New: Intervention documents are now available in ECM module --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index ced0b6dfbfe..88afd56905f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. - New: Supervisor is now visible into user list. - New: Add user of creation and validation on invoice export. From 4eeb92d082c93f2314cbf2556d957d77234bce25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 02:11:03 +0200 Subject: [PATCH 428/502] Fix: Bad help text Fix: Removed duplicate header --- htdocs/projet/activity/list.php | 26 +++++++++++++++----------- htdocs/projet/tasks/index.php | 2 +- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index f5b5b2aa456..09cc56c54e8 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -70,7 +70,7 @@ if ($action == 'addtime' && $user->rights->projet->creer) { // We store HOURS in seconds if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60; - + // We store MINUTES in seconds if($matches[2]=='min') $timespent_duration[$id] += $time*60; } @@ -88,9 +88,9 @@ if ($action == 'addtime' && $user->rights->projet->creer) $task->timespent_date = dol_mktime(12,0,0,$_POST["{$key}month"],$_POST["{$key}day"],$_POST["{$key}year"]); $task->addTimeSpent($user); } - + setEventMessage($langs->trans("RecordSaved")); - + // Redirect to avoid submit twice on back header('Location: '.$_SERVER["PHP_SELF"].'?id='.$projectid.($mode?'&mode='.$mode:'')); exit; @@ -101,6 +101,8 @@ if ($action == 'addtime' && $user->rights->projet->creer) } } + + /* * View */ @@ -113,7 +115,6 @@ $taskstatic = new Task($db); $title=$langs->trans("TimeSpent"); if ($mine) $title=$langs->trans("MyTimeSpent"); - //$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project @@ -128,16 +129,19 @@ $projectsrole=$taskstatic->getUserRolesForProjectsOrTasks($user,0,($project->id? $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$project->id:$projectsListId),0); -llxHeader("",$title,""); - - -llxHeader("",$title,""); - - llxHeader("",$title,""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); +// Show description of content +if ($mine) print $langs->trans("MyTasksDesc").'

'; +else +{ + if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; + else print $langs->trans("ProjectsPublicTakDesc").'

'; +} + + // Filter on user /* dol_fiche_head(''); print ''; @@ -177,7 +181,7 @@ print ''; print "\n"; // By default, we can edit only tasks we are assigned to -$restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)?1:0); +$restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)?1:0); if (count($tasksarray) > 0) { diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index d019a629bdd..12d7dca69eb 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -75,7 +75,7 @@ if ($id) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); // Show description of content -if ($mine) print $langs->trans("MyProjectsDesc").'

'; +if ($mine) print $langs->trans("MyTasksDesc").'

'; else { if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'

'; From 06fcbe12a8fa0ff0777a654c0c944d7450893e6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 10:44:10 +0200 Subject: [PATCH 429/502] Add MAIN_DEFAULT_WORKING_DAYS and MAIN_DEFAULT_WORKING_HOURS into company setup. --- htdocs/admin/ihm.php | 42 ++++++++++++++++++++++++++++++---- htdocs/langs/en_US/agenda.lang | 3 ++- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index fe375d7668c..5cdb41cbe23 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -59,6 +59,8 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); @@ -171,13 +173,13 @@ if ($action == 'edit') // Edit print ''; print ''; - // Taille max des listes + // Max size of lists $var=!$var; print ''; print ''; print ''; - // Desactivation javascript et ajax + // Disable javascript and ajax $var=!$var; print ''; print ''; - // Firstname/Name + // DefaultWorkingDays + $var=!$var; + print ''; + print ''; + print ''; + + // DefaultWorkingHours + $var=!$var; + print ''; + print ''; + print ''; + + // Firstname/Name $var=!$var; print ''; + print ''; + print ''; + + // DefaultWorkingDays + $var=!$var; + print ''; + print ''; + print ''; + + // DefaultWorkingHours + $var=!$var; + print ''; print ''; print ''; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 347e2b5fb59..d18276c362e 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -75,7 +75,8 @@ AgendaShowBirthdayEvents=Show birthday's contacts AgendaHideBirthdayEvents=Hide birthday's contacts Busy=Busy ExportDataset_event1=List of agenda events - +DefaultWorkingDays=Default working days range in week (Example: 1-5, 1-6) +DefaultWorkingHours=Default working hours in day (Example: 9-18) # External Sites ical ExportCal=Export calendar ExtSites=Import external calendars From 4922071af90fdf3944551beff9271633cbb77881 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 10:50:37 +0200 Subject: [PATCH 430/502] New: When a translation is not available we always jump to en_US and only en_US. --- ChangeLog | 3 ++- htdocs/core/class/translate.class.php | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9eb4dd20519..08d53ea7cdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,7 @@ For users: Use accesskey on form search. - New: Intervention documents are now available in ECM module - New: Add attachments on user card + in ECM module -- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. +- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template. - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem @@ -59,6 +59,7 @@ For users: For translators: - Update language files. +- New: When a translation is not available we always jump to en_US and only en_US. For developers: - New: getBrowserInfo can return type of layout (classic/phone/tablet) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3657cca03f5..383ac4a035d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -154,7 +154,7 @@ class Translate * If $domain is "file@module" instead of "file" then we look for module lang file * in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang * then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang - * @param string $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US or fr_FR or es_ES) + * @param string $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US) * @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed) * @param int $forcelangdir To force a different lang directory * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK @@ -196,7 +196,7 @@ class Translate // Redefine alt $langarray=explode('_',$langofdir); if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1; - if ($alt < 2 && (strtolower($langofdir) == 'en_us' || strtolower($langofdir) == 'fr_fr' || strtolower($langofdir) == 'es_es')) $alt=2; + if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2; foreach($this->dir as $keydir => $searchdir) { @@ -312,8 +312,8 @@ class Translate // This function MUST NOT contains call to syslog //dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG); $langofdir='en_US'; - if (preg_match('/^fr/i',$langarray[0])) $langofdir='fr_FR'; - if (preg_match('/^es/i',$langarray[0])) $langofdir='es_ES'; + //if (preg_match('/^fr/i',$langarray[0])) $langofdir='fr_FR'; + //if (preg_match('/^es/i',$langarray[0])) $langofdir='es_ES'; $this->load($domain,$alt+1,$stopafterdirection,$langofdir); } @@ -592,7 +592,7 @@ class Translate { // Test si fichier dans repertoire de la langue alternative if ($this->defaultlang != "en_US") $filenamealt = $searchdir."/langs/en_US/".$filename; - else $filenamealt = $searchdir."/langs/fr_FR/".$filename; + //else $filenamealt = $searchdir."/langs/fr_FR/".$filename; if (is_readable(dol_osencode($filenamealt))) return true; } } From ebcc68cdfad27dc5cd687f48486e874aa05fe712 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Aug 2014 13:09:06 +0200 Subject: [PATCH 431/502] Add commented code to use "clear" cookie. This help debug. --- htdocs/core/lib/functions.lib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7097bd2abae..f3add9e66c8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -221,7 +221,12 @@ function GETPOST($paramname,$check='',$method=0) */ function dol_getprefix() { - if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) + { + return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + // Use this for a "clear" cookie name + //return dol_sanitizeFileName($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + } else return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT); } From 9bf32603fe37134f9c0bb9fbbfd17514d2b48253 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 8 Aug 2014 14:25:14 +0200 Subject: [PATCH 432/502] [ task #1218 ] Can drag and drop an event from calendar to change its day. --- ChangeLog | 1 + htdocs/comm/action/fiche.php | 42 +++++++++++++++++++++++++++++++ htdocs/comm/action/index.php | 48 +++++++++++++++++++++++++++++++----- 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08d53ea7cdb..7e0f337f0e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ For users: - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - New: [ task #1204 ] add a External reference to contract +- New: [ task #1218 ] Can drag and drop an event from calendar to change its day. For translators: - Update language files. diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index f04c9e372a9..b6da05ecfd2 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013 Florian Henry + * Copyright (C) 2014 Cedric GROSS * * 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 @@ -384,7 +385,48 @@ if ($action == 'update') } } +/* + * Action move update, used when user move an event in calendar by drag'n drop + */ +if ($action == 'mupdate') +{ + $object->fetch($id); + $shour = dol_print_date($object->datep,"%H"); + $smin = dol_print_date($object->datep, "%M"); + + $newdate=GETPOST('newdate','alpha'); + if (empty($newdate) || strpos($newdate,'dayevent_') != 0 ) + { + header("Location: ".$backtopage); + exit; + } + $datep=dol_mktime($shour, $smin, 0,substr($newdate,13,2) , substr($newdate,15,2), substr($newdate,9,4)); + if ($datep!=$object->datep) + { + if (!empty($object->datef)) + { + $object->datef+=$datep-$object->datep; + } + $object->datep=$datep; + $result=$object->update($user); + if ($result < 0) + { + setEventMessage($object->error,'errors'); + setEventMessage($object->errors,'errors'); + } + } + if (! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + else + { + $action=''; + } + +} /* * View */ diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index fe6e218f1a1..0964da3e2b9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2014 Cedric GROSS * * 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 @@ -330,7 +331,12 @@ if ($conf->use_javascript_ajax) $s.='jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n"; $s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n"; $s.='jQuery(".family_birthday").toggle();' . "\n"; - $s.='});' . "\n"; + if ($action=="show_week" || $action=="show_month" || empty($action)) + { + $s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {'; + $s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n"; + $s.='});' . "\n"; + } $s.='' . "\n"; if (! empty($conf->use_javascript_ajax)) { @@ -932,6 +938,12 @@ if (empty($action) || $action == 'show_month') // View by month echo " \n"; } echo "
'.$langs->trans("User").''.$langs->trans("AddDuration").'
 
'.$langs->trans("DefaultMaxSizeList").' 
'.$langs->trans("DisableJavascript").''; print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1); @@ -204,7 +206,23 @@ if ($action == 'edit') // Edit print ' 
'.$langs->trans("DefaultWorkingDays").''; + print ''; + print ' 
'.$langs->trans("DefaultWorkingHours").''; + print ''; + print ' 
'.$langs->trans("FirstnameNamePosition").''; $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname")); @@ -360,6 +378,22 @@ else // Show $var=!$var; print '
'.$langs->trans("WeekStartOnDay").''; print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1')); + print ' 
'.$langs->trans("DefaultWorkingDays").''; + print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5'; + print ' 
'.$langs->trans("DefaultWorkingHours").''; + print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18'; print ' 
\n"; + echo '
'; + echo ''; + echo ''; + echo '' ; + echo '
'; + } elseif ($action == 'show_week') // View by week { @@ -992,6 +1004,11 @@ elseif ($action == 'show_week') // View by week echo " \n"; echo "\n"; + echo '
'; + echo ''; + echo ''; + echo '' ; + echo '
'; } else // View by day { @@ -1089,7 +1106,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''; } print ''; - print ''; + print ''; //$curtime = dol_mktime (0, 0, 0, $month, $day, $year); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); @@ -1134,9 +1151,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $numicals[dol_string_nospecial($event->icalname)]++; } $color=$event->icalcolor; - $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other'); + $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable'); } - else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } + else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } else { $numother++; $cssclass='family_other'; } if ($color == -1) // Color was not forced. Set color according to color index. { @@ -1158,6 +1175,24 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } $cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; + if (empty($event->fulldayevent)) + { + if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) + { + $tmpyearend = date('Y',$event->date_end_in_calendar); + $tmpmonthend = date('m',$event->date_end_in_calendar); + $tmpdayend = date('d',$event->date_end_in_calendar); + if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) + { + $cssclass.= " unsortable"; + } + } + if ($event->type_code =='AC_OTH_AUTO') + { + $cssclass.= " unsortable"; + } + } + // Show rect of event print '
'; print '
  • '; @@ -1242,7 +1277,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show title if ($event->type_code == 'ICALEVENT') print dol_trunc($event->libelle,$maxnbofchar); - else print $event->getNomUrl(0,$maxnbofchar,'cal_event'); + else print $event->getNomUrl(0,$maxnbofchar,'cal_event id_'.$event->id); if ($event->type_code == 'ICALEVENT') print '
    ('.dol_trunc($event->icalname,$maxnbofchar).')'; @@ -1327,8 +1362,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // TODO Loop on each element of day $ymd and start to toggle once $maxprint has been reached print 'jQuery(".family_mytasks_day_'.$ymd.'").toggle();'; print '}'."\n"; - + print '});'."\n"; + print ''."\n"; } From c9c54e38ccf35f1d2f14164ee87ed9063a6e0add Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 8 Aug 2014 14:28:27 +0200 Subject: [PATCH 433/502] fix wrong if closure --- htdocs/comm/action/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 0964da3e2b9..1768bb989d4 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -335,8 +335,8 @@ if ($conf->use_javascript_ajax) { $s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {'; $s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n"; - $s.='});' . "\n"; } + $s.='});' . "\n"; $s.='' . "\n"; if (! empty($conf->use_javascript_ajax)) { From 5514598536dfab7b8c9b4143ffdb2b660279e71f Mon Sep 17 00:00:00 2001 From: KreizIT Date: Fri, 8 Aug 2014 15:00:03 +0200 Subject: [PATCH 434/502] fix travis failure --- htdocs/comm/action/fiche.php | 2 +- htdocs/comm/action/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index b6da05ecfd2..6a11985aa6a 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -401,7 +401,7 @@ if ($action == 'mupdate') exit; } - $datep=dol_mktime($shour, $smin, 0,substr($newdate,13,2) , substr($newdate,15,2), substr($newdate,9,4)); + $datep=dol_mktime($shour, $smin, 0, substr($newdate,13,2), substr($newdate,15,2), substr($newdate,9,4)); if ($datep!=$object->datep) { if (!empty($object->datef)) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 1768bb989d4..a2b49628fd2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1277,7 +1277,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show title if ($event->type_code == 'ICALEVENT') print dol_trunc($event->libelle,$maxnbofchar); - else print $event->getNomUrl(0,$maxnbofchar,'cal_event id_'.$event->id); + else print $event->getNomUrl(0,$maxnbofchar,'cal_event'); if ($event->type_code == 'ICALEVENT') print '
    ('.dol_trunc($event->icalname,$maxnbofchar).')'; From 0738103da8d94fd1a0e09bcc142ba7a3e9955e1b Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 10 Aug 2014 13:37:39 +0200 Subject: [PATCH 435/502] Renamed llx_c_pays to llx_c_country & field "libelle" to "label" --- ChangeLog | 1 + .../actions_adherentcard_common.class.php | 2 +- htdocs/adherents/cartes/carte.php | 4 +- htdocs/adherents/class/adherent.class.php | 4 +- htdocs/adherents/fiche.php | 2 +- htdocs/adherents/stats/geo.php | 26 +- htdocs/admin/company.php | 2 +- htdocs/admin/dict.php | 30 +- htdocs/admin/limits.php | 4 +- htdocs/cashdesk/facturation.php | 8 +- htdocs/compta/bank/class/account.class.php | 4 +- .../class/bonprelevement.class.php | 14 +- .../actions_contactcard_common.class.php | 6 +- htdocs/contact/class/contact.class.php | 4 +- htdocs/contact/list.php | 4 +- htdocs/core/ajax/ziptown.php | 12 +- .../{cpays.class.php => ccountry.class.php} | 36 +- htdocs/core/class/html.form.class.php | 39 +- htdocs/core/class/html.formcompany.class.php | 37 +- htdocs/core/class/html.formother.class.php | 14 +- .../class/html.formsocialcontrib.class.php | 6 +- htdocs/core/lib/company.lib.php | 6 +- htdocs/core/lib/functions.lib.php | 26 +- htdocs/core/modules/modAdherent.class.php | 2 +- htdocs/core/modules/modAgenda.class.php | 8 +- htdocs/core/modules/modCategorie.class.php | 18 +- htdocs/core/modules/modCommande.class.php | 10 +- htdocs/core/modules/modExpedition.class.php | 8 +- htdocs/core/modules/modFacture.class.php | 4 +- htdocs/core/modules/modFicheinter.class.php | 4 +- htdocs/core/modules/modFournisseur.class.php | 6 +- htdocs/core/modules/modProjet.class.php | 2 +- htdocs/core/modules/modPropale.class.php | 10 +- htdocs/core/modules/modSociete.class.php | 16 +- htdocs/core/modules/modStock.class.php | 2 +- htdocs/exports/export.php | 2 +- htdocs/install/mysql/data/llx_00_c_pays.sql | 490 +++++++++--------- .../install/mysql/migration/3.6.0-3.7.0.sql | 9 +- ...x_c_pays.key.sql => llx_c_country.key.sql} | 6 +- .../{llx_c_pays.sql => llx_c_country.sql} | 4 +- .../mysql/tables/llx_c_regions.key.sql | 2 +- .../mysql/tables/llx_c_ziptown.key.sql | 2 +- htdocs/install/mysql/tables/llx_c_ziptown.sql | 2 +- .../install/mysql/tables/llx_product.key.sql | 2 +- htdocs/societe/ajaxcountries.php | 14 +- htdocs/societe/class/address.class.php | 8 +- htdocs/societe/class/societe.class.php | 13 +- htdocs/societe/localtaxes.php | 6 +- htdocs/webservices/server_contact.php | 4 +- htdocs/webservices/server_thirdparty.php | 8 +- htdocs/webservices/server_user.php | 2 +- .../members/sync_members_ldap2dolibarr.php | 12 +- scripts/user/sync_users_ldap2dolibarr.php | 12 +- 53 files changed, 488 insertions(+), 491 deletions(-) rename htdocs/core/class/{cpays.class.php => ccountry.class.php} (90%) rename htdocs/install/mysql/tables/{llx_c_pays.key.sql => llx_c_country.key.sql} (79%) rename htdocs/install/mysql/tables/{llx_c_pays.sql => llx_c_country.sql} (94%) diff --git a/ChangeLog b/ChangeLog index 08d53ea7cdb..ca9b4daba2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,7 @@ For developers: - New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. - New: Added hook "formConfirm" and "doActions" for supplier invoice card - New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card +- New: renamed table llx_c_pays to llx_c_country & libelle field to label WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index fc593e826f2..9bd164a9b32 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -412,7 +412,7 @@ abstract class ActionsAdherentCardCommon // We set country_id, and country_code label of the chosen country if ($this->object->country_id) { - $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_pays WHERE rowid = ".$this->object->country_id; + $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".$this->object->country_id; $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index ade8f059810..98f5e908e16 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -64,9 +64,9 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg $sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,"; $sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,"; $sql.= " t.libelle as type,"; - $sql.= " p.code as country_code, p.libelle as country"; + $sql.= " c.code as country_code, c.label as country"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid"; $sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid; if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4bee90b7a50..e33a8577685 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1058,12 +1058,12 @@ class Adherent extends CommonObject $sql.= " d.datevalid as datev,"; $sql.= " d.country,"; $sql.= " d.state_id,"; - $sql.= " p.rowid as country_id, p.code as country_code, p.libelle as country,"; + $sql.= " c.rowid as country_id, c.code as country_code, c.label as country,"; $sql.= " dep.nom as state, dep.code_departement as state_code,"; $sql.= " t.libelle as type, t.cotisation as cotisation,"; $sql.= " u.rowid as user_id, u.login as user_login"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member"; $sql.= " WHERE d.fk_adherent_type = t.rowid"; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 49eabe52d43..00ef238c79a 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -945,7 +945,7 @@ else $country=GETPOST('country','int'); if (!empty($country) || $object->country_id) { - $sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(!empty($country)?$country:$object->country_id); + $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country)?$country:$object->country_id); $resql=$db->query($sql); if ($resql) { diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index ecf27f78465..736f6ef0140 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -76,11 +76,11 @@ if ($mode) $tab='statscountry'; $data = array(); - $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label"; - $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.country = c.rowid"; + $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label"; + $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; - $sql.=" GROUP BY c.libelle, c.code"; + $sql.=" GROUP BY c.label, c.code"; //print $sql; } @@ -91,29 +91,29 @@ if ($mode) $tab='statsstate'; $data = array(); - $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, c.nom as label2"; // + $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, c.nom as label2"; // $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; - $sql.=" GROUP BY p.libelle, p.code, c.nom"; + $sql.=" GROUP BY co.label, co.code, c.nom"; //print $sql; } if ($mode == 'memberbyregion') // { - $label=$langs->trans("Country"); //pays + $label=$langs->trans("Country"); $label2=$langs->trans("Region"); //département $tab='statsregion'; //onglet $data = array(); //tableau de donnée - $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, r.nom as label2"; + $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, r.nom as label2"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; - $sql.=" GROUP BY p.libelle, p.code, r.nom"; //+ + $sql.=" GROUP BY co.label, co.code, r.nom"; //+ //print $sql; } if ($mode == 'memberbytown') @@ -123,12 +123,12 @@ if ($mode) $tab='statstown'; $data = array(); - $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2"; + $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label, d.town as label2"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d"; - $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; + $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid"; $sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" AND d.statut = 1"; - $sql.=" GROUP BY p.libelle, p.code, d.town"; + $sql.=" GROUP BY c.label, c.code, d.town"; //print $sql; } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index c69f269f301..c774faf5caa 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -318,7 +318,7 @@ if ($action == 'edit' || $action == 'updateedit') // Country $var=!$var; print ''; - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation + //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id,'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print ''."\n"; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7075b601877..2b5fc6c0bd7 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -77,7 +77,7 @@ $tabname=array(); $tabname[1] = MAIN_DB_PREFIX."c_forme_juridique"; $tabname[2] = MAIN_DB_PREFIX."c_departements"; $tabname[3] = MAIN_DB_PREFIX."c_regions"; -$tabname[4] = MAIN_DB_PREFIX."c_pays"; +$tabname[4] = MAIN_DB_PREFIX."c_country"; $tabname[5] = MAIN_DB_PREFIX."c_civilite"; $tabname[6] = MAIN_DB_PREFIX."c_actioncomm"; $tabname[7] = MAIN_DB_PREFIX."c_chargesociales"; @@ -132,20 +132,20 @@ $tablib[26]= "DictionaryResourceType"; // Requests to extract data $tabsql=array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; -$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1"; -$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; -$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; +$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid"; +$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1"; +$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1"; +$tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; -$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; -$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, p.code as country_code, p.libelle as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON t.fk_country=p.rowid"; +$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1"; +$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; -$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; +$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active, accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c"; -$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; +$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; @@ -155,8 +155,8 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c"; $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount"; -$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; -$tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; +$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1"; +$tabsql[25]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[26]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; // Criteria to sort dictionaries @@ -193,7 +193,7 @@ $tabfield=array(); $tabfield[1] = "code,libelle,country"; $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country" $tabfield[3] = "code,libelle,country_id,country"; -$tabfield[4] = "code,libelle"; +$tabfield[4] = "code,label"; $tabfield[5] = "code,libelle"; $tabfield[6] = "code,libelle,type,position"; $tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; @@ -222,7 +222,7 @@ $tabfieldvalue=array(); $tabfieldvalue[1] = "code,libelle,country"; $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" $tabfieldvalue[3] = "code,libelle,country"; -$tabfieldvalue[4] = "code,libelle"; +$tabfieldvalue[4] = "code,label"; $tabfieldvalue[5] = "code,libelle"; $tabfieldvalue[6] = "code,libelle,type,position"; $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; @@ -251,7 +251,7 @@ $tabfieldinsert=array(); $tabfieldinsert[1] = "code,libelle,fk_pays"; $tabfieldinsert[2] = "code_departement,nom,fk_region"; $tabfieldinsert[3] = "code_region,nom,fk_pays"; -$tabfieldinsert[4] = "code,libelle"; +$tabfieldinsert[4] = "code,label"; $tabfieldinsert[5] = "code,civilite"; $tabfieldinsert[6] = "code,libelle,type,position"; $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible"; @@ -1019,7 +1019,7 @@ if ($id) $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); $valuetoshow=nl2br($valuetoshow); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_pays') { + else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') { $key=$langs->trans("Country".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 26f6c08aee9..781bc24aa09 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -205,8 +205,8 @@ else $vat_rates=array(); $sql.="SELECT taux as vat_rate"; - $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.=" WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$mysoc->country_code."' AND taux != 0"; + $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql.=" WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$mysoc->country_code."' AND taux != 0"; $sql.=" ORDER BY t.taux ASC"; $resql=$db->query($sql); if ($resql) diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 95f3583fe94..a168fba5b7b 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -156,10 +156,10 @@ $i=0; $sql = "SELECT t.rowid, t.taux"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t"; -$sql.= ", ".MAIN_DB_PREFIX."c_pays as p"; -$sql.= " WHERE t.fk_pays = p.rowid"; -$sql.= " AND t.active = 1"; -$sql.= " AND p.code = '".$mysoc->country_code."'"; +$sql.= ", ".MAIN_DB_PREFIX."c_country as c"; +$sql.= " WHERE t.fk_pays = c.rowid"; +$sql.= " AND c.active = 1"; +$sql.= " AND c.code = '".$mysoc->country_code."'"; //print $request; $resql = $db->query($sql); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e50c7bb34f6..4ca6175d785 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -607,10 +607,10 @@ class Account extends CommonObject $sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id,"; $sql.= " ba.account_number, ba.accountancy_journal, ba.currency_code,"; $sql.= " ba.min_allowed, ba.min_desired, ba.comment,"; - $sql.= ' p.code as country_code, p.libelle as country,'; + $sql.= ' c.code as country_code, c.label as country,'; $sql.= ' d.code_departement as state_code, d.nom as state'; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ba.fk_pays = c.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid'; $sql.= " WHERE entity IN (".getEntity($this->element, 1).")"; if ($id) $sql.= " AND ba.rowid = ".$id; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 60b056babf4..6c0c7c87558 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1260,7 +1260,7 @@ class BonPrelevement extends CommonObject /* * section Debiteur (sepa Debiteurs bloc lines) */ - $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,"; + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " FROM"; @@ -1268,12 +1268,12 @@ class BonPrelevement extends CommonObject $sql.= " ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; $sql.= " ".MAIN_DB_PREFIX."societe as soc,"; - $sql.= " ".MAIN_DB_PREFIX."c_pays as p,"; + $sql.= " ".MAIN_DB_PREFIX."c_country as c,"; $sql.= " ".MAIN_DB_PREFIX."societe_rib as rib"; $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; $sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; $sql.= " AND pf.fk_facture = f.rowid"; - $sql.= " AND soc.fk_pays = p.rowid"; + $sql.= " AND soc.fk_pays = c.rowid"; $sql.= " AND soc.rowid = f.fk_soc"; $sql.= " AND rib.fk_soc = f.fk_soc"; $sql.= " AND rib.default_rib = 1"; @@ -1493,7 +1493,7 @@ class BonPrelevement extends CommonObject * @param string $row_address soc.address AS adr, * @param string $row_zip soc.zip * @param string $row_town soc.town - * @param string $row_country_code p.code AS pays, + * @param string $row_country_code c.code AS country, * @param string $row_cb pl.code_banque AS cb, * @param string $row_cg pl.code_guichet AS cg, * @param string $row_cc pl.number AS cc, @@ -1648,7 +1648,7 @@ class BonPrelevement extends CommonObject $obj = $this->db->fetch_object($resql); // DONNEES BRUTES : par la suite Rows['XXX'] de la requete au dessus - $pays = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY); + $country = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY); $IdBon = sprintf("%05d", $obj->rowid); $RefBon = $obj->ref; $type = ($nombre == 1) ? 'FRST' : 'RCUR' ; @@ -1673,7 +1673,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$pays[1].''.$CrLf; + $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $XML_SEPA_INFO .= ' '.$configuration->global->MAIN_INFO_SOCIETE_ADDRESS.''.$CrLf; $XML_SEPA_INFO .= ' '.$configuration->global->MAIN_INFO_SOCIETE_ZIP.' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; @@ -1691,7 +1691,7 @@ class BonPrelevement extends CommonObject /* $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$pays[1].''.$CrLf; + $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.''.$CrLf; $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index a2612e51e47..3cb150b8432 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -450,7 +450,7 @@ abstract class ActionsContactCardCommon // We set country_id, and country_code label of the chosen country if ($this->object->country_id) { - $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_pays WHERE rowid = ".$this->object->country_id; + $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".$this->object->country_id; $resql=$this->db->query($sql); if ($resql) { @@ -460,9 +460,9 @@ abstract class ActionsContactCardCommon { dol_print_error($this->db); } - $this->object->country_id = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; + $this->object->country_id = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; $this->object->country_code = $obj->code; - $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; + $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 7858f81dcf9..47f219feb4d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -506,12 +506,12 @@ class Contact extends CommonObject $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.import_key,"; - $sql.= " p.libelle as country, p.code as country_code,"; + $sql.= " co.label as country, co.code as country_code,"; $sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " u.rowid as user_id, u.login as user_login,"; $sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON c.fk_pays = co.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 5c2b2f04938..1829e5f098c 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -124,9 +124,9 @@ $formother=new FormOther($db); $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; -$sql.= " cp.code as country_code"; +$sql.= " co.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON p.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 80f6cd9bd63..def98b25ae8 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -63,13 +63,13 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table { $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; - $sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; + $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country"; $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; - $sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_pays as p)"; + $sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_country as c)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region"; - $sql.= " WHERE z.fk_pays = p.rowid"; - $sql.= " AND z.active = 1 AND p.active = 1"; + $sql.= " WHERE z.fk_pays = c.rowid"; + $sql.= " AND z.active = 1 AND c.active = 1"; if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; $sql.= " ORDER BY z.zip, z.town"; @@ -78,11 +78,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) else // Use table of third parties { $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; - $sql.= ", p.code as country_code, p.libelle as country"; + $sql.= ", c.code as country_code, c.label as country"; $sql.= ", d.code_departement as county_code , d.nom as county"; $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON fk_pays = p.rowid'; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON fk_pays = c.rowid'; $sql.= " WHERE"; if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; diff --git a/htdocs/core/class/cpays.class.php b/htdocs/core/class/ccountry.class.php similarity index 90% rename from htdocs/core/class/cpays.class.php rename to htdocs/core/class/ccountry.class.php index e75f8a75a1a..088dfaf327b 100644 --- a/htdocs/core/class/cpays.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/core/class/cpays.class.php + * \file htdocs/core/class/ccountry.class.php * \ingroup core - * \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_pays dictionary + * \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_country dictionary */ // Put here all includes required by your class file @@ -30,18 +30,18 @@ /** * Class to manage dictionary Countries (used by imports) */ -class Cpays // extends CommonObject +class Ccountry // extends CommonObject { var $db; //!< To store db handler var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) - //var $element='cpays'; //!< Id that identify managed objects - //var $table_element='cpays'; //!< Name of table without prefix where object is stored + //var $element='ccountry'; //!< Id that identify managed objects + //var $table_element='ccountry'; //!< Name of table without prefix where object is stored var $id; var $code; var $code_iso; - var $libelle; + var $label; var $active; @@ -74,24 +74,24 @@ class Cpays // extends CommonObject // Clean parameters if (isset($this->code)) $this->code=trim($this->code); if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso); - if (isset($this->libelle)) $this->libelle=trim($this->libelle); + if (isset($this->label)) $this->label=trim($this->label); if (isset($this->active)) $this->active=trim($this->active); // Check parameters // Put here code to add control on parameters values // Insert request - $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_pays("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_country("; $sql.= "rowid,"; $sql.= "code,"; $sql.= "code_iso,"; - $sql.= "libelle,"; + $sql.= "label,"; $sql.= "active"; $sql.= ") VALUES ("; $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->code_iso)?'NULL':"'".$this->db->escape($this->code_iso)."'").","; - $sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").","; + $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").""; $sql.= ")"; @@ -103,7 +103,7 @@ class Cpays // extends CommonObject if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_pays"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_country"); if (! $notrigger) { @@ -152,9 +152,9 @@ class Cpays // extends CommonObject $sql.= " t.rowid,"; $sql.= " t.code,"; $sql.= " t.code_iso,"; - $sql.= " t.libelle,"; + $sql.= " t.label,"; $sql.= " t.active"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_pays as t"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t"; if ($id) $sql.= " WHERE t.rowid = ".$id; elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; @@ -169,7 +169,7 @@ class Cpays // extends CommonObject $this->id = $obj->rowid; $this->code = $obj->code; $this->code_iso = $obj->code_iso; - $this->libelle = $obj->libelle; + $this->label = $obj->label; $this->active = $obj->active; } $this->db->free($resql); @@ -199,7 +199,7 @@ class Cpays // extends CommonObject // Clean parameters if (isset($this->code)) $this->code=trim($this->code); if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso); - if (isset($this->libelle)) $this->libelle=trim($this->libelle); + if (isset($this->label)) $this->label=trim($this->label); if (isset($this->active)) $this->active=trim($this->active); @@ -207,10 +207,10 @@ class Cpays // extends CommonObject // Put here code to add control on parameters values // Update request - $sql = "UPDATE ".MAIN_DB_PREFIX."c_pays SET"; + $sql = "UPDATE ".MAIN_DB_PREFIX."c_country SET"; $sql.= " code=".(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").","; $sql.= " code_iso=".(isset($this->code_iso)?"'".$this->db->escape($this->code_iso)."'":"null").","; - $sql.= " libelle=".(isset($this->libelle)?"'".$this->db->escape($this->libelle)."'":"null").","; + $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " active=".(isset($this->active)?$this->active:"null").""; $sql.= " WHERE rowid=".$this->id; @@ -267,7 +267,7 @@ class Cpays // extends CommonObject global $conf, $langs; $error=0; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_pays"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_country"; $sql.= " WHERE rowid=".$this->id; $this->db->begin(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 355c13bc76f..5c1dca37328 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -449,19 +449,6 @@ class Form return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext); } - /** - * Return combo list of activated countries, into language of user - * - * @param string $selected Id or Code or Label of preselected country - * @param string $htmlname Name of html select object - * @param string $htmloption Options html on select object - * @return void - */ - function select_pays($selected='',$htmlname='country_id',$htmloption='') - { - print $this->select_country($selected,$htmlname,$htmloption); - } - /** * Return combo list of activated countries, into language of user * @@ -481,8 +468,8 @@ class Form $countryArray=array(); $label=array(); - $sql = "SELECT rowid, code as code_iso, libelle as label"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; + $sql = "SELECT rowid, code as code_iso, label"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_country"; $sql.= " WHERE active = 1"; //$sql.= " ORDER BY code ASC"; @@ -490,7 +477,7 @@ class Form $resql=$this->db->query($sql); if ($resql) { - $out.= ''; $num = $this->db->num_rows($resql); $i = 0; if ($num) @@ -3436,10 +3423,10 @@ class Form if ($num > 0) return $num; // Cache deja charge $sql = "SELECT DISTINCT t.taux, t.recuperableonly"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE t.fk_pays = p.rowid"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE t.fk_pays = c.rowid"; $sql.= " AND t.active = 1"; - $sql.= " AND p.code IN (".$country_code.")"; + $sql.= " AND c.code IN (".$country_code.")"; $sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC"; $resql=$this->db->query($sql); @@ -3523,14 +3510,14 @@ class Form //exit; // Define list of countries to use to search VAT rates to show - // First we defined code_pays to use to find list + // First we defined code_country to use to find list if (is_object($societe_vendeuse)) { - $code_pays="'".$societe_vendeuse->country_code."'"; + $code_country="'".$societe_vendeuse->country_code."'"; } else { - $code_pays="'".$mysoc->country_code."'"; // Pour compatibilite ascendente + $code_country="'".$mysoc->country_code."'"; // Pour compatibilite ascendente } if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on { @@ -3541,12 +3528,12 @@ class Form { if ($type == 1) // We know product is a service { - $code_pays.=",'".$societe_acheteuse->country_code."'"; + $code_country.=",'".$societe_acheteuse->country_code."'"; } } else if (! $idprod) // We don't know type of product { - $code_pays.=",'".$societe_acheteuse->country_code."'"; + $code_country.=",'".$societe_acheteuse->country_code."'"; } else { @@ -3554,14 +3541,14 @@ class Form $prodstatic->fetch($idprod); if ($prodstatic->type == 1) // We know product is a service { - $code_pays.=",'".$societe_acheteuse->country_code."'"; + $code_country.=",'".$societe_acheteuse->country_code."'"; } } } } // Now we get list - $num = $this->load_cache_vatrates($code_pays); + $num = $this->load_cache_vatrates($code_country); if ($num > 0) { // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '') diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index fd7db5fa94f..8b435b9497a 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -222,13 +222,13 @@ class FormCompany $out=''; // On recherche les departements/cantons/province active d'une region et pays actif - $sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, p.libelle as country, p.code as country_code FROM"; - $sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid"; - $sql .= " AND d.active = 1 AND r.active = 1 AND p.active = 1"; - if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND p.rowid = '".$country_codeid."'"; - if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND p.code = '".$country_codeid."'"; - $sql .= " ORDER BY p.code, d.code_departement"; + $sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, c.label as country, c.code as country_code FROM"; + $sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; + $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1"; + if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND c.rowid = '".$country_codeid."'"; + if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND c.code = '".$country_codeid."'"; + $sql .= " ORDER BY c.code, d.code_departement"; dol_syslog(get_class($this)."::select_departement", LOG_DEBUG); $result=$this->db->query($sql); @@ -303,9 +303,10 @@ class FormCompany global $conf,$langs; $langs->load("dict"); - $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, p.code as country_code, p.libelle as country FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1"; - $sql.= " ORDER BY p.code, p.libelle ASC"; + $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, c.code as country_code, c.label as country"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1"; + $sql.= " ORDER BY c.code, c.label ASC"; dol_syslog(get_class($this)."::select_region", LOG_DEBUG); $resql=$this->db->query($sql); @@ -335,11 +336,11 @@ class FormCompany if ($selected > 0 && $selected == $obj->code) { - print ''; + print ''; } else { - print ''; + print ''; } } $i++; @@ -440,13 +441,13 @@ class FormCompany $out=''; // On recherche les formes juridiques actives des pays actifs - $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, p.libelle as country, p.code as country_code"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE f.fk_pays=p.rowid"; - $sql .= " AND f.active = 1 AND p.active = 1"; - if ($country_codeid) $sql .= " AND p.code = '".$country_codeid."'"; + $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE f.fk_pays=c.rowid"; + $sql .= " AND f.active = 1 AND c.active = 1"; + if ($country_codeid) $sql .= " AND c.code = '".$country_codeid."'"; if ($filter) $sql .= " ".$filter; - $sql .= " ORDER BY p.code"; + $sql .= " ORDER BY c.code"; dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 4b4b5f5b729..968dcd3856e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -164,10 +164,10 @@ class FormOther global $langs; $sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,"; - $sql.= " p.libelle as pays"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid"; - $sql.= " ORDER BY pays, e.organization ASC, e.code ASC"; + $sql.= " c.label as country"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE e.active = 1 AND e.fk_pays = c.rowid"; + $sql.= " ORDER BY country, e.organization ASC, e.code ASC"; dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG); $resql=$this->db->query($sql); @@ -223,9 +223,9 @@ class FormOther $out=''; $sql = "SELECT r.taux"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid"; - $sql.= " AND p.code = '".$country_code."'"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE r.active = 1 AND r.fk_pays = c.rowid"; + $sql.= " AND c.code = '".$country_code."'"; dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG); $resql=$this->db->query($sql); diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index b3c5a4c7d9c..abf453cf426 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -73,9 +73,9 @@ class FormSocialContrib else { $sql = "SELECT c.id, c.libelle as type"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE c.active = 1 AND c.fk_pays = p.rowid"; - $sql.= " AND p.code = '".$mysoc->country_code."'"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_country as co"; + $sql.= " WHERE c.active = 1 AND c.fk_pays = co.rowid"; + $sql.= " AND co.code = '".$mysoc->country_code."'"; $sql.= " ORDER BY c.libelle ASC"; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index bd5f19e2401..3e1c7767c4c 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -262,10 +262,10 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv= if (! is_object($dbtouse)) $dbtouse=$db; if (! is_object($outputlangs)) $outputlangs=$langs; - $sql = "SELECT rowid, code, libelle FROM ".MAIN_DB_PREFIX."c_pays"; + $sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country"; if (is_numeric($searchkey)) $sql.= " WHERE rowid=".$searchkey; elseif (! empty($searchkey)) $sql.= " WHERE code='".$db->escape($searchkey)."'"; - else $sql.= " WHERE libelle='".$db->escape($searchlabel)."'"; + else $sql.= " WHERE label='".$db->escape($searchlabel)."'"; dol_syslog("Company.lib::getCountry", LOG_DEBUG); $resql=$dbtouse->query($sql); @@ -274,7 +274,7 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv= $obj = $dbtouse->fetch_object($resql); if ($obj) { - $label=((! empty($obj->libelle) && $obj->libelle!='-')?$obj->libelle:''); + $label=((! empty($obj->label) && $obj->label!='-')?$obj->label:''); if (is_object($outputlangs)) { $outputlangs->load("dict"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f3add9e66c8..95794fd50d7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2989,8 +2989,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'"; $sql .= " AND t.taux = ".$tva." AND t.active = 1"; dol_syslog("get_localtax", LOG_DEBUG); @@ -3037,11 +3037,11 @@ function isOnlyOneLocalTax($local) function get_localtax_by_third($local) { global $db, $mysoc; - $sql="SELECT t.localtax1, t.localtax2 "; - $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=t.fk_pays"; - $sql.=" WHERE p.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)"; - $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=tt.fk_pays"; - $sql.= " WHERE p.code = '".$mysoc->country_code."')"; + $sql ="SELECT t.localtax1, t.localtax2 "; + $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays"; + $sql.=" WHERE c.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)"; + $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays"; + $sql.=" WHERE c.code = '".$mysoc->country_code."')"; $resql=$db->query($sql); if ($resql) @@ -3077,8 +3077,8 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller) // Search local taxes $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$buyer->country_code."'"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; $sql .= " AND t.taux = ".$vatrate." AND t.active = 1"; $resql=$db->query($sql); @@ -3212,8 +3212,8 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr { // If vat of product for the country not found or not defined, we return higher vat of country. $sql = "SELECT taux as vat_rate"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= $db->plimit(1); @@ -3282,8 +3282,8 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) { // If vat of product for the country not found or not defined, we return higher vat of country. $sql = "SELECT taux as vat_rate, localtax1, localtax2"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= $db->plimit(1); diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 40da5f73db8..8c1da0b3668 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -192,7 +192,7 @@ class modAdherent extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as extra ON a.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'cotisation as c ON c.fk_adherent = a.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.country = p.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON a.country = c.rowid'; $this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid'; $this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index ec53754440f..8d7b930df08 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -371,20 +371,20 @@ class modAgenda extends DolibarrModules 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp", 'cac.libelle'=>"ActionType", 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town', - 'cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4', + 'co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra'); $this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", 'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number", 'ac.durationp'=>"Duree", 'cac.libelle'=>"List:c_actioncomm:libelle:rowid", 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', - 'cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', + 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text'); $this->export_entities_array[$r]=array('ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action", 'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action", 'cac.libelle'=>"action", 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company', - 'cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', + 'co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',); $this->export_sql_start[$r]='SELECT DISTINCT '; @@ -392,7 +392,7 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as cp on s.fk_pays = cp.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity; $this->export_sql_end[$r] .=' ORDER BY datep'; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 24a9ee5ef94..a74f4aeff7b 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -116,11 +116,11 @@ class modCategorie extends DolibarrModules $this->export_icon[$r]='category'; $this->export_enabled[$r]='$conf->fournisseur->enabled'; $this->export_permission[$r]=array(array("categorie","lire"),array("fournisseur","lire")); - $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic"); - $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text"); - $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company"); // We define here only fields that use another picto + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'c.label'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic"); + $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text"); + $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'c.label'=>"company",'c.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company"); // We define here only fields that use another picto $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories @@ -131,11 +131,11 @@ class modCategorie extends DolibarrModules $this->export_icon[$r]='category'; $this->export_enabled[$r]='$conf->societe->enabled'; $this->export_permission[$r]=array(array("categorie","lire"),array("societe","lire")); - $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus'); - $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code'); - $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto + $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'c.country'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus'); + $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code'); + $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'c.label'=>"company",'c.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto $this->export_sql_start[$r]='SELECT DISTINCT '; - $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories @@ -231,7 +231,7 @@ class modCategorie extends DolibarrModules ); // We define here only fields that use another picto $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p'; - $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_pays as country ON p.fk_pays = country.rowid'; + $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid'; $this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity = ' . $conf->entity; $this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 22197c9beff..7a9434ab934 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -173,15 +173,15 @@ class modCommande extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("commande","commande","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.libelle'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.libelle'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.label'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.label'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as co ON s.fk_pays = co.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 0d39edd40fa..20c679556e7 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -216,15 +216,15 @@ class modExpedition extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("expedition","shipment","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.libelle'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note_public'=>"Text",'ed.qty'=>"Number"); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.label'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note_public'=>"Text",'ed.qty'=>"Number"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c, '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as co ON s.fk_pays = co.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 02a3972e05d..5bb85dea7db 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -219,7 +219,7 @@ class modFacture extends DolibarrModules // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; @@ -275,7 +275,7 @@ class modFacture extends DolibarrModules // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index f54e4fef497..45d8a0fa7bc 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -139,8 +139,8 @@ class modFicheinter extends DolibarrModules $this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("ficheinter","export")); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc"); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line'); $this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 92c27bb11f9..1f1a8072e1e 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -291,7 +291,7 @@ class modFournisseur extends DolibarrModules // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; @@ -345,7 +345,7 @@ class modFournisseur extends DolibarrModules // End add axtra fields $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; @@ -365,7 +365,7 @@ class modFournisseur extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f, '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index d9d2817759f..97ddc6afaba 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -190,7 +190,7 @@ class modProjet extends DolibarrModules $this->export_permission[$r]=array(array("projet","export")); $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); - $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', + $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Number",'pt.progress'=>"Number",'pt.description'=>"Text", diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 5e81edc87f5..e97005c37be 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -169,15 +169,15 @@ class modPropale extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("propale","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text'); - $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note_public'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text'); + $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note_public'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s '; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as cp ON s.fk_pays = cp.rowid,'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c, '.MAIN_DB_PREFIX.'propaldet as cd'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal'; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 746046cb3da..785e1da28b9 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -266,8 +266,8 @@ class modSociete extends DolibarrModules $this->export_permission[$r]=array(array("societe","export")); $this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','st.code'=>'ProspectStatus','d.nom'=>'State'); if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; - //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); - $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); + //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); + $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); $this->export_entities_array[$r]=array(); // We define here only fields that use another picto // Add extra fields $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'"; @@ -307,7 +307,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; @@ -320,8 +320,8 @@ class modSociete extends DolibarrModules $this->export_label[$r]='ExportDataset_company_2'; $this->export_icon[$r]='contact'; $this->export_permission[$r]=array(array("societe","contact","export")); - $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1'); - $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text"); + $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','co.label'=>"Country",'c.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1'); + $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','co.label'=>"List:c_country:label:rowid",'co.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text"); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto if (empty($conf->fournisseur->enabled)) { @@ -366,7 +366,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON c.fk_pays = p.rowid'; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; $this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')'; @@ -399,7 +399,7 @@ class modSociete extends DolibarrModules $this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'societe'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r]=array( 's.fk_typent'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'), - 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry'), + 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_stcomm'=>array('rule'=>'zeroifnull'), 's.code_client'=>array('rule'=>'getcustomercodeifauto'), 's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'), @@ -434,7 +434,7 @@ class modSociete extends DolibarrModules $this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'socpeople'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r]=array( 's.fk_soc'=>array('rule'=>'fetchidfromref','file'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'), - 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry'), + 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'), ); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 8a13fff5bc9..43c7cec6fb3 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -154,7 +154,7 @@ class modStock extends DolibarrModules ); $this->import_convertvalue_array[$r]=array( - 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry') + 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry') ); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_examplevalues_array[$r]=array('e.label'=>"ALM001", diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index cbaf3277be8..8ac1f6e6d48 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -732,7 +732,7 @@ if ($step == 3 && $datatoexport) // Filter value print ''; - if (! empty($Typefieldsarray[$code])) // Example: Text, List:c_pays:libelle:rowid, Number, Boolean + if (! empty($Typefieldsarray[$code])) // Example: Text, List:c_country:label:rowid, Number, Boolean { $szInfoFiltre=$objexport->genDocFilter($Typefieldsarray[$code]); if ($szInfoFiltre) // Is there an info help for this filter ? diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_pays.sql index 6db4454f3c2..497b85d4059 100644 --- a/htdocs/install/mysql/data/llx_00_c_pays.sql +++ b/htdocs/install/mysql/data/llx_00_c_pays.sql @@ -25,248 +25,248 @@ -- Countries -- --- delete from llx_c_pays; -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (0,'',NULL,'-',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (1,'FR','FRA','France',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (2,'BE','BEL','Belgium',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (3,'IT','ITA','Italy',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (4,'ES','ESP','Spain',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (5,'DE','DEU','Germany',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (6,'CH','CHE','Switzerland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (7,'GB','GBR','United Kingdom',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (8,'IE','IRL','Irland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (9,'CN','CHN','China',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (10,'TN','TUN','Tunisia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (11,'US','USA','United States',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (12,'MA','MAR','Maroc',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (13,'DZ','DZA','Algeria',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (14,'CA','CAN','Canada',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (15,'TG','TGO','Togo',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (16,'GA','GAB','Gabon',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (17,'NL','NLD','Nerderland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (18,'HU','HUN','Hongrie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (19,'RU','RUS','Russia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (20,'SE','SWE','Sweden',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (22,'SN','SEN','Senegal',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (23,'AR','ARG','Argentine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (24,'CM','CMR','Cameroun',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (25,'PT','PRT','Portugal',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (26,'SA','SAU','Saudi Arabia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (27,'MC','MCO','Monaco',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (28,'AU','AUS','Australia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (29,'SG','SGP','Singapour',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (30,'AF','AFG','Afghanistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (31,'AX','ALA','Iles Aland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (32,'AL','ALB','Albanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (33,'AS','ASM','Samoa américaines',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (34,'AD','AND','Andorre',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (35,'AO','AGO','Angola',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (36,'AI','AIA','Anguilla',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (37,'AQ','ATA','Antarctique',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (39,'AM','ARM','Arménie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (40,'AW','ABW','Aruba',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (41,'AT','AUT','Autriche',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (43,'BS','BHS','Bahamas',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (44,'BH','BHR','Bahreïn',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (45,'BD','BGD','Bangladesh',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (46,'BB','BRB','Barbade',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (47,'BY','BLR','Biélorussie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (48,'BZ','BLZ','Belize',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (49,'BJ','BEN','Bénin',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (50,'BM','BMU','Bermudes',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (51,'BT','BTN','Bhoutan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (52,'BO','BOL','Bolivie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (54,'BW','BWA','Botswana',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (55,'BV','BVT','Ile Bouvet',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (56,'BR','BRA','Brazil',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (58,'BN','BRN','Brunei',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (59,'BG','BGR','Bulgarie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (60,'BF','BFA','Burkina Faso',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (61,'BI','BDI','Burundi',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (62,'KH','KHM','Cambodge',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (63,'CV','CPV','Cap-Vert',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (64,'KY','CYM','Iles Cayman',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (65,'CF','CAF','République centrafricaine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (66,'TD','TCD','Tchad',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (67,'CL','CHL','Chili',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (68,'CX','CXR','Ile Christmas',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (70,'CO','COL','Colombie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (71,'KM','COM','Comores',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (72,'CG','COG','Congo',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (73,'CD','COD','République démocratique du Congo',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (74,'CK','COK','Iles Cook',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (75,'CR','CRI','Costa Rica',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (76,'HR','HRV','Croatie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (77,'CU','CUB','Cuba',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (78,'CY','CYP','Chypre',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (79,'CZ','CZE','République Tchèque',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (80,'DK','DNK','Danemark',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (81,'DJ','DJI','Djibouti',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (82,'DM','DMA','Dominique',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (83,'DO','DOM','République Dominicaine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (84,'EC','ECU','Equateur',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (85,'EG','EGY','Egypte',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (86,'SV','SLV','Salvador',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (88,'ER','ERI','Erythrée',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (89,'EE','EST','Estonia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (90,'ET','ETH','Ethiopie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (91,'FK','FLK','Iles Falkland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (92,'FO','FRO','Iles Féroé',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (93,'FJ','FJI','Iles Fidji',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (94,'FI','FIN','Finlande',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (95,'GF','GUF','Guyane française',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (96,'PF','PYF','Polynésie française',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (97,'TF','ATF','Terres australes françaises',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (98,'GM','GMB','Gambie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (99,'GE','GEO','Georgia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (100,'GH','GHA','Ghana',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (101,'GI','GIB','Gibraltar',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (102,'GR','GRC','Greece',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (103,'GL','GRL','Groenland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (104,'GD','GRD','Grenade',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (106,'GU','GUM','Guam',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (107,'GT','GTM','Guatemala',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (108,'GN','GIN','Guinea',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (109,'GW','GNB','Guinea-Bissao',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (111,'HT','HTI','Haiti',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (114,'HN','HND','Honduras',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (115,'HK','HKG','Hong Kong',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (116,'IS','ISL','Islande',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (117,'IN','IND','India',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (118,'ID','IDN','Indonésie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (119,'IR','IRN','Iran',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (120,'IQ','IRQ','Iraq',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (121,'IL','ISR','Israel',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (122,'JM','JAM','Jamaïque',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (123,'JP','JPN','Japon',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (124,'JO','JOR','Jordanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (125,'KZ','KAZ','Kazakhstan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (126,'KE','KEN','Kenya',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (127,'KI','KIR','Kiribati',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (128,'KP','PRK','North Corea',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (129,'KR','KOR','South Corea',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (130,'KW','KWT','Koweït',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (131,'KG','KGZ','Kirghizistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (132,'LA','LAO','Laos',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (133,'LV','LVA','Lettonie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (134,'LB','LBN','Liban',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (135,'LS','LSO','Lesotho',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (136,'LR','LBR','Liberia',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (137,'LY','LBY','Libye',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (138,'LI','LIE','Liechtenstein',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (139,'LT','LTU','Lituanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (140,'LU','LUX','Luxembourg',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (141,'MO','MAC','Macao',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (143,'MG','MDG','Madagascar',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (144,'MW','MWI','Malawi',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (145,'MY','MYS','Malaisie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (146,'MV','MDV','Maldives',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (147,'ML','MLI','Mali',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (148,'MT','MLT','Malte',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (149,'MH','MHL','Iles Marshall',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (151,'MR','MRT','Mauritanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (152,'MU','MUS','Maurice',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (153,'YT','MYT','Mayotte',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (154,'MX','MEX','Mexique',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (155,'FM','FSM','Micronésie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (156,'MD','MDA','Moldavie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (157,'MN','MNG','Mongolie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (158,'MS','MSR','Monserrat',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (159,'MZ','MOZ','Mozambique',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (161,'NA','NAM','Namibie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (162,'NR','NRU','Nauru',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (163,'NP','NPL','Népal',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (167,'NI','NIC','Nicaragua',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (168,'NE','NER','Niger',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (169,'NG','NGA','Nigeria',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (170,'NU','NIU','Nioué',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (171,'NF','NFK','Ile Norfolk',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (172,'MP','MNP','Mariannes du Nord',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (173,'NO','NOR','Norvège',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (174,'OM','OMN','Oman',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (175,'PK','PAK','Pakistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (176,'PW','PLW','Palaos',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (178,'PA','PAN','Panama',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (180,'PY','PRY','Paraguay',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (181,'PE','PER','Peru',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (182,'PH','PHL','Philippines',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (183,'PN','PCN','Iles Pitcairn',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (184,'PL','POL','Pologne',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (185,'PR','PRI','Porto Rico',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (186,'QA','QAT','Qatar',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (188,'RO','ROU','Roumanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (189,'RW','RWA','Rwanda',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (190,'SH','SHN','Sainte-Hélène',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (192,'LC','LCA','Sainte-Lucie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (195,'WS','WSM','Samoa',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (196,'SM','SMR','Saint-Marin',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (198,'RS','SRB','Serbie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (199,'SC','SYC','Seychelles',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (200,'SL','SLE','Sierra Leone',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (201,'SK','SVK','Slovaquie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (202,'SI','SVN','Slovénie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (203,'SB','SLB','Iles Salomon',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (204,'SO','SOM','Somalie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (207,'LK','LKA','Sri Lanka',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (208,'SD','SDN','Soudan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (209,'SR','SUR','Suriname',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (211,'SZ','SWZ','Swaziland',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (212,'SY','SYR','Syrie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (213,'TW','TWN','Taïwan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (214,'TJ','TJK','Tadjikistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (215,'TZ','TZA','Tanzanie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (216,'TH','THA','Thaïlande',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (217,'TL','TLS','Timor Oriental',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (218,'TK','TKL','Tokélaou',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (219,'TO','TON','Tonga',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (221,'TR','TUR','Turquie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (222,'TM','TKM','Turkménistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (224,'TV','TUV','Tuvalu',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (225,'UG','UGA','Ouganda',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (226,'UA','UKR','Ukraine',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (227,'AE','ARE','Émirats arabes unis',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (229,'UY','URY','Uruguay',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (230,'UZ','UZB','Ouzbékistan',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (231,'VU','VUT','Vanuatu',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (232,'VE','VEN','Vénézuela',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (233,'VN','VNM','Viêt Nam',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (237,'EH','ESH','Sahara occidental',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (238,'YE','YEM','Yémen',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (239,'ZM','ZMB','Zambie',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (240,'ZW','ZWE','Zimbabwe',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (241,'GG','GGY','Guernesey',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (242,'IM','IMN','Ile de Man',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (243,'JE','JEY','Jersey',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (244,'ME','MNE','Monténégro',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (246,'MF','MAF','Saint-Martin',1); -INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (247,'BU', null, 'Burundi',1); +-- delete from llx_c_country; +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (0,'',NULL,'-',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (1,'FR','FRA','France',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (2,'BE','BEL','Belgium',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (3,'IT','ITA','Italy',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (4,'ES','ESP','Spain',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (5,'DE','DEU','Germany',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (6,'CH','CHE','Switzerland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (7,'GB','GBR','United Kingdom',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (8,'IE','IRL','Irland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (9,'CN','CHN','China',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (10,'TN','TUN','Tunisia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (11,'US','USA','United States',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (12,'MA','MAR','Maroc',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (13,'DZ','DZA','Algeria',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (14,'CA','CAN','Canada',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (15,'TG','TGO','Togo',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (16,'GA','GAB','Gabon',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (17,'NL','NLD','Nerderland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (18,'HU','HUN','Hongrie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (19,'RU','RUS','Russia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (20,'SE','SWE','Sweden',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (22,'SN','SEN','Senegal',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (23,'AR','ARG','Argentine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (24,'CM','CMR','Cameroun',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (25,'PT','PRT','Portugal',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (26,'SA','SAU','Saudi Arabia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (27,'MC','MCO','Monaco',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (28,'AU','AUS','Australia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (29,'SG','SGP','Singapour',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (30,'AF','AFG','Afghanistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (31,'AX','ALA','Iles Aland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (32,'AL','ALB','Albanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (33,'AS','ASM','Samoa américaines',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (34,'AD','AND','Andorre',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (35,'AO','AGO','Angola',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (36,'AI','AIA','Anguilla',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (37,'AQ','ATA','Antarctique',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (39,'AM','ARM','Arménie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (40,'AW','ABW','Aruba',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (41,'AT','AUT','Autriche',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (43,'BS','BHS','Bahamas',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (44,'BH','BHR','Bahreïn',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (45,'BD','BGD','Bangladesh',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (46,'BB','BRB','Barbade',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (47,'BY','BLR','Biélorussie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (48,'BZ','BLZ','Belize',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (49,'BJ','BEN','Bénin',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (50,'BM','BMU','Bermudes',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (51,'BT','BTN','Bhoutan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (52,'BO','BOL','Bolivie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (54,'BW','BWA','Botswana',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (55,'BV','BVT','Ile Bouvet',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (56,'BR','BRA','Brazil',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (58,'BN','BRN','Brunei',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (59,'BG','BGR','Bulgarie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (60,'BF','BFA','Burkina Faso',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (61,'BI','BDI','Burundi',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (62,'KH','KHM','Cambodge',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (63,'CV','CPV','Cap-Vert',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (64,'KY','CYM','Iles Cayman',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (65,'CF','CAF','République centrafricaine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (66,'TD','TCD','Tchad',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (67,'CL','CHL','Chili',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (68,'CX','CXR','Ile Christmas',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (70,'CO','COL','Colombie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (71,'KM','COM','Comores',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (72,'CG','COG','Congo',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (73,'CD','COD','République démocratique du Congo',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (74,'CK','COK','Iles Cook',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (75,'CR','CRI','Costa Rica',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (76,'HR','HRV','Croatie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (77,'CU','CUB','Cuba',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (78,'CY','CYP','Chypre',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (79,'CZ','CZE','République Tchèque',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (80,'DK','DNK','Danemark',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (81,'DJ','DJI','Djibouti',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (82,'DM','DMA','Dominique',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (83,'DO','DOM','République Dominicaine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (84,'EC','ECU','Equateur',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (85,'EG','EGY','Egypte',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (86,'SV','SLV','Salvador',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (88,'ER','ERI','Erythrée',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (89,'EE','EST','Estonia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (90,'ET','ETH','Ethiopie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (91,'FK','FLK','Iles Falkland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (92,'FO','FRO','Iles Féroé',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (93,'FJ','FJI','Iles Fidji',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (94,'FI','FIN','Finlande',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (95,'GF','GUF','Guyane française',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (96,'PF','PYF','Polynésie française',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (97,'TF','ATF','Terres australes françaises',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (98,'GM','GMB','Gambie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (99,'GE','GEO','Georgia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (100,'GH','GHA','Ghana',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (101,'GI','GIB','Gibraltar',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (102,'GR','GRC','Greece',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (103,'GL','GRL','Groenland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (104,'GD','GRD','Grenade',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (106,'GU','GUM','Guam',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (107,'GT','GTM','Guatemala',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (108,'GN','GIN','Guinea',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (109,'GW','GNB','Guinea-Bissao',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (111,'HT','HTI','Haiti',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (114,'HN','HND','Honduras',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (115,'HK','HKG','Hong Kong',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (116,'IS','ISL','Islande',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (117,'IN','IND','India',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (118,'ID','IDN','Indonésie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (119,'IR','IRN','Iran',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (120,'IQ','IRQ','Iraq',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (121,'IL','ISR','Israel',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (122,'JM','JAM','Jamaïque',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (123,'JP','JPN','Japon',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (124,'JO','JOR','Jordanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (125,'KZ','KAZ','Kazakhstan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (126,'KE','KEN','Kenya',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (127,'KI','KIR','Kiribati',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (128,'KP','PRK','North Corea',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (129,'KR','KOR','South Corea',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (130,'KW','KWT','Koweït',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (131,'KG','KGZ','Kirghizistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (132,'LA','LAO','Laos',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (133,'LV','LVA','Lettonie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (134,'LB','LBN','Liban',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (135,'LS','LSO','Lesotho',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (136,'LR','LBR','Liberia',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (137,'LY','LBY','Libye',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (138,'LI','LIE','Liechtenstein',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (139,'LT','LTU','Lituanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (140,'LU','LUX','Luxembourg',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (141,'MO','MAC','Macao',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (143,'MG','MDG','Madagascar',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (144,'MW','MWI','Malawi',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (145,'MY','MYS','Malaisie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (146,'MV','MDV','Maldives',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (147,'ML','MLI','Mali',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (148,'MT','MLT','Malte',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (149,'MH','MHL','Iles Marshall',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (151,'MR','MRT','Mauritanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (152,'MU','MUS','Maurice',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (153,'YT','MYT','Mayotte',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (154,'MX','MEX','Mexique',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (155,'FM','FSM','Micronésie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (156,'MD','MDA','Moldavie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (157,'MN','MNG','Mongolie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (158,'MS','MSR','Monserrat',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (159,'MZ','MOZ','Mozambique',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (161,'NA','NAM','Namibie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (162,'NR','NRU','Nauru',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (163,'NP','NPL','Népal',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (167,'NI','NIC','Nicaragua',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (168,'NE','NER','Niger',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (169,'NG','NGA','Nigeria',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (170,'NU','NIU','Nioué',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (171,'NF','NFK','Ile Norfolk',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (172,'MP','MNP','Mariannes du Nord',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (173,'NO','NOR','Norvège',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (174,'OM','OMN','Oman',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (175,'PK','PAK','Pakistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (176,'PW','PLW','Palaos',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (178,'PA','PAN','Panama',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (180,'PY','PRY','Paraguay',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (181,'PE','PER','Peru',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (182,'PH','PHL','Philippines',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (183,'PN','PCN','Iles Pitcairn',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (184,'PL','POL','Pologne',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (185,'PR','PRI','Porto Rico',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (186,'QA','QAT','Qatar',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (188,'RO','ROU','Roumanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (189,'RW','RWA','Rwanda',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (190,'SH','SHN','Sainte-Hélène',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (192,'LC','LCA','Sainte-Lucie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (195,'WS','WSM','Samoa',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (196,'SM','SMR','Saint-Marin',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (198,'RS','SRB','Serbie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (199,'SC','SYC','Seychelles',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (200,'SL','SLE','Sierra Leone',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (201,'SK','SVK','Slovaquie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (202,'SI','SVN','Slovénie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (203,'SB','SLB','Iles Salomon',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (204,'SO','SOM','Somalie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (207,'LK','LKA','Sri Lanka',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (208,'SD','SDN','Soudan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (209,'SR','SUR','Suriname',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (211,'SZ','SWZ','Swaziland',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (212,'SY','SYR','Syrie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (213,'TW','TWN','Taïwan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (214,'TJ','TJK','Tadjikistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (215,'TZ','TZA','Tanzanie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (216,'TH','THA','Thaïlande',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (217,'TL','TLS','Timor Oriental',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (218,'TK','TKL','Tokélaou',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (219,'TO','TON','Tonga',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (221,'TR','TUR','Turquie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (222,'TM','TKM','Turkménistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (224,'TV','TUV','Tuvalu',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (225,'UG','UGA','Ouganda',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (226,'UA','UKR','Ukraine',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (227,'AE','ARE','Émirats arabes unis',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (229,'UY','URY','Uruguay',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (230,'UZ','UZB','Ouzbékistan',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (231,'VU','VUT','Vanuatu',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (232,'VE','VEN','Vénézuela',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (233,'VN','VNM','Viêt Nam',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (237,'EH','ESH','Sahara occidental',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (238,'YE','YEM','Yémen',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (239,'ZM','ZMB','Zambie',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (240,'ZW','ZWE','Zimbabwe',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (241,'GG','GGY','Guernesey',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (242,'IM','IMN','Ile de Man',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (243,'JE','JEY','Jersey',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (244,'ME','MNE','Monténégro',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (246,'MF','MAF','Saint-Martin',1); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (247,'BU', null, 'Burundi',1); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 54aea6de52d..f15c212f0a8 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -72,6 +72,13 @@ ALTER TABLE llx_localtax ADD COLUMN localtaxtype tinyint(4) after entity; ALTER TABLE llx_societe ADD COLUMN localtax1_value double(6,3) after localtax1_assuj; ALTER TABLE llx_societe ADD COLUMN localtax2_value double(6,3) after localtax2_assuj; +-- Change on table c_pays +ALTER TABLE llx_c_pays RENAME TO llx_c_country; + +ALTER TABLE llx_c_country CHANGE libelle label VARCHAR(50); + +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid); +ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid); -- Added missing relations of llx_product @@ -81,7 +88,7 @@ ALTER TABLE llx_product MODIFY COLUMN fk_country INTEGER NULL DEFAULT NULL; -- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_country SET DEFAULT NULL; UPDATE llx_product SET fk_country = NULL WHERE fk_country = 0; ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country); -ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid); -- fk_user_author ALTER TABLE llx_product MODIFY COLUMN fk_user_author INTEGER NULL DEFAULT NULL; -- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_user_author DROP NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_c_pays.key.sql b/htdocs/install/mysql/tables/llx_c_country.key.sql similarity index 79% rename from htdocs/install/mysql/tables/llx_c_pays.key.sql rename to htdocs/install/mysql/tables/llx_c_country.key.sql index 6714a0644b2..b65d78d559f 100644 --- a/htdocs/install/mysql/tables/llx_c_pays.key.sql +++ b/htdocs/install/mysql/tables/llx_c_country.key.sql @@ -17,6 +17,6 @@ -- ======================================================================== -ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code (code); -ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code_iso (code_iso); -ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_libelle (libelle); +ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_code (code); +ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_code_iso (code_iso); +ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_label (label); diff --git a/htdocs/install/mysql/tables/llx_c_pays.sql b/htdocs/install/mysql/tables/llx_c_country.sql similarity index 94% rename from htdocs/install/mysql/tables/llx_c_pays.sql rename to htdocs/install/mysql/tables/llx_c_country.sql index 6f4401d5110..f9c69a5093b 100644 --- a/htdocs/install/mysql/tables/llx_c_pays.sql +++ b/htdocs/install/mysql/tables/llx_c_country.sql @@ -17,11 +17,11 @@ -- -- ======================================================================== -create table llx_c_pays +create table llx_c_country ( rowid integer PRIMARY KEY, code varchar(2) NOT NULL, code_iso varchar(3) , - libelle varchar(50) NOT NULL, + label varchar(50) NOT NULL, active tinyint DEFAULT 1 NOT NULL )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_regions.key.sql b/htdocs/install/mysql/tables/llx_c_regions.key.sql index 838396d5d57..21377f54fa7 100644 --- a/htdocs/install/mysql/tables/llx_c_regions.key.sql +++ b/htdocs/install/mysql/tables/llx_c_regions.key.sql @@ -18,4 +18,4 @@ ALTER TABLE llx_c_regions ADD INDEX idx_c_regions_fk_pays (fk_pays); -ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid); diff --git a/htdocs/install/mysql/tables/llx_c_ziptown.key.sql b/htdocs/install/mysql/tables/llx_c_ziptown.key.sql index 3bc138d8816..9d4ff705d04 100644 --- a/htdocs/install/mysql/tables/llx_c_ziptown.key.sql +++ b/htdocs/install/mysql/tables/llx_c_ziptown.key.sql @@ -23,6 +23,6 @@ ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_pays (fk_pays); ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_zip (zip); ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid); -ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays(rowid); +ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country(rowid); ALTER TABLE llx_c_ziptown ADD UNIQUE INDEX uk_ziptown_fk_pays (zip, town, fk_pays); diff --git a/htdocs/install/mysql/tables/llx_c_ziptown.sql b/htdocs/install/mysql/tables/llx_c_ziptown.sql index 11a0dfe0350..0eaab74af20 100644 --- a/htdocs/install/mysql/tables/llx_c_ziptown.sql +++ b/htdocs/install/mysql/tables/llx_c_ziptown.sql @@ -21,7 +21,7 @@ create table llx_c_ziptown rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, code varchar(5) DEFAULT NULL, -- ex: code insee pour la France fk_county integer, -- State id in llx_c_departements - fk_pays integer NOT NULL DEFAULT 0, -- Country id in llx_c_pays + fk_pays integer NOT NULL DEFAULT 0, -- Country id in llx_c_country zip varchar(10) NOT NULL, -- Zip code town varchar(255) NOT NULL, -- Town name active tinyint NOT NULL DEFAULT 1 diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index 218bd40490e..fb471910230 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -32,5 +32,5 @@ ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type); ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity); -ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); +ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid); diff --git a/htdocs/societe/ajaxcountries.php b/htdocs/societe/ajaxcountries.php index 78018a22035..7eb22035d6b 100644 --- a/htdocs/societe/ajaxcountries.php +++ b/htdocs/societe/ajaxcountries.php @@ -31,7 +31,7 @@ if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); require '../main.inc.php'; -$country=GETPOST('pays', 'alpha'); +$country=GETPOST('country', 'alpha'); /* @@ -49,16 +49,16 @@ print ' @@ -61,8 +63,8 @@ $(document).ready(function () { - - + +
    diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1624a8222bd..dc1eca63322 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -81,6 +81,7 @@ MustBeLowerThanPHPLimit=Remarque : Votre PHP limite la taille des envois à NoMaxSizeByPHPLimit=Aucune limite configurée dans votre serveur PHP MaxSizeForUploadedFiles=Taille maximum des fichiers envoyés (0 pour interdire l'envoi) UseCaptchaCode=Utilisation du code graphique (CAPTCHA) sur la page de connexion +HiddeNumVersion=Cacher le numero de version sur la page de login UseAvToScanUploadedFiles=Utiliser un antivirus pour vérifier les fichiers envoyés AntiVirusCommand= Chemin complet vers la commande antivirus AntiVirusCommandExample= Exemple pour ClamWin : c:\\Progra~1\\ClamWin\\bin\\clamscan.exe
    Exemple pour ClamAv : /usr/bin/clamscan From db7478098a42219b5c52a05dcbf3b17b3e1b7d96 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 12 Aug 2014 13:26:06 +0200 Subject: [PATCH 453/502] Add a real free numbering module for contract --- ChangeLog | 1 + htdocs/contrat/class/contrat.class.php | 25 ++++- htdocs/contrat/fiche.php | 56 +++++++-- .../modules/contract/mod_contract_magre.php | 1 + .../modules/contract/mod_contract_olive.php | 106 ++++++++++++++++++ .../modules/contract/mod_contract_serpis.php | 1 + 6 files changed, 177 insertions(+), 13 deletions(-) create mode 100644 htdocs/core/modules/contract/mod_contract_olive.php diff --git a/ChangeLog b/ChangeLog index 5145e6505e3..681455af224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,7 @@ For users: - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - New: [ task #1204 ] add a External reference to contract +- New: [ task #1204 ] add Numering contrat module free (like leopard in product module) For translators: - Update language files. diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e6a26a8b9d4..709888dffed 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -743,13 +743,28 @@ class Contrat extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat"); - // Mise a jour ref - $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; - if ($this->db->query($sql)) + + // Load object modContract + $module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive'); + if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') { - if ($this->id) + $module = substr($module, 0, dol_strlen($module)-4); + } + $result=dol_include_once('/core/modules/contract/'.$module.'.php'); + if ($result > 0) + { + $modCodeContract = new $module(); + } + + if (!empty($modCodeContract->code_auto)) { + // Mise a jour ref + $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; + if ($this->db->query($sql)) { - $this->ref="(PROV".$this->id.")"; + if ($this->id) + { + $this->ref="(PROV".$this->id.")"; + } } } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index de97b870c08..38f4ba9a8c4 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -342,7 +342,7 @@ if ($action == 'add' && $user->rights->contrat->creer) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels, $object); - + $result = $object->create($user); if ($result > 0) { @@ -744,6 +744,21 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } +} elseif ($action=='setref') { + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors,'errors'); + } + $object->ref=GETPOST('ref','alpha'); + + $result = $object->update($user); + if ($result < 0) { + setEventMessage($object->errors,'errors'); + $action='editref'; + } else { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } } if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer) @@ -818,6 +833,18 @@ $form = new Form($db); $objectlignestatic=new ContratLigne($db); +// Load object modContract +$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive'); +if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php') +{ + $module = substr($module, 0, dol_strlen($module)-4); +} +$result=dol_include_once('/core/modules/contract/'.$module.'.php'); +if ($result > 0) +{ + $modCodeContract = new $module(); +} + /********************************************************************* * @@ -878,8 +905,6 @@ if ($action == 'create') $object->date_contrat = dol_now(); - $numct = $object->getNextNumRef($soc); - print '
    '; print ''; @@ -890,7 +915,12 @@ if ($action == 'create') print ''; // Ref - print ''; + if (! empty($modCodeContract->code_auto)) { + $tmpcode=$langs->trans("Draft"); + } else { + $tmpcode=''; + } + print ''; // Ref Int print ''; @@ -1040,7 +1070,7 @@ else if ($action == 'valid') { $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') + if ($ref == 'PROV' && !empty($modCodeContract->code_auto)) { $numref = $object->getNextNumRef($soc); } @@ -1079,9 +1109,19 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref du contrat - print '"; + if (!empty($modCodeContract->code_auto)) { + print '"; + } else { + print ''; + print ''; + print ''; + } print ''; print ''; - } - $i++; + // You can use here results + print ''; } + $i++; } } else diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c57b79ea7fa..9b57e57bc0b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -481,7 +481,7 @@ class Form $countryArray=array(); $label=array(); - $sql = "SELECT rowid, code as code_iso, libelle as label"; + $sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, libelle as label"; $sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " WHERE active = 1"; //$sql.= " ORDER BY code ASC"; @@ -502,6 +502,7 @@ class Form $obj = $this->db->fetch_object($resql); $countryArray[$i]['rowid'] = $obj->rowid; $countryArray[$i]['code_iso'] = $obj->code_iso; + $countryArray[$i]['code_iso3'] = $obj->code_iso3; $countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:'')); $label[$i] = dol_string_unaccent($countryArray[$i]['label']); $i++; @@ -512,7 +513,7 @@ class Form foreach ($countryArray as $row) { //print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].'
    '; - if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) ) + if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']) ) { $foundselected=true; $out.= '"; print ''; - print ''; + print ''; print ''; print ''; print ''; From 6b26ae6f1f478be92fca5ca4da83d349c01cc85c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Aug 2014 13:30:44 +0200 Subject: [PATCH 470/502] Fix: Header of tables must use th and not td --- htdocs/core/class/commonobject.class.php | 2 ++ htdocs/societe/index.php | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d322dd201df..e36eef20ff4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -47,6 +47,8 @@ abstract class CommonObject public $array_options=array(); + public $thirdparty; + public $linkedObjectsIds; // Loaded by ->fetchObjectLinked public $linkedObjects; // Loaded by ->fetchObjectLinked diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 766e44cf9a7..dad3c5cb5e0 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -64,19 +64,19 @@ print '
    '; print ''; print '
    '.$langs->trans('Ref').''.$langs->trans("Draft").'
    '.$langs->trans('Ref').''.$tmpcode.'
    '.$langs->trans('RefCustomer').'
    '.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print "
    '.$langs->trans("Ref").''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print "
    '; + print $form->editfieldkey("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer); + print ''; + print $form->editfieldval("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer); + print '
    '; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index 8281552b459..289b474de5e 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -32,6 +32,7 @@ class mod_contract_magre extends ModelNumRefContracts var $version='dolibarr'; var $error = ''; var $nom = 'Magre'; + var $code_auto=1; /** * Return default description of numbering model diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php new file mode 100644 index 00000000000..f2439bb431e --- /dev/null +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -0,0 +1,106 @@ + + * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2014 Floran Henry + * + * 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 . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/contract/mod_contract_olive.php + * \ingroup contract + * \brief File of class to manage contract numbering rules Olive + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/contract/modules_contract.php'; + + +/** + * Class to manage contract numbering rules Olive + */ +class mod_contract_olive extends ModelNumRefContracts +{ + + + var $nom='Olive'; // Nom du modele + var $code_modifiable = 1; // Code modifiable + var $code_modifiable_invalide = 1; // Code modifiable si il est invalide + var $code_modifiable_null = 1; // Code modifiables si il est null + var $code_null = 1; // Code facultatif + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $code_auto = 0; // Numerotation automatique + + + /** Return description of module + * + * @param Translate $langs Object langs + * @return string Description of module + */ + function info() + { + global $langs; + + $langs->load("companies"); + return $langs->trans("LeopardNumRefModelDesc"); + } + + /** + * Return an example of result returned by getNextValue + * + * @param product $objproduct Object product + * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @return string Return next value + */ + function getNextValue($objsoc,$contract) + { + global $langs; + return ''; + } + + + /** + * Check validity of code according to its rules + * + * @param DoliDB $db Database handler + * @param string &$code Code to check/correct + * @param Product $product Object product + * @param int $type 0 = product , 1 = service + * @return int 0 if OK + * -1 ErrorBadProductCodeSyntax + * -2 ErrorProductCodeRequired + * -3 ErrorProductCodeAlreadyUsed + * -4 ErrorPrefixRequired + */ + function verif($db, &$code, $product, $type) + { + global $conf; + + $result=0; + $code = strtoupper(trim($code)); + + if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) + { + $result=0; + } + else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) ) + { + $result=-2; + } + + dol_syslog("mod_contract_olive::verif type=".$type." result=".$result); + return $result; + } +} + diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index 61ca01ae419..b909b762541 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -32,6 +32,7 @@ class mod_contract_serpis extends ModelNumRefContracts var $prefix='CT'; var $error=''; var $nom='Serpis'; + var $code_auto=1; /** From bab75335781368408b14bec00276a19761227de9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 12 Aug 2014 18:16:59 +0200 Subject: [PATCH 454/502] Enable supplier price log table --- ChangeLog | 1 + htdocs/fourn/class/fournisseur.product.class.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 681455af224..6cecbc2b752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ For users: - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - New: [ task #1204 ] add a External reference to contract - New: [ task #1204 ] add Numering contrat module free (like leopard in product module) +- New: Enable supplier price log table For translators: - Update language files. diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index b9cd7f40163..367ba5b972e 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -263,9 +263,9 @@ class ProductFournisseur extends Product $error++; } - /*if (! $error) + if (! $error && !empty($cong->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { - // Ajoute modif dans table log + // Add record into log table $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_log("; $sql.= "datec, fk_product_fournisseur,fk_user,price,quantity)"; $sql.= "values('".$this->db->idate($now)."',"; @@ -281,7 +281,7 @@ class ProductFournisseur extends Product $error++; } } - */ + if (! $error) { From ca05345a60d2154c2f45f115a8f513602b6a89e8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 12 Aug 2014 18:20:36 +0200 Subject: [PATCH 455/502] Fix Travis --- htdocs/core/modules/contract/mod_contract_olive.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index f2439bb431e..3e056cf80cf 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -43,10 +43,11 @@ class mod_contract_olive extends ModelNumRefContracts var $code_auto = 0; // Numerotation automatique - /** Return description of module + /** + * Return description of module * - * @param Translate $langs Object langs - * @return string Description of module + * @param Translate $langs Object langs + * @return string Description of module */ function info() { @@ -59,7 +60,7 @@ class mod_contract_olive extends ModelNumRefContracts /** * Return an example of result returned by getNextValue * - * @param product $objproduct Object product + * @param Societe $objsoc Object thirdparty * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return next value */ From 3c96063165ae9b678fb2943bf8a437e6de6fda4f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 12 Aug 2014 18:38:27 +0200 Subject: [PATCH 456/502] fix travis --- htdocs/core/modules/contract/mod_contract_olive.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 3e056cf80cf..2b10d520b25 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -46,7 +46,6 @@ class mod_contract_olive extends ModelNumRefContracts /** * Return description of module * - * @param Translate $langs Object langs * @return string Description of module */ function info() @@ -61,7 +60,7 @@ class mod_contract_olive extends ModelNumRefContracts * Return an example of result returned by getNextValue * * @param Societe $objsoc Object thirdparty - * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) + * @param Contrat $contract Object contract * @return string Return next value */ function getNextValue($objsoc,$contract) From b465d7153534abefc62454d8f4a0de0831cc5a1a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 13 Aug 2014 07:46:56 +0200 Subject: [PATCH 457/502] Renamed data table --- .../mysql/data/{llx_00_c_pays.sql => llx_00_c_country.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename htdocs/install/mysql/data/{llx_00_c_pays.sql => llx_00_c_country.sql} (100%) diff --git a/htdocs/install/mysql/data/llx_00_c_pays.sql b/htdocs/install/mysql/data/llx_00_c_country.sql similarity index 100% rename from htdocs/install/mysql/data/llx_00_c_pays.sql rename to htdocs/install/mysql/data/llx_00_c_country.sql From 672738576579403d094b578a5a3ba7f243756ad2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Aug 2014 15:07:22 +0200 Subject: [PATCH 458/502] Fix: error message --- htdocs/admin/system/dolibarr.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 12ee7e2d98a..641a3166c04 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -332,7 +332,11 @@ foreach($configfileparameters as $key => $value) { if ($i > 0) print ', '; print $value2; - if (! is_readable($value2)) print ' '.img_warning($langs->trans("ErrorCantReadDirr")); + if (! is_readable($value2)) + { + $langs->load("errors"); + print ' '.img_warning($langs->trans("ErrorCantReadDir",$value2)); + } ++$i; } } From 454cb1cbf8df109399b5b31e077b2820919216d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Aug 2014 19:19:36 +0200 Subject: [PATCH 459/502] Enhance skeleton Add code_iso3 into array --- dev/skeletons/skeleton_page.php | 56 ++++++++++++++++++--------- htdocs/core/class/html.form.class.php | 7 ++-- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 00222bcce61..7b625066390 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -70,17 +70,38 @@ if ($user->societe_id > 0) if ($action == 'add') { + $error=0; + $object=new Skeleton_Class($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); - if ($result > 0) + /* object_prop_getpost_prop */ + $object->prop1=GETPOST("field1"); + $object->prop2=GETPOST("field2"); + + if (empty($object->ref)) { - // Creation OK + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); } + + if (! $error) { - // Creation KO - $mesg=$object->error; + $result=$object->create($user); + if ($result > 0) + { + // Creation OK + header("Location: ".dol_buildpath('/mymodule/list.php',1)); + exit; + } + { + // Creation KO + if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); + else setEventMessage($object->error, 'errors'); + $action='create'; + } + } + else + { + $action='create'; } } @@ -145,21 +166,18 @@ if ($action == 'list') { $num = $db->num_rows($resql); $i = 0; - if ($num) + while ($i < $num) { - while ($i < $num) + $obj = $db->fetch_object($resql); + if ($obj) { - $obj = $db->fetch_object($resql); - if ($obj) - { - // You can use here results - print '
    '; - print $obj->field1; - print $obj->field2; - print '
    '; + print $obj->field1; + print $obj->field2; + print '
    '.$username.''.$obj->title.''; + $projectstatic->id=$obj->projectid; + $projectstatic->ref=$obj->ref; + $projectstatic->title=$obj->title; + print $projectstatic->getNomUrl(1,'',16); + //print ''.$obj->title.''; + print ''.$obj->label.''.dol_print_date($db->jdate($obj->dateo)).''.dol_print_date($db->jdate($obj->datee)).'
    '; print ''; -print ''; +print ''; print "'; print ''; if (! empty($conf->barcode->enabled)) { - print "'; //print ''; print ''; } -print "'; +print "'; //print ''; print ''; @@ -121,7 +121,7 @@ print '
    '.$langs->trans("Search").'
    '.$langs->trans("Search").'
    "; print ':
    "; + print "
    "; print ':
    "; -print ':
    "; +print ':
    '; print ''; if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2)) { - print ''; +print ''; +print ''; +print ''; +print ''; +print '
    '.$langs->trans("Statistics").'
    '; + print '
    '; $dataseries=array(); if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); From 75a46030ded1fb05b2429f090552cd82b5bc4aeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Aug 2014 15:09:17 +0200 Subject: [PATCH 471/502] Complete ignore --- htdocs/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/.gitignore b/htdocs/.gitignore index a4ebd2bb7c7..8ba0a69acb3 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -2,6 +2,7 @@ /custom* /extensions* /nltechno* +/anco* /bootstrap* /google* /multicompany* From c17f5e7f007a8600282a50d6c64a0601eabdb0af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Aug 2014 16:04:42 +0200 Subject: [PATCH 472/502] Accept property fk_thirdparty instead of fk_soc --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e36eef20ff4..3306d38f214 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -598,10 +598,10 @@ abstract class CommonObject { global $conf; - if (empty($this->socid) && empty($this->fk_soc)) return 0; + if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0; $thirdparty = new Societe($this->db); - $result=$thirdparty->fetch(isset($this->socid)?$this->socid:$this->fk_soc); + $result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty)); $this->client = $thirdparty; // deprecated $this->thirdparty = $thirdparty; From 1ffb964dd15eb7208383db93dbea1c131263ac4c Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Thu, 14 Aug 2014 16:06:43 +0200 Subject: [PATCH 473/502] Change method Replace by existing constant .. --- htdocs/admin/security_other.php | 45 ++++++++++++++------------------- htdocs/core/tpl/login.tpl.php | 5 ++-- htdocs/langs/fr_FR/admin.lang | 3 ++- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 86c89edb6fb..8c65d1f3359 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -105,9 +105,9 @@ else if ($action == 'MAIN_ANTIVIRUS_PARAM') if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db); else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } -else if ($action == 'MAIN_SECURITY_HIDDENNUMVER') +else if ($action == 'MAIN_APPLICATION_TITLE') { - if (! dolibarr_set_const($db, "MAIN_SECURITY_HIDDENNUMVER", $_POST["MAIN_SECURITY_HIDDENNUMVER"],'chaine',0,'',$conf->entity)) dol_print_error($db); + if (! dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db); else setEventMessage($langs->trans("RecordModifiedSuccessfully")); } @@ -170,8 +170,24 @@ print 'global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE=""; +print ''; +print ''; +print '
    '.$langs->trans("HiddeNumVersion").''; +print $form->textwithpicto('',$langs->trans("HiddeNumVersionExample",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); +print ''; +print ' '; +print ''; +print ''; +print '
    '; print '
    '; @@ -184,28 +200,6 @@ print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Status").''; print ''; -// Hidde version number -$var=!$var; -print ""; -print ''.$langs->trans("HiddeNumVersion").''; // TODO add lag -print ''; -if (! empty($conf->use_javascript_ajax)) -{ - print ajax_constantonoff('MAIN_SECURITY_HIDDENNUMVER'); -} -else -{ - if (empty($conf->global->MAIN_SECURITY_HIDDENNUMVER)) - { - print ''.img_picto($langs->trans("Disabled"),'off').''; - } - else - { - print ''.img_picto($langs->trans("Enabled"),'on').''; - } -} -print ''; - // Enable Captcha code $var=!$var; print ""; @@ -362,6 +356,5 @@ $formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestF $filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1); $formfile->list_of_documents($filearray, '', 'admin_temp', ''); - llxFooter(); $db->close(); diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 78830d0ca23..e943619f563 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -27,7 +27,6 @@ if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1; $arrayofjs=array('/core/js/dst.js'.(empty($conf->dol_use_jmobile)?'':'?version='.urlencode(DOL_VERSION))); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second $titleofloginpage=$langs->trans('Login').' '.$title; // title is defined by dol_loginfunction in security2.lib.php -$titleAff = !empty($conf->$global->MAIN_SECURITY_HIDDENNUMVER) ? dol_escape_htmltag($title) : "Dolibarr" ; print top_htmlhead('',$titleofloginpage,0,0,$arrayofjs); ?> @@ -63,8 +62,8 @@ $(document).ready(function () { - - + +
    diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index dc1eca63322..b3774d477eb 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -81,7 +81,8 @@ MustBeLowerThanPHPLimit=Remarque : Votre PHP limite la taille des envois à NoMaxSizeByPHPLimit=Aucune limite configurée dans votre serveur PHP MaxSizeForUploadedFiles=Taille maximum des fichiers envoyés (0 pour interdire l'envoi) UseCaptchaCode=Utilisation du code graphique (CAPTCHA) sur la page de connexion -HiddeNumVersion=Cacher le numero de version sur la page de login +HiddeNumVersion=Modifier titre du site +HiddeNumVersionExample=Remplace titre du site, si laisser vide cela affiche la valeur par defaut ( Dolibarr X.X.X ) UseAvToScanUploadedFiles=Utiliser un antivirus pour vérifier les fichiers envoyés AntiVirusCommand= Chemin complet vers la commande antivirus AntiVirusCommandExample= Exemple pour ClamWin : c:\\Progra~1\\ClamWin\\bin\\clamscan.exe
    Exemple pour ClamAv : /usr/bin/clamscan From c79fc516d3b2b7174d9c4fbf0844f606b58b5fbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 14 Aug 2014 17:27:28 +0200 Subject: [PATCH 474/502] Maj squelette --- dev/skeletons/skeleton_page.php | 2 +- htdocs/core/tpl/notes.tpl.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index fecd48637ed..aab1a965eb6 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -63,7 +63,7 @@ if ($user->societe_id > 0) // Load object if id or ref is provided as parameter $object=new Skeleton_Class($db); -if (($id || $ref) && $action != 'add') +if (($id > 0 || ! empty($ref)) && $action != 'add') { $result=$object->fetch($id,$ref); if ($result < 0) dol_print_error($db); diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 0cce9a3e3b4..66b310da69d 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -22,6 +22,7 @@ $note_public = 'note_public'; $note_private = 'note_private'; $colwidth=(isset($colwidth)?$colwidth:25); + $permission=(isset($permission)?$permission:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)); // If already defined by caller page $moreparam=(isset($moreparam)?$moreparam:''); $value_public=$object->note_public; @@ -59,8 +60,9 @@ elseif ($module == 'contact') { $permission=$user->rights->societe->creer;} elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer;} //else dol_print_error('','Bad value '.$module.' for param module'); -if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; +if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; // Rem: This var is for all notes, not only thirdparties note. else $typeofdata='textarea:12:100'; + ?> From 37cc0dc4f3582422207683d6287dc4daa32f96cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 01:32:18 +0200 Subject: [PATCH 475/502] Perf: Add missing index on projet_task_time table. --- .../mysql/tables/llx_projet_task_time.key.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_projet_task_time.key.sql diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.key.sql b/htdocs/install/mysql/tables/llx_projet_task_time.key.sql new file mode 100644 index 00000000000..ad1433f8dca --- /dev/null +++ b/htdocs/install/mysql/tables/llx_projet_task_time.key.sql @@ -0,0 +1,22 @@ +-- =========================================================================== +-- Copyright (C) 2014 Laurent Destailleur +-- +-- 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 . +-- +-- =========================================================================== + +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task); +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date); +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour); + From aee35c86d6ae2ab0e023d2edb75a10ede157f477 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 02:11:01 +0200 Subject: [PATCH 476/502] Perf: Removed a useless distinct, add indexes. --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 8 ++++++++ htdocs/install/mysql/tables/llx_actioncomm.key.sql | 1 + htdocs/projet/class/project.class.php | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 68809d65bee..cac0053c473 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -970,3 +970,11 @@ CREATE TABLE llx_holiday_types ( ALTER TABLE llx_c_type_fees CHANGE libelle label VARCHAR(30); ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label; + + +ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_element (fk_element); + +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task); +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date); +ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour); + diff --git a/htdocs/install/mysql/tables/llx_actioncomm.key.sql b/htdocs/install/mysql/tables/llx_actioncomm.key.sql index 9a48747c4da..1da34c65bab 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.key.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.key.sql @@ -22,3 +22,4 @@ ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datea (datea); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact); ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code); +ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_element (fk_element); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 100dd4dfb51..998f1abdba1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -886,7 +886,7 @@ class Project extends CommonObject $projects = array(); $temp = array(); - $sql = "SELECT DISTINCT p.rowid, p.ref"; + $sql = "SELECT ".(($mode == 0 || $mode == 1) ? "DISTINCT " : "")."p.rowid, p.ref"; $sql.= " FROM " . MAIN_DB_PREFIX . "projet as p"; if ($mode == 0 || $mode == 1) { From 8750b60a816b80c14e2d8a03879f80930da034fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 Aug 2014 16:09:44 +0200 Subject: [PATCH 477/502] Update llx_c_tva.sql --- htdocs/install/mysql/data/llx_c_tva.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 1d4572591d1..b73d128c6ad 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -129,6 +129,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (11 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1); +-- IRELAND (id country=8) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '23','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (82, 8, '13.5','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (83, 8, '9','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (84, 8, '4.8','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (85, 8, '0','0','VAT Rate 0',1); + -- JAPAN (id country=123) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT Rate 5',1); From 7edf2eacea2ddb1f803cc4d475fddeb3505424c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 17:08:05 +0200 Subject: [PATCH 478/502] New: Each user can include its own external ics calendar into dolibarr agenda view. --- ChangeLog | 1 + htdocs/admin/agenda_extsites.php | 16 ++- htdocs/comm/action/index.php | 20 ++- htdocs/core/lib/agenda.lib.php | 9 +- htdocs/core/lib/usergroups.lib.php | 8 ++ htdocs/langs/en_US/admin.lang | 2 + htdocs/user/agenda_extsites.php | 187 +++++++++++++++++++++++++++++ 7 files changed, 231 insertions(+), 12 deletions(-) create mode 100644 htdocs/user/agenda_extsites.php diff --git a/ChangeLog b/ChangeLog index 586bccbe03b..a793f802da9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Each user can include its own external ics calendar into dolibarr agenda view. - New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. - New: Supervisor is now visible into user list. diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 371854410b0..6b683c8b52b 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -62,10 +62,11 @@ if ($actionsave) // Save agendas while ($i <= $MAXAGENDA) { - $name=trim(GETPOST('agenda_ext_name'.$i,'alpha')); - $src=trim(GETPOST('agenda_ext_src'.$i,'alpha')); - $color=trim(GETPOST('agenda_ext_color'.$i,'alpha')); + $name=trim(GETPOST('AGENDA_EXT_NAME'.$i,'alpha')); + $src=trim(GETPOST('AGENDA_EXT_SRC'.$i,'alpha')); + $color=trim(GETPOST('AGENDA_EXT_COLOR'.$i,'alpha')); if ($color=='-1') $color=''; + $enabled=trim(GETPOST('AGENDA_EXT_ENABLED'.$i,'alpha')); if (! empty($src) && ! dol_is_url($src)) { @@ -82,6 +83,8 @@ if ($actionsave) if (! $res > 0) $error++; $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; + $res=dolibarr_set_const($db,'AGENDA_EXT_ENABLED'.$i,$enabled,'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; $i++; } @@ -195,19 +198,20 @@ while ($i <= $MAXAGENDA) $name='AGENDA_EXT_NAME'.$key; $src='AGENDA_EXT_SRC'.$key; $color='AGENDA_EXT_COLOR'.$key; + $enabled='AGENDA_EXT_ENABLED'.$key; $var=!$var; print ""; // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name - print ''; + print ''; // URL - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key)?GETPOST("AGENDA_EXT_COLOR".$key):$conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; print ""; $i++; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5021fa11f94..318d7efbee9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -163,8 +163,9 @@ $nowyear=$nowarray['year']; $nowmonth=$nowarray['mon']; $nowday=$nowarray['mday']; -// Define list of all external calendars $listofextcals=array(); + +// Define list of external calendars (global admin setup) if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0) { $i=0; @@ -182,7 +183,22 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0 } } } - +// Define list of external calendars (user setup) +$i=0; +while($i < $conf->global->AGENDA_EXT_NB) +{ + $i++; + $source='AGENDA_EXT_SRC_'.$user->id.'_'.$i; + $name='AGENDA_EXT_NAME_'.$user->id.'_'.$i; + $color='AGENDA_EXT_COLOR_'.$user->id.'_'.$i; + $enabled='AGENDA_EXT_ENABLED_'.$user->id.'_'.$i; + $buggedfile='AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i; + if (! empty($user->conf->$source) && ! empty($user->conf->$name)) + { + // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight' + $listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0)); + } +} if (empty($action) || $action=='show_month') { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 964dc751932..a0c1e3f1b4b 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -73,17 +73,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh //print '  '; //print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); //print '   '.$langs->trans("or") . ' '; - print $langs->trans("ActionsForUser").'   '; + print $langs->trans("ActionAffectedTo").'   '; print ''; - //print '  '; + //print $langs->trans("User"); print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); if (! empty($conf->use_javascript_ajax)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; print ajax_combobox('usertodo'); } - print '   '.$langs->trans("or") . ' '; - print $langs->trans("ActionsForUsersGroup").'   '; + if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '; + else print '
    '; + print $langs->trans("Group").'   '; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); if (! empty($conf->use_javascript_ajax)) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 0b8c759f21a..97354bd08ab 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -71,6 +71,14 @@ function user_prepare_head($object) $head[$h][2] = 'guisetup'; $h++; + if (! empty($conf->agenda->enabled)) + { + $head[$h][0] = DOL_URL_ROOT.'/user/agenda_extsites.php?id='.$object->id; + $head[$h][1] = $langs->trans("ExtSites"); + $head[$h][2] = 'extsites'; + $h++; + } + if (! empty($conf->clicktodial->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$object->id; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ab08ecee1b9..f4a7aa0f5c6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -517,6 +517,8 @@ Module6000Name=Workflow Module6000Desc=Workflow management Module20000Name=Holidays Module20000Desc=Declare and follow employees holidays +Module39000Name=Product batch +Module39000Desc=Batch number, eat-by and sell-by date management on products Module50000Name=PayBox Module50000Desc=Module to offer an online payment page by credit card with PayBox Module50100Name=Point of sales diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php new file mode 100644 index 00000000000..4109e7ab9a4 --- /dev/null +++ b/htdocs/user/agenda_extsites.php @@ -0,0 +1,187 @@ + + * Copyright (C) 2011-2014 Juanjo Menent + * + * 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 . + */ + +/** + * \file htdocs/user/agenda_extsites.php + * \ingroup agenda + * \brief Page to setup external calendars for agenda module + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + +if (!$user->admin) accessforbidden(); + +$langs->load("agenda"); +$langs->load("admin"); +$langs->load("other"); + +$def = array(); +$actiontest=GETPOST('test','alpha'); +$actionsave=GETPOST('save','alpha'); + +if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; +$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; + +// List of aviable colors +$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); + +// Security check +$id = GETPOST('id','int'); +$fuser = new User($db); +$fuser->fetch($id); + + +/* + * Actions + */ +if ($actionsave) +{ + $db->begin(); + + $i=1; $errorsaved=0; + $error=0; + $tabparam=array(); + + // Save agendas + while ($i <= $MAXAGENDA) + { + $name=trim(GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$i,'alpha')); + $src=trim(GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$i,'alpha')); + $color=trim(GETPOST('AGENDA_EXT_COLOR_'.$id.'_'.$i,'alpha')); + if ($color=='-1') $color=''; + $enabled=trim(GETPOST('AGENDA_EXT_ENABLED_'.$id.'_'.$i,'alpha')); + + if (! empty($src) && ! dol_is_url($src)) + { + setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); + $error++; + $errorsaved++; + break; + } + + $tabparam['AGENDA_EXT_NAME_'.$id.'_'.$i]=$name; + $tabparam['AGENDA_EXT_SRC_'.$id.'_'.$i]=$src; + $tabparam['AGENDA_EXT_COLOR_'.$id.'_'.$i]=$color; + $tabparam['AGENDA_EXT_ENABLED_'.$id.'_'.$i]=$enabled; + + $i++; + } + + if (! $error) + { + $result=dol_set_user_param($db, $conf, $fuser, $tabparam); + if (! $result > 0) $error++; + } + + if (! $error) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors'); + } +} + +/* + * View + */ + +$form=new Form($db); +$formadmin=new FormAdmin($db); +$formother=new FormOther($db); + +$arrayofjs=array(); +$arrayofcss=array(); + +llxHeader('',$langs->trans("UserSetup"),'','',0,0,$arrayofjs,$arrayofcss); + +$head=user_prepare_head($fuser); + +dol_fiche_head($head, 'extsites', $langs->trans("User"), 0, 'user'); + +print $langs->trans("AgendaExtSitesDesc")."
    \n"; +print "
    \n"; + +print '
    '; +print ''; + +$selectedvalue=$conf->global->AGENDA_DISABLE_EXT; +if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; + +$var=true; +print ""; + +print ""; +print ""; +print ""; +print "'; +print ''; +print ""; + +$i=1; +$var=true; +while ($i <= $MAXAGENDA) +{ + $key=$i; + $name='AGENDA_EXT_NAME_'.$id.'_'.$key; + $src='AGENDA_EXT_SRC_'.$id.'_'.$key; + $color='AGENDA_EXT_COLOR_'.$id.'_'.$key; + + $var=!$var; + print ""; + // Nb + print '"; + // Name + print ''; + // URL + print ''; + // Color (Possible colors are limited by Google) + print ''; + print ""; + $i++; +} + +print '
    ".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)'.$langs->trans("Color").'
    '.$langs->trans("AgendaExtNb",$key)."'; + //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key)?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key):$fuser->conf->$color), "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print '
    '; +print '
    '; + +print '
    '; +print "trans("Save")."\">"; +print "
    "; + +print "
    \n"; + +dol_fiche_end(); + +llxFooter(); + +$db->close(); From 8eac8c0c84ce8ca1cffa2c39a7bdb8b262346ebb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 19:29:19 +0200 Subject: [PATCH 479/502] Avoid duplicate logs --- htdocs/core/db/mssql.class.php | 2 +- htdocs/core/db/mysql.class.php | 2 +- htdocs/core/db/mysqli.class.php | 2 +- htdocs/core/db/pgsql.class.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index e3ba9ef6a0e..09885257ef6 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -349,7 +349,7 @@ class DoliDBMssql extends DoliDB //print ""; - dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); if (! $this->database_name) { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 7f51091c442..c5742bf7f57 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -252,7 +252,7 @@ class DoliDBMysql extends DoliDB { $query = trim($query); - dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); if (! $this->database_name) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index a88a88f369b..74d5e2b3880 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -256,7 +256,7 @@ class DoliDBMysqli extends DoliDB { $query = trim($query); - dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); if (! $this->database_name) { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 396e780f2b6..bc9ce89193c 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2005 Rodolphe Quiedeville - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin @@ -491,7 +491,7 @@ class DoliDBPgsql extends DoliDB @pg_query($this->db, 'SAVEPOINT mysavepoint'); } - dol_syslog('sql='.$query, LOG_DEBUG); + if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG); $ret = @pg_query($this->db, $query); From 2eb01cfbf9b85fbac1d35ff35f7ab8f3e145dba8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 21:18:56 +0200 Subject: [PATCH 480/502] Squelette plus complet. --- dev/skeletons/skeleton_page.php | 119 +++++++++++++++++++++++++++++--- htdocs/fichinter/fiche.php | 2 +- htdocs/societe/info.php | 3 +- 3 files changed, 111 insertions(+), 13 deletions(-) diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index aab1a965eb6..4f9efe04c42 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -53,6 +53,7 @@ $langs->load("other"); // Get parameters $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); +$backtopage = GETPOST('backtopage'); $myparam = GETPOST('myparam','alpha'); // Protection if external user @@ -77,10 +78,18 @@ if (($id > 0 || ! empty($ref)) && $action != 'add') * Put here all code to do according to value of "action" parameter ********************************************************************/ +// Action to add record if ($action == 'add') { + if (GETPOST('cancel')) + { + $urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1); + header("Location: ".$urltogo); + exit; + } + $error=0; - + /* object_prop_getpost_prop */ $object->prop1=GETPOST("field1"); $object->prop2=GETPOST("field2"); @@ -90,14 +99,15 @@ if ($action == 'add') $error++; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); } - + if (! $error) { $result=$object->create($user); if ($result > 0) { // Creation OK - header("Location: ".dol_buildpath('/mymodule/list.php',1)); + $urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1); + header("Location: ".$urltogo); exit; } { @@ -113,6 +123,62 @@ if ($action == 'add') } } +// Cancel +if ($action == 'update' && GETPOST('cancel')) $action='view'; + +// Action to update record +if ($action == 'update' && ! GETPOST('cancel')) +{ + $error=0; + + $object->prop1=GETPOST("field1"); + $object->prop2=GETPOST("field2"); + + if (empty($object->ref)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); + } + + if (! $error) + { + $result=$object->update($user); + if ($result > 0) + { + $action='view'; + } + else + { + // Creation KO + if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); + else setEventMessage($object->error, 'errors'); + $action='edit'; + } + } + else + { + $action='edit'; + } +} + +// Action to delete +if ($action == 'confirm_delete') +{ + $result=$object->delete($user); + if ($result > 0) + { + // Delete OK + setEventMessage($langs->trans("RecordDeleted")); + header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); + exit; + } + else + { + if (! empty($object->errors)) setEventMessage($object->errors,'errors'); + else setEventMessage($object->error,'errors'); + } +} + @@ -194,6 +260,35 @@ if ($action == 'list' || empty($id)) +// Part to create +if ($action == 'create') +{ + print_fiche_titre($langs->trans("NewResidence")); + + dol_fiche_head(); + + print '
    '; + print ''; + print ''; + + print ''."\n"; + print ''; + + print '
    '.$langs->trans("Label").''; + print ''; + print '
    '."\n"; + + print '
    '; + + print '
     
    '; + + print '
    '; + + dol_fiche_end(); +} + + + // Part to edit record if ($id && $action == 'edit') { @@ -201,6 +296,8 @@ if ($id && $action == 'edit') print '
    '; print ''; + print ''; + print ''; print '
    '; @@ -218,12 +315,12 @@ if ($id && $action == 'edit') if ($id && (empty($action) || $action == 'view')) { dol_fiche_head(); - - - + + + dol_fiche_end(); - - + + // Buttons print '
    '."\n"; $parameters=array(); @@ -248,12 +345,12 @@ if ($id && (empty($action) || $action == 'view')) } } print '
    '."\n"; - - + + // Example 2 : Adding links to objects // The class must extends CommonObject class to have this method available //$somethingshown=$object->showLinkedObjectBlock(); - + } diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index d459b20767b..02b2b2ea7dd 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1301,7 +1301,7 @@ else if ($id > 0 || ! empty($ref)) } } - print "
    "; + print ""; print '
    '; diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 0deec041932..446a4f415fb 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -76,7 +76,8 @@ print '
    '; dol_print_object_info($soc); print '
    '; -print '
'; + +dol_fiche_end(); llxFooter(); From bac870dc3b0884db95563ddae5438dfd6bef46c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 Aug 2014 22:23:23 +0200 Subject: [PATCH 481/502] Update project.class.php --- htdocs/projet/class/project.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 998f1abdba1..3279221d0c4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1,5 +1,4 @@ * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin From 25cc27c857cd8dee747ecac74f67540432a4ad62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 23:20:31 +0200 Subject: [PATCH 482/502] Qual: Remove method SetBilled that is a duplicate of setStatus. Fix: Better management of option SendInterventionRef. --- htdocs/fichinter/class/fichinter.class.php | 25 -- htdocs/fichinter/fiche.php | 340 +++++++++++---------- htdocs/fichinter/list.php | 33 +- htdocs/langs/en_US/interventions.lang | 1 + 4 files changed, 205 insertions(+), 194 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 930f9371522..50a18f5e57c 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -463,31 +463,6 @@ class Fichinter extends CommonObject } } - /** - * Set intervetnion as billed - * - * @return int <0 si ko, >0 si ok - */ - function setBilled() - { - global $conf; - - $sql = 'UPDATE '.MAIN_DB_PREFIX.'fichinter SET fk_statut = 2'; - $sql.= ' WHERE rowid = '.$this->id; - $sql.= " AND entity = ".$conf->entity; - $sql.= " AND fk_statut = 1"; - - if ($this->db->query($sql) ) - { - return 1; - } - else - { - dol_print_error($this->db); - return -1; - } - } - /** * Returns the label status diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 02b2b2ea7dd..437002aa23c 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -471,7 +471,22 @@ else if ($action == "addline" && $user->rights->ficheinter->creer) // Classify Billed else if ($action == 'classifybilled' && $user->rights->ficheinter->creer) { - $result=$object->setBilled(); + $result=$object->setStatut(2); + if ($result > 0) + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + $mesg='
'.$object->error.'
'; + } +} + +// Classify Billed +else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer) +{ + $result=$object->setStatut(1); if ($result > 0) { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); @@ -485,7 +500,7 @@ else if ($action == 'classifybilled' && $user->rights->ficheinter->creer) /* * Mise a jour d'une ligne d'intervention -*/ + */ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save")) { $objectline = new FichinterLigne($db); @@ -1289,12 +1304,12 @@ else if ($id > 0 || ! empty($ref)) print $extrafields->showInputField($key,$value); - print ''; + print '   '; } else { print $extrafields->showOutputField($key,$value); - if ($object->statut == 0 && $user->rights->ficheinter->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + if ($object->statut == 0 && $user->rights->ficheinter->creer) print '   '.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } @@ -1319,196 +1334,199 @@ else if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; } - - print '
'; - print ''; - print ''; - if ($action == 'editline') - { - print ''; - print ''; - } - else - { - print ''; - } - - // Intervention lines - $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 = '.$object->id; - $sql.= ' ORDER BY ft.rang ASC, ft.rowid'; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - if ($num) + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + print ''; + print ''; + print ''; + if ($action == 'editline') { - print '
'; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; + print ''; + print ''; } - $var=true; - while ($i < $num) + else { - $objp = $db->fetch_object($resql); - $var=!$var; + print ''; + } - // Ligne en mode visu - if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid) + // Intervention lines + $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 = '.$object->id; + $sql.= ' ORDER BY ft.rang ASC, ft.rowid'; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + + if ($num) { - print ''; - print '
'.$langs->trans('Description').''.$langs->trans('Date').''.$langs->trans('Duration').' 
'; - print ''; // ancre pour retourner sur la ligne - print dol_htmlentitiesbr($objp->description); + print '
'; + print ''; - // Date - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + $var=true; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; - // Duration - print ''; - - print "\n"; - - - // Icone d'edition et suppression - if ($object->statut == 0 && $user->rights->ficheinter->creer) + // Ligne en mode visu + if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid) { - print ''; - print ''; - if ($num > 1) + print ''; + print ''; + + // Duration + print ''; + + print "\n"; + + + // Icone d'edition et suppression + if ($object->statut == 0 && $user->rights->ficheinter->creer) { print ''; + print ''; + if ($num > 1) + { + print ''; + } } - } - else - { - print ''; + else + { + print ''; + } + + print ''; } - print ''; + // Line in update mode + if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && GETPOST('line_id','int') == $objp->rowid) + { + print ''; + print ''; + + // Date d'intervention + print ''; + + // Duration + print ''; + + print ''; + print '' . "\n"; + } + + $i++; } - // Line in update mode - if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && GETPOST('line_id','int') == $objp->rowid) - { - print ''; - print '
'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'
'.$langs->trans('Description').''.$langs->trans('Date').''.$langs->trans('Duration').' 
'.convertSecondToTime($objp->duree).''; - print 'rowid.'#'.$objp->rowid.'">'; - print img_edit(); - print ''; - print ''; - print 'rowid.'">'; - print img_delete(); - print '
'; + print ''; // ancre pour retourner sur la ligne + print dol_htmlentitiesbr($objp->description); + + // Date + print ''.dol_print_date($db->jdate($objp->date_intervention),'dayhour').''.convertSecondToTime($objp->duree).''; - if ($i > 0) - { - print 'rowid.'">'; - print img_up(); - print ''; - } - if ($i < $num-1) - { - print 'rowid.'">'; - print img_down(); - print ''; - } + print 'rowid.'#'.$objp->rowid.'">'; + print img_edit(); + print ''; print ''; + print 'rowid.'">'; + print img_delete(); + print ''; + if ($i > 0) + { + print 'rowid.'">'; + print img_up(); + print ''; + } + if ($i < $num-1) + { + print 'rowid.'">'; + print img_down(); + print ''; + } + print '  
'; + print ''; // ancre pour retourner sur la ligne + + // Editeur wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('np_desc',$objp->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); + $doleditor->Create(); + print ''; + $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); + print ''; + $form->select_duration('duration',$objp->duree); + print ''; + print '
'; - print ''; // ancre pour retourner sur la ligne + $db->free($resql); - // Editeur wysiwyg + // Add new line + if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + if (! $num) print '
'; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print "\n"; + + $var=false; + + print '\n"; + print ''; - // Date d'intervention + // Date intervention print ''; // Duration print ''; - print ''; - print '' . "\n"; + print ''; + print ''; + + if (! $num) print '
'; + print ''; // ancre + print $langs->trans('Description').''.$langs->trans('Date').''.$langs->trans('Duration').' 
'; + // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('np_desc',$objp->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); + $doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); $doleditor->Create(); print ''; - $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); + $now=dol_now(); + $timearray=dol_getdate($now); + if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']); + else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int')); + $form->select_date($timewithnohour,'di',1,1,0,"addinter"); print ''; - $form->select_duration('duration',$objp->duree); + $selectmode='select'; + if (! empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) $selectmode='text'; + $form->select_duration('duration', (!GETPOST('durationhour','int') && !GETPOST('durationmin','int'))?3600:(60*60*GETPOST('durationhour','int')+60*GETPOST('durationmin','int')), 0, $selectmode, 1); print ''; - print '
'; } - $i++; + if ($num) print '
'; } - - $db->free($resql); - - // Add new line - if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS)) + else { - if (! $num) print '
'; - - print ''; - print ''; - print ''; - print ''; - - print ''; - print "\n"; - - $var=false; - - print '\n"; - print ''; - - // Date intervention - print ''; - - // Duration - print ''; - - print ''; - print ''; - - if (! $num) print '
'; - print ''; // ancre - print $langs->trans('Description').''.$langs->trans('Date').''.$langs->trans('Duration').' 
'; - // editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); - $doleditor->Create(); - print ''; - $now=dol_now(); - $timearray=dol_getdate($now); - if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']); - else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int')); - $form->select_date($timewithnohour,'di',1,1,0,"addinter"); - print ''; - $selectmode='select'; - if (! empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) $selectmode='text'; - $form->select_duration('duration', (!GETPOST('durationhour','int') && !GETPOST('durationmin','int'))?3600:(60*60*GETPOST('durationhour','int')+60*GETPOST('durationmin','int')), 0, $selectmode, 1); - print '
'; + dol_print_error($db); } - if ($num) print '
'; - } - else - { - dol_print_error($db); - } + print '
'."\n"; + } - print ''."\n"; + dol_fiche_end(); - print '
'; print "\n"; @@ -1529,7 +1547,7 @@ else if ($id > 0 || ! empty($ref)) } // Modify - if ($object->statut == 1 && $user->rights->ficheinter->creer) + if ($object->statut == 1 && $user->rights->ficheinter->creer && empty($conf->global->FICHINTER_DISABLE_DETAILS)) { print ''; @@ -1572,6 +1590,10 @@ else if ($id > 0 || ! empty($ref)) { print ''; } + else + { + print ''; + } } } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index aa18223c0c5..6a730dbe046 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador @@ -108,8 +108,11 @@ if ($result) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],''); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder); + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder); + } print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder); print "\n"; @@ -122,8 +125,11 @@ if ($result) print ''; print ''; print ' '; - print ' '; - print ' '; + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + print ' '; + print ' '; + } print ''; print "\n"; @@ -150,8 +156,11 @@ if ($result) print ''; print ''.dol_htmlentitiesbr(dol_trunc($objp->description,20)).''; print ''.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).''; - print ''.dol_print_date($db->jdate($objp->dp),'dayhour')."\n"; - print ''.convertSecondToTime($objp->duree).''; + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + print ''.dol_print_date($db->jdate($objp->dp),'dayhour')."\n"; + print ''.convertSecondToTime($objp->duree).''; + } print ''.$interventionstatic->LibStatut($objp->fk_statut,5).''; print "\n"; @@ -159,9 +168,13 @@ if ($result) $total += $objp->duree; $i++; } - print ''.$langs->trans("Total").''; - print ''.convertSecondToTime($total).' '; - print ''; + $rowspan=3; + if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) + { + print ''.$langs->trans("Total").''; + print ''.convertSecondToTime($total).' '; + print ''; + } print ''; print "\n"; diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 58579a74276..36ef77517f8 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -25,6 +25,7 @@ NameAndSignatureOfExternalContact=Name and signature of customer : DocumentModelStandard=Standard document model for interventions InterventionCardsAndInterventionLines=Interventions and lines of interventions ClassifyBilled=Classify "Billed" +ClassifyUnBilled=Classify "Unbilled" StatusInterInvoiced=Billed RelatedInterventions=Related interventions ShowIntervention=Show intervention From 3f4978d786155abce8cd37019793819b729f1774 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Aug 2014 23:34:48 +0200 Subject: [PATCH 483/502] Fix: Translation --- htdocs/langs/en_US/bills.lang | 4 ++-- htdocs/langs/en_US/commercial.lang | 4 ++-- htdocs/langs/en_US/interventions.lang | 1 + htdocs/langs/en_US/sendings.lang | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index ededbf9cbdc..5490d496221 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -197,8 +197,8 @@ Rest=Pending AmountExpected=Amount claimed ExcessReceived=Excess received EscompteOffered=Discount offered (payment before term) -SendBillRef=Send invoice %s -SendReminderBillRef=Send invoice %s (reminder) +SendBillRef=Submission of invoice %s +SendReminderBillRef=Submission of invoice %s (reminder) StandingOrders=Standing orders StandingOrder=Standing order NoDraftBills=No draft invoices diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index a7f2edfff22..73c399eb604 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -44,8 +44,8 @@ DoneActions=Completed events DoneActionsFor=Completed events for %s ToDoActions=Incomplete events ToDoActionsFor=Incomplete events for %s -SendPropalRef=Send commercial proposal %s -SendOrderRef=Send order %s +SendPropalRef=Submission of commercial proposal %s +SendOrderRef=Submission of order %s StatusNotApplicable=Not applicable StatusActionToDo=To do StatusActionDone=Complete diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 36ef77517f8..266ce059d8b 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -29,6 +29,7 @@ ClassifyUnBilled=Classify "Unbilled" StatusInterInvoiced=Billed RelatedInterventions=Related interventions ShowIntervention=Show intervention +SendInterventionRef=Submission of intervention %s ##### Types de contacts ##### TypeContact_fichinter_internal_INTERREPFOLL=Representative following-up intervention TypeContact_fichinter_internal_INTERVENING=Intervening diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 039d47f6aa9..170f5984c4d 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -54,7 +54,7 @@ StatsOnShipmentsOnlyValidated=Statistics conducted on shipments only validated. DateDeliveryPlanned=Planed date of delivery DateReceived=Date delivery received SendShippingByEMail=Send shipment by EMail -SendShippingRef=Send shipment %s +SendShippingRef=Submission of shipment %s ActionsOnShipping=Events on shipment LinkToTrackYourPackage=Link to track your package ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. From 3e9ddbfcd03c187fbe15db34c525f5904b294170 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 00:38:09 +0200 Subject: [PATCH 484/502] Fix: [ bug #1547 ] Untranslated Paiementfourn.class.php error messages --- htdocs/fourn/class/paiementfourn.class.php | 6 +++--- htdocs/langs/en_US/errors.lang | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 02010d1e2e8..8903ff3b66a 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -203,7 +203,7 @@ class PaiementFourn extends Paiement { // Call trigger $result=$this->call_trigger('PAYMENT_SUPPLIER_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } } @@ -255,7 +255,7 @@ class PaiementFourn extends Paiement { if (count($billsarray)) { - $this->error='Can\'t delete a payment shared by at least one invoice with status payed'; + $this->error="ErrorCantDeletePaymentSharedWithPayedInvoice"; $this->db->rollback(); return -1; } @@ -274,7 +274,7 @@ class PaiementFourn extends Paiement $accline->fetch($bank_line_id); if ($accline->rappro) { - $this->error='Impossible de supprimer un paiement qui a genere une ecriture qui a ete rapprochee'; + $this->error="ErrorCantDeletePaymentReconciliated"; $this->db->rollback(); return -3; } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index b874ef58f07..89404614db5 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -136,6 +136,8 @@ ErrorBadFormat=Bad format! ErrorPaymentDateLowerThanInvoiceDate=Payment date (%s) cant' be before invoice date (%s) for invoice %s. ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst=Error, this member is not yet linked to any thirdparty. Link member to an existing third party or create a new thirdparty before creating subscription with invoice. ErrorThereIsSomeDeliveries=Error, there is some deliveries linked to this shipment. Deletion refused. +ErrorCantDeletePaymentReconciliated=Can't delete a payment that had generated a bank transaction that was conciliated +ErrorCantDeletePaymentSharedWithPayedInvoice=Can't delete a payment shared by at least one invoice with status Payed # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined From e713c8dadc3d9ec30eb70edf1dde7f6f26e90d8c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 17 Aug 2014 15:12:20 +0200 Subject: [PATCH 485/502] Fix: broken feature: add param for use only "disabled" with delConstant and "enabled" with setConstant --- htdocs/core/js/lib_head.js | 21 ++++++++++++--------- htdocs/core/lib/ajax.lib.php | 10 ++++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index a5e1410d503..40b1473698e 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -1,5 +1,5 @@ // Copyright (C) 2005-2014 Laurent Destailleur -// Copyright (C) 2005-2012 Regis Houssin +// Copyright (C) 2005-2014 Regis Houssin // // 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 @@ -633,7 +633,7 @@ function hideMessage(fieldId,message) { /* * TODO Used by admin page only ? */ -function setConstant(url, code, input, entity) { +function setConstant(url, code, input, entity, strict) { $.get( url, { action: "set", name: code, @@ -644,7 +644,7 @@ function setConstant(url, code, input, entity) { $("#del_" + code).show(); $.each(input, function(type, data) { // Enable another element - if (type == "disabled") { + if (type == "disabled" && strict != 1) { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; $(newvalue).removeAttr("disabled"); @@ -656,7 +656,10 @@ function setConstant(url, code, input, entity) { } else if (type == "enabled") { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; - $(newvalue).attr("disabled", true); + if (strict == 1) + $(newvalue).removeAttr("disabled"); + else + $(newvalue).attr("disabled", true); if ($(newvalue).hasClass("butAction") == true) { $(newvalue).removeClass("butAction"); $(newvalue).addClass("butActionRefused"); @@ -688,7 +691,7 @@ function setConstant(url, code, input, entity) { /* * TODO Used by admin page only ? */ -function delConstant(url, code, input, entity) { +function delConstant(url, code, input, entity, strict) { $.get( url, { action: "del", name: code, @@ -708,7 +711,7 @@ function delConstant(url, code, input, entity) { $(newvalue).addClass("butActionRefused"); } }); - } else if (type == "enabled") { + } else if (type == "enabled" && strict != 1) { $.each(data, function(key, value) { var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; $(newvalue).removeAttr("disabled"); @@ -742,7 +745,7 @@ function delConstant(url, code, input, entity) { /* * TODO Used by admin page only ? */ -function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) { +function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) { var boxConfirm = box; $("#confirm_" + code) .attr("title", boxConfirm.title) @@ -758,9 +761,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, text : yesButton, click : function() { if (action == "set") { - setConstant(url, code, input, entity); + setConstant(url, code, input, entity, strict); } else if (action == "del") { - delConstant(url, code, input, entity); + delConstant(url, code, input, entity, strict); } // Close dialog $(this).dialog("close"); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 47363ac8d06..e68fe78bc87 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2007-2012 Regis Houssin + * Copyright (C) 2007-2014 Regis Houssin * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -391,9 +391,10 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) * @param int $entity Entity to set * @param int $revertonoff Revert on/off + * @param bool $strict Use only "disabled" with delConstant and "enabled" with setConstant * @return void */ -function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) +function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0) { global $conf, $langs; @@ -413,6 +414,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\'; var code = \''.$code.'\'; var entity = \''.$entity.'\'; + var strict = \''.$strict.'\'; var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'"; var noButton = "'.dol_escape_js($langs->transnoentities("No")).'"; @@ -421,7 +423,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) if (input.alert && input.alert.set) { if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton; if (input.alert.set.noButton) noButton = input.alert.set.noButton; - confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton); + confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict); } else { setConstant(url, code, input, entity); } @@ -432,7 +434,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) if (input.alert && input.alert.del) { if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton; if (input.alert.del.noButton) noButton = input.alert.del.noButton; - confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton); + confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict); } else { delConstant(url, code, input, entity); } From 45927cc986078f9068341a60ef315f758d79bd87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 17:47:25 +0200 Subject: [PATCH 486/502] Fix pb of links into state-region-country: - no more rowid into insert sql requests - link, so foerign key must be on fk_region->code_region - label was not visible - unique keys must be into file .key.sql --- htdocs/admin/dict.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- .../install/mysql/data/llx_10_c_regions.sql | 371 +++++++++--------- .../mysql/data/llx_20_c_departements.sql | 2 +- .../install/mysql/migration/3.6.0-3.7.0.sql | 12 +- .../mysql/tables/llx_c_departements.key.sql | 2 +- .../mysql/tables/llx_c_regions.key.sql | 1 + htdocs/install/mysql/tables/llx_c_regions.sql | 2 +- htdocs/install/pgsql/functions/functions.sql | 2 +- 9 files changed, 202 insertions(+), 194 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 01c498ec572..7f8408b73e1 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1276,7 +1276,7 @@ function fieldList($fieldlist,$obj='',$tabname='') foreach ($fieldlist as $field => $value) { if ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) { print ' '; continue; } // For region page, we do not show the country input + if (in_array('region_id',$fieldlist)) { print ''.join(',',$fieldlist).' '; continue; } // For state page, we do not show the country input (we link to region, not country) print ''; print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28); print ''; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 8b435b9497a..9283ed13694 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -303,7 +303,7 @@ class FormCompany global $conf,$langs; $langs->load("dict"); - $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, c.code as country_code, c.label as country"; + $sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country"; $sql.= " FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1"; $sql.= " ORDER BY c.code, c.label ASC"; diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 2b8b5f92dea..4415f5711bf 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -32,242 +32,243 @@ -- Regions -- -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (0,0,0,'0',0,'-'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 0, 0, '0',0,'-'); -- Regions France (id country=1) -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 101, 1, 1,'97105',3,'Guadeloupe'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 102, 1, 2,'97209',3,'Martinique'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 103, 1, 3,'97302',3,'Guyane'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 104, 1, 4,'97411',3,'Réunion'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 105, 1, 11,'75056',1,'Île-de-France'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 106, 1, 21,'51108',0,'Champagne-Ardenne'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 107, 1, 22,'80021',0,'Picardie'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 108, 1, 23,'76540',0,'Haute-Normandie'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 109, 1, 24,'45234',2,'Centre'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 110, 1, 25,'14118',0,'Basse-Normandie'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 111, 1, 26,'21231',0,'Bourgogne'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 112, 1, 31,'59350',2,'Nord-Pas-de-Calais'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 113, 1, 41,'57463',0,'Lorraine'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 114, 1, 42,'67482',1,'Alsace'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 115, 1, 43,'25056',0,'Franche-Comté'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 116, 1, 52,'44109',4,'Pays de la Loire'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 117, 1, 53,'35238',0,'Bretagne'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 118, 1, 54,'86194',2,'Poitou-Charentes'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 119, 1, 72,'33063',1,'Aquitaine'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 120, 1, 73,'31555',0,'Midi-Pyrénées'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 121, 1, 74,'87085',2,'Limousin'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 122, 1, 82,'69123',2,'Rhône-Alpes'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 123, 1, 83,'63113',1,'Auvergne'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 124, 1, 91,'34172',2,'Languedoc-Roussillon'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 125, 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 126, 1, 94,'2A004',0,'Corse'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 1,'97105',3,'Guadeloupe'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 2,'97209',3,'Martinique'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 3,'97302',3,'Guyane'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 4,'97411',3,'Réunion'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 6,'',3,'Mayotte'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 11,'75056',1,'Île-de-France'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 21,'51108',0,'Champagne-Ardenne'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 22,'80021',0,'Picardie'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 23,'76540',0,'Haute-Normandie'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 24,'45234',2,'Centre'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 25,'14118',0,'Basse-Normandie'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 26,'21231',0,'Bourgogne'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 31,'59350',2,'Nord-Pas-de-Calais'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 41,'57463',0,'Lorraine'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 42,'67482',1,'Alsace'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 43,'25056',0,'Franche-Comté'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 52,'44109',4,'Pays de la Loire'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 53,'35238',0,'Bretagne'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 54,'86194',2,'Poitou-Charentes'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 72,'33063',1,'Aquitaine'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 73,'31555',0,'Midi-Pyrénées'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 74,'87085',2,'Limousin'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 82,'69123',2,'Rhône-Alpes'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 83,'63113',1,'Auvergne'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 91,'34172',2,'Languedoc-Roussillon'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 94,'2A004',0,'Corse'); -- Regions Belgium (id country=2) -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 201, 2, 201, '',1,'Flandre'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 202, 2, 202, '',2,'Wallonie'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 203, 2, 203, '',3,'Bruxelles-Capitale'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 201, '',1,'Flandre'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 202, '',2,'Wallonie'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 203, '',3,'Bruxelles-Capitale'); -- Regions Italy (id country=3) -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (301, 3, 301, NULL, 1, 'Abruzzo'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (302, 3, 302, NULL, 1, 'Basilicata'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (303, 3, 303, NULL, 1, 'Calabria'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (304, 3, 304, NULL, 1, 'Campania'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (305, 3, 305, NULL, 1, 'Emilia-Romagna'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (306, 3, 306, NULL, 1, 'Friuli-Venezia Giulia'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (307, 3, 307, NULL, 1, 'Lazio'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (308, 3, 308, NULL, 1, 'Liguria'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (309, 3, 309, NULL, 1, 'Lombardia'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (310, 3, 310, NULL, 1, 'Marche'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (311, 3, 311, NULL, 1, 'Molise'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (312, 3, 312, NULL, 1, 'Piemonte'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (313, 3, 313, NULL, 1, 'Puglia'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (314, 3, 314, NULL, 1, 'Sardegna'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (315, 3, 315, NULL, 1, 'Sicilia'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (316, 3, 316, NULL, 1, 'Toscana'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (317, 3, 317, NULL, 1, 'Trentino-Alto Adige'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (318, 3, 318, NULL, 1, 'Umbria'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (319, 3, 319, NULL, 1, 'Valle d Aosta'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (320, 3, 320, NULL, 1, 'Veneto'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 301, NULL, 1, 'Abruzzo'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 302, NULL, 1, 'Basilicata'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 303, NULL, 1, 'Calabria'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 304, NULL, 1, 'Campania'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 305, NULL, 1, 'Emilia-Romagna'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 306, NULL, 1, 'Friuli-Venezia Giulia'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 307, NULL, 1, 'Lazio'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 308, NULL, 1, 'Liguria'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 309, NULL, 1, 'Lombardia'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 310, NULL, 1, 'Marche'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 311, NULL, 1, 'Molise'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 312, NULL, 1, 'Piemonte'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 313, NULL, 1, 'Puglia'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 314, NULL, 1, 'Sardegna'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 315, NULL, 1, 'Sicilia'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 316, NULL, 1, 'Toscana'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 317, NULL, 1, 'Trentino-Alto Adige'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 318, NULL, 1, 'Umbria'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 319, NULL, 1, 'Valle d Aosta'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 320, NULL, 1, 'Veneto'); -- Regions Spain (id country=4) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (401, 4, 401, '', 0, 'Andalucia', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (402, 4, 402, '', 0, 'Aragón', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (403, 4, 403, '', 0, 'Castilla y León', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (404, 4, 404, '', 0, 'Castilla la Mancha', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (405, 4, 405, '', 0, 'Canarias', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (406, 4, 406, '', 0, 'Cataluña', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (407, 4, 407, '', 0, 'Comunidad de Ceuta', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (408, 4, 408, '', 0, 'Comunidad Foral de Navarra', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (409, 4, 409, '', 0, 'Comunidad de Melilla', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (410, 4, 410, '', 0, 'Cantabria', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (411, 4, 411, '', 0, 'Comunidad Valenciana', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (412, 4, 412, '', 0, 'Extemadura', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (413, 4, 413, '', 0, 'Galicia', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (414, 4, 414, '', 0, 'Islas Baleares', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (415, 4, 415, '', 0, 'La Rioja', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (416, 4, 416, '', 0, 'Comunidad de Madrid', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (417, 4, 417, '', 0, 'Región de Murcia', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (418, 4, 418, '', 0, 'Principado de Asturias', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (419, 4, 419, '', 0, 'Pais Vasco', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (420, 4, 420, '', 0, 'Otros', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 401, '', 0, 'Andalucia', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 402, '', 0, 'Aragón', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 403, '', 0, 'Castilla y León', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 404, '', 0, 'Castilla la Mancha', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 405, '', 0, 'Canarias', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 406, '', 0, 'Cataluña', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 407, '', 0, 'Comunidad de Ceuta', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 408, '', 0, 'Comunidad Foral de Navarra', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 409, '', 0, 'Comunidad de Melilla', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 410, '', 0, 'Cantabria', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 411, '', 0, 'Comunidad Valenciana', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 412, '', 0, 'Extemadura', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 413, '', 0, 'Galicia', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 414, '', 0, 'Islas Baleares', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 415, '', 0, 'La Rioja', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 416, '', 0, 'Comunidad de Madrid', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 417, '', 0, 'Región de Murcia', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 418, '', 0, 'Principado de Asturias', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 419, '', 0, 'Pais Vasco', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 420, '', 0, 'Otros', 1); -- Regions Germany (id country=5) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (501, 5, 501, '', 0, 'Deutschland', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 5, 501, '', 0, 'Deutschland', 1); -- Regions Greece (id_country=102) -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10201, 10201, 102, NULL, NULL, 'Αττική', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10202, 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10203, 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10204, 10204, 102, NULL, NULL, 'Κρήτη', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10205, 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10206, 10206, 102, NULL, NULL, 'Ήπειρος', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10207, 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10208, 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10209, 10209, 102, NULL, NULL, 'Πελοπόννησος', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10210, 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10211, 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10212, 10212, 102, NULL, NULL, 'Θεσσαλία', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10213, 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10201, 102, NULL, NULL, 'Αττική', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10204, 102, NULL, NULL, 'Κρήτη', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10206, 102, NULL, NULL, 'Ήπειρος', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10209, 102, NULL, NULL, 'Πελοπόννησος', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10212, 102, NULL, NULL, 'Θεσσαλία', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1); -- Regions Switzerland (id country=6) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (601, 6, 601, '', 1, 'Cantons', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 6, 601, '', 1, 'Cantons', 1); -- Regions England (id_country=7) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (701, 7, 701, '', 0, 'England', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (702, 7, 702, '', 0, 'Wales', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (703, 7, 703, '', 0, 'Scotland', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (704, 7, 704, '', 0, 'Northern Ireland', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 701, '', 0, 'England', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 702, '', 0, 'Wales', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 703, '', 0, 'Scotland', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 704, '', 0, 'Northern Ireland', 1); -- Regions Tunisia (id country=10) -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1001,10,1001, '',0,'Ariana'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1002,10,1002, '',0,'Béja'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1003,10,1003, '',0,'Ben Arous'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1004,10,1004, '',0,'Bizerte'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1005,10,1005, '',0,'Gabès'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1006,10,1006, '',0,'Gafsa'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1007,10,1007, '',0,'Jendouba'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1008,10,1008, '',0,'Kairouan'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1009,10,1009, '',0,'Kasserine'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1010,10,1010, '',0,'Kébili'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1011,10,1011, '',0,'La Manouba'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1012,10,1012, '',0,'Le Kef'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1013,10,1013, '',0,'Mahdia'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1014,10,1014, '',0,'Médenine'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1015,10,1015, '',0,'Monastir'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1016,10,1016, '',0,'Nabeul'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1017,10,1017, '',0,'Sfax'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1018,10,1018, '',0,'Sidi Bouzid'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1019,10,1019, '',0,'Siliana'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1020,10,1020, '',0,'Sousse'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1021,10,1021, '',0,'Tataouine'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1022,10,1022, '',0,'Tozeur'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1023,10,1023, '',0,'Tunis'); -insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1024,10,1024, '',0,'Zaghouan'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1001, '',0,'Ariana'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1002, '',0,'Béja'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1003, '',0,'Ben Arous'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1004, '',0,'Bizerte'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1005, '',0,'Gabès'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1006, '',0,'Gafsa'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1007, '',0,'Jendouba'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1008, '',0,'Kairouan'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1009, '',0,'Kasserine'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1010, '',0,'Kébili'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1011, '',0,'La Manouba'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1012, '',0,'Le Kef'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1013, '',0,'Mahdia'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1014, '',0,'Médenine'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1015, '',0,'Monastir'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1016, '',0,'Nabeul'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1017, '',0,'Sfax'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1018, '',0,'Sidi Bouzid'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1019, '',0,'Siliana'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1020, '',0,'Sousse'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1021, '',0,'Tataouine'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1022, '',0,'Tozeur'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1023, '',0,'Tunis'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1024, '',0,'Zaghouan'); -- Region US (id country=11) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1101, 11, 1101, '', 0, 'United-States', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 11, 1101, '', 0, 'United-States', 1); -- Region Canada (id country=14) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1401, 14, 1401, '', 0, 'Canada', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 14, 1401, '', 0, 'Canada', 1); -- Regions The Netherlands (id country=17) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1701, 17, 1701, '', 0,'Provincies van Nederland ', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 17, 1701, '', 0,'Provincies van Nederland ', 1); -- Regions Argentina (id country=23) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2301, 23, 2301, '', 0, 'Norte', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2302, 23, 2302, '', 0, 'Litoral', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2303, 23, 2303, '', 0, 'Cuyana', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2304, 23, 2304, '', 0, 'Central', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2305, 23, 2305, '', 0, 'Patagonia', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2301, '', 0, 'Norte', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2302, '', 0, 'Litoral', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2303, '', 0, 'Cuyana', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2304, '', 0, 'Central', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2305, '', 0, 'Patagonia', 1); -- Regions Australia (id country=28) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2801, 28, 2801, '', 0, 'Australia', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 28, 2801, '', 0, 'Australia', 1); -- Regions Brazil (id country=56) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (5601, 56, 5601, '', 0, 'Brasil', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 56, 5601, '', 0, 'Brasil', 1); -- Regions Colombie (id country=70) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (7001, 70, 7001, '', 0, 'Colombie', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 70, 7001, '', 0, 'Colombie', 1); -- Regions Chile (id country=67) -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6701, 6701, 67, NULL, NULL, 'Tarapacá', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6702, 6702, 67, NULL, NULL, 'Antofagasta', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6703, 6703, 67, NULL, NULL, 'Atacama', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6704, 6704, 67, NULL, NULL, 'Coquimbo', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6705, 6705, 67, NULL, NULL, 'Valparaíso', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6706, 6706, 67, NULL, NULL, 'General Bernardo O Higgins', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6707, 6707, 67, NULL, NULL, 'Maule', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6708, 6708, 67, NULL, NULL, 'Biobío', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6709, 6709, 67, NULL, NULL, 'Raucanía', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6710, 6710, 67, NULL, NULL, 'Los Lagos', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6711, 6711, 67, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6712, 6712, 67, NULL, NULL, 'Magallanes y Antártica Chilena', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6713, 6713, 67, NULL, NULL, 'Metropolitana de Santiago', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6714, 6714, 67, NULL, NULL, 'Los Ríos', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6715, 6715, 67, NULL, NULL, 'Arica y Parinacota', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6701, 67, NULL, NULL, 'Tarapacá', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6702, 67, NULL, NULL, 'Antofagasta', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6703, 67, NULL, NULL, 'Atacama', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6704, 67, NULL, NULL, 'Coquimbo', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6705, 67, NULL, NULL, 'Valparaíso', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6706, 67, NULL, NULL, 'General Bernardo O Higgins', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6707, 67, NULL, NULL, 'Maule', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6708, 67, NULL, NULL, 'Biobío', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6709, 67, NULL, NULL, 'Raucanía', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6710, 67, NULL, NULL, 'Los Lagos', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6711, 67, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6712, 67, NULL, NULL, 'Magallanes y Antártica Chilena', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6713, 67, NULL, NULL, 'Metropolitana de Santiago', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6714, 67, NULL, NULL, 'Los Ríos', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6715, 67, NULL, NULL, 'Arica y Parinacota', 1); -- Regions San Salvador (id country=86) -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8601, 8601, 86, NULL, NULL, 'Central', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8602, 8602, 86, NULL, NULL, 'Oriental', 1); -INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8603, 8603, 86, NULL, NULL, 'Occidental', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8601, 86, NULL, NULL, 'Central', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8602, 86, NULL, NULL, 'Oriental', 1); +INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8603, 86, NULL, NULL, 'Occidental', 1); -- Regions Honduras (id country=114) -insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (11401, 114, 11401, '', 0, 'Honduras', 1); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 114, 11401, '', 0, 'Honduras', 1); -- Regions India (id country=117) -insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (11701, 117, 11701, '', 0, 'India', 1); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 117, 11701, '', 0, 'India', 1); -- Regions Mauritius (id country=152) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15201, 152, 15201, '', 0, 'Rivière Noire', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15202, 152, 15202, '', 0, 'Flacq', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15203, 152, 15203, '', 0, 'Grand Port', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15204, 152, 15204, '', 0, 'Moka', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15205, 152, 15205, '', 0, 'Pamplemousses', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15206, 152, 15206, '', 0, 'Plaines Wilhems', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15207, 152, 15207, '', 0, 'Port-Louis', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15208, 152, 15208, '', 0, 'Rivière du Rempart', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15209, 152, 15209, '', 0, 'Savanne', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15210, 152, 15210, '', 0, 'Rodrigues', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15211, 152, 15211, '', 0, 'Les îles Agaléga', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15212, 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15201, '', 0, 'Rivière Noire', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15202, '', 0, 'Flacq', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15203, '', 0, 'Grand Port', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15204, '', 0, 'Moka', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15205, '', 0, 'Pamplemousses', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15206, '', 0, 'Plaines Wilhems', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15207, '', 0, 'Port-Louis', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15208, '', 0, 'Rivière du Rempart', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15209, '', 0, 'Savanne', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15210, '', 0, 'Rodrigues', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15211, '', 0, 'Les îles Agaléga', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1); -- Regions Mexique (id country=154) -insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (15401, 154, 15401, '', 0, 'Mexique', 1); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 154, 15401, '', 0, 'Mexique', 1); -- Regions Barbados (id country=46) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (4601, 46, 4601, '', 0, 'Barbados', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 46, 4601, '', 0, 'Barbados', 1); -- Regions Venezuela (id country=232) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23201, 232, 23201, '', 0, 'Los Andes', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23202, 232, 23202, '', 0, 'Capital', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23203, 232, 23203, '', 0, 'Central', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23204, 232, 23204, '', 0, 'Cento Occidental', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23205, 232, 23205, '', 0, 'Guayana', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23206, 232, 23206, '', 0, 'Insular', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23207, 232, 23207, '', 0, 'Los Llanos', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23208, 232, 23208, '', 0, 'Nor-Oriental', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23209, 232, 23209, '', 0, 'Zuliana', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23201, '', 0, 'Los Andes', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23202, '', 0, 'Capital', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23203, '', 0, 'Central', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23204, '', 0, 'Cento Occidental', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23205, '', 0, 'Guayana', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23206, '', 0, 'Insular', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23207, '', 0, 'Los Llanos', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23208, '', 0, 'Nor-Oriental', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23209, '', 0, 'Zuliana', 1); -- Regions Algeria (id country=13) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1301, 13, 1301, '', 0, 'Algerie', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 13, 1301, '', 0, 'Algerie', 1); -- Regions Maroc (id country=12) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1201, 12, 1201, '', 0, 'Tanger-Tétouan', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1202, 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1203, 12, 1203, '', 0, 'Taza-Al Hoceima-Taounate', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1204, 12, 1204, '', 0, 'L''Oriental', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1205, 12, 1205, '', 0, 'Fès-Boulemane', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1206, 12, 1206, '', 0, 'Meknès-Tafialet', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1207, 12, 1207, '', 0, 'Rabat-Salé-Zemour-Zaër', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1208, 12, 1208, '', 0, 'Grand Cassablanca', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1209, 12, 1209, '', 0, 'Chaouia-Ouardigha', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1210, 12, 1210, '', 0, 'Doukahla-Adba', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1211, 12, 1211, '', 0, 'Marrakech-Tensift-Al Haouz', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1212, 12, 1212, '', 0, 'Tadla-Azilal', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1213, 12, 1213, '', 0, 'Sous-Massa-Drâa', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1214, 12, 1214, '', 0, 'Guelmim-Es Smara', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1215, 12, 1215, '', 0, 'Laâyoune-Boujdour-Sakia el Hamra', 1); -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1216, 12, 1216, '', 0, 'Oued Ed-Dahab Lagouira', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1201, '', 0, 'Tanger-Tétouan', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1203, '', 0, 'Taza-Al Hoceima-Taounate', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1204, '', 0, 'L''Oriental', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1205, '', 0, 'Fès-Boulemane', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1206, '', 0, 'Meknès-Tafialet', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1207, '', 0, 'Rabat-Salé-Zemour-Zaër', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1208, '', 0, 'Grand Cassablanca', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1209, '', 0, 'Chaouia-Ouardigha', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1210, '', 0, 'Doukahla-Adba', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1211, '', 0, 'Marrakech-Tensift-Al Haouz', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1212, '', 0, 'Tadla-Azilal', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1213, '', 0, 'Sous-Massa-Drâa', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1214, '', 0, 'Guelmim-Es Smara', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1215, '', 0, 'Laâyoune-Boujdour-Sakia el Hamra', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1216, '', 0, 'Oued Ed-Dahab Lagouira', 1); -- Regions Tunisia (id country=10) -INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1001, 10, 1001, '', 0, 'Algerie', 1); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 10, 1001, '', 0, 'Algerie', 1); diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 739b1d1f537..116f9572052 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -32,7 +32,7 @@ -- Departements/Cantons/Provinces -- -insert into llx_c_departements (rowid, fk_region, code_departement,cheflieu,tncc,ncc,nom) values (0,0,'0','0',0,'-','-'); +insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 0, '0', '0',0,'-','-'); -- Departements France (id country=1) insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'01','01053',5,'AIN','Ain'); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index cac0053c473..13a28a37125 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -19,6 +19,7 @@ -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); + ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) @@ -950,9 +951,14 @@ create table llx_c_email_templates ) ENGINE=innodb; -UPDATE llx_c_regions SET rowid = 0 where rowid = 1; -DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0; -ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); +ALTER TABLE llx_c_departements DROP FOREIGN KEY fk_departements_fk_region; +--UPDATE llx_c_regions SET rowid = 0 where rowid = 1; + +ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region); + +DELETE FROM llx_c_departements WHERE fk_region NOT IN (select code_region from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0; + +ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_code_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region); CREATE TABLE llx_holiday_types ( diff --git a/htdocs/install/mysql/tables/llx_c_departements.key.sql b/htdocs/install/mysql/tables/llx_c_departements.key.sql index 4c8ceb42582..427d031a705 100644 --- a/htdocs/install/mysql/tables/llx_c_departements.key.sql +++ b/htdocs/install/mysql/tables/llx_c_departements.key.sql @@ -21,5 +21,5 @@ ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_r ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); -ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid); +ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region); diff --git a/htdocs/install/mysql/tables/llx_c_regions.key.sql b/htdocs/install/mysql/tables/llx_c_regions.key.sql index 21377f54fa7..82295ba52b3 100644 --- a/htdocs/install/mysql/tables/llx_c_regions.key.sql +++ b/htdocs/install/mysql/tables/llx_c_regions.key.sql @@ -18,4 +18,5 @@ ALTER TABLE llx_c_regions ADD INDEX idx_c_regions_fk_pays (fk_pays); +ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region); ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid); diff --git a/htdocs/install/mysql/tables/llx_c_regions.sql b/htdocs/install/mysql/tables/llx_c_regions.sql index c15c1e9b204..9c677ee44f7 100644 --- a/htdocs/install/mysql/tables/llx_c_regions.sql +++ b/htdocs/install/mysql/tables/llx_c_regions.sql @@ -20,7 +20,7 @@ create table llx_c_regions ( rowid integer AUTO_INCREMENT PRIMARY KEY, - code_region integer UNIQUE NOT NULL, + code_region integer NOT NULL, fk_pays integer NOT NULL, cheflieu varchar(50), tncc integer, diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 3275d589685..89395436c43 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -62,6 +62,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type FOR EA CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_boxes_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_email_template FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_field_list FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_shipment_mode FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_chargesociales FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -111,7 +112,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_rib FOR EACH CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_stock_mouvement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_texts FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); From cf80f97b9553a9962a305cd1944e709336240750 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 17:47:45 +0200 Subject: [PATCH 487/502] Fix: bad table name --- htdocs/install/mysql/tables/llx_c_email_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_c_email_template.sql b/htdocs/install/mysql/tables/llx_c_email_template.sql index 875314bf4c8..532ecd995eb 100644 --- a/htdocs/install/mysql/tables/llx_c_email_template.sql +++ b/htdocs/install/mysql/tables/llx_c_email_template.sql @@ -17,7 +17,7 @@ -- Table with templates of emails -- =================================================================== -create table llx_c_email_templates +create table llx_c_email_template ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id From b6ff6527bcbafd4af285017aa1244b95e45244e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 18:37:33 +0200 Subject: [PATCH 488/502] Enhance skeleton --- dev/skeletons/skeleton_class.class.php | 14 ++++++++------ dev/skeletons/skeleton_page.php | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index d8bda8922cb..781bbc1f77c 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -106,7 +106,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_CREATE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } @@ -133,10 +133,11 @@ class Skeleton_Class extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object + * @param int $id Id object + * @param string $ref Ref * @return int <0 if KO, >0 if OK */ - function fetch($id) + function fetch($id,$ref='') { global $langs; $sql = "SELECT"; @@ -145,7 +146,8 @@ class Skeleton_Class extends CommonObject $sql.= " t.field2"; //... $sql.= " FROM ".MAIN_DB_PREFIX."mytable as t"; - $sql.= " WHERE t.rowid = ".$id; + if ($ref) $sql.= " WHERE t.ref = '".$ref."'"; + else $sql.= " WHERE t.rowid = ".$id; dol_syslog(get_class($this)."::fetch"); $resql=$this->db->query($sql); @@ -214,7 +216,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } @@ -261,7 +263,7 @@ class Skeleton_Class extends CommonObject //// Call triggers //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} //// End call triggers } } diff --git a/dev/skeletons/skeleton_page.php b/dev/skeletons/skeleton_page.php index 4f9efe04c42..67d6298863a 100644 --- a/dev/skeletons/skeleton_page.php +++ b/dev/skeletons/skeleton_page.php @@ -62,6 +62,8 @@ if ($user->societe_id > 0) //accessforbidden(); } +if (empty($action) && empty($id) && empty($ref)) $action='create'; + // Load object if id or ref is provided as parameter $object=new Skeleton_Class($db); if (($id > 0 || ! empty($ref)) && $action != 'add') @@ -290,7 +292,7 @@ if ($action == 'create') // Part to edit record -if ($id && $action == 'edit') +if (($id || $ref) && $action == 'edit') { dol_fiche_head(); From 1ec7d4b4884a72018cb00d7e2767b05e2d653be9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Aug 2014 23:32:42 +0200 Subject: [PATCH 489/502] Vat rate 0 first --- htdocs/install/mysql/data/llx_c_tva.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index b73d128c6ad..01d2894bca6 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -124,17 +124,17 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 3 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1); -- INDIA (id country=117) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1); -- IRELAND (id country=8) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '23','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (82, 8, '13.5','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (83, 8, '9','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (84, 8, '4.8','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (85, 8, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (82, 8, '23','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (83, 8, '13.5','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (84, 8, '9','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (85, 8, '4.8','0','VAT reduced rate',1); -- JAPAN (id country=123) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1); From 68aca6f2bb978000d35b155f66e3850619d0e92d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 18 Aug 2014 08:36:58 +0200 Subject: [PATCH 490/502] Fix: project builddoc trigger is used now --- htdocs/core/modules/project/modules_project.php | 6 +++--- .../core/triggers/interface_90_all_Demo.class.php-NORUN | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 22273be31dd..363bfb67e80 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2014 Regis Houssin * * 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 @@ -226,10 +226,10 @@ function project_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, dol_meta_create($object); // Appel des triggers - /*include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('PROJECT_BUILDDOC',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; }*/ + if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers return 1; diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index d1f093af09b..c5749a18459 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -1,7 +1,7 @@ - * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2014 Marcos García * * 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 @@ -227,6 +227,7 @@ class InterfaceDemo extends DolibarrTriggers case 'PROJECT_CREATE': case 'PROJECT_MODIFY': case 'PROJECT_DELETE': + case 'PROJECT_BUILDDOC': // Project tasks case 'TASK_CREATE': @@ -253,4 +254,4 @@ class InterfaceDemo extends DolibarrTriggers return 0; } -} \ No newline at end of file +} From 6ab41766c864f2de8980f0d9bd87805d40bb4e3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 18 Aug 2014 20:23:06 +0200 Subject: [PATCH 491/502] Fix: define new ref before trigger --- htdocs/commande/class/commande.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ac66f7fb048..aefdb620551 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011 Jean Heimburger @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU *General Public License as published by + * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * @@ -301,6 +301,13 @@ class Commande extends CommonOrder } } + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->statut = 1; + } + if (! $error) { // Call trigger @@ -309,13 +316,6 @@ class Commande extends CommonOrder // End call triggers } - // Set new ref and current status - if (! $error) - { - $this->ref = $num; - $this->statut = 1; - } - if (! $error) { $this->db->commit(); From 7437eb8088824078528e835e589a61d19a673481 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Aug 2014 14:40:20 +0200 Subject: [PATCH 492/502] New: On contact list can set filter on both active and not active (no more exclusive select). --- ChangeLog | 1 + htdocs/core/lib/company.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6846787754..9be60e523f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: On contact list can set filter on both active and not active (no more exclusive select). - New: Each user can include its own external ics calendar into dolibarr agenda view. - New: Intervention documents are now available in ECM module. - New: Can attach supplier order to a customer order. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 9b0661e063a..a262ea8441d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -634,7 +634,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') // Status print ''; - print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print $form->selectarray('search_status', array('-1'=>'','0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; // Copy to clipboard @@ -659,7 +659,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $sql .= ", p.civilite as civility_id, p.address, p.zip, p.town"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; - if ($search_status!='') $sql .= " AND p.statut = ".$db->escape($search_status); + if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status); if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')"; $sql.= " ORDER BY $sortfield $sortorder"; From a26a7cedf8d5ed1c0fef5b065090fce96862bbd5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Aug 2014 14:49:12 +0200 Subject: [PATCH 493/502] Qual: Uniformize code. Trigger PROJECT_BUILDDOC is removed because building a doc is not a business event. For technical action after creation of a pdf, hook "afterPDFCreation" must be used instead. --- ChangeLog | 2 ++ htdocs/core/modules/project/modules_project.php | 7 ------- .../core/modules/project/pdf/pdf_baleine.modules.php | 12 ++++++++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9be60e523f5..7d22836f5e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -87,6 +87,8 @@ Dolibarr better: - Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php - Some field into database wwere renamed from "libelle" to "label". - Table llx_c_pays were renamed into llx_c_country. +- Trigger PROJECT_BUILDDOC is removed. Building a doc is not a business event. For action after + creation of a pdf, hook "afterPDFCreation" must be used instead. ***** ChangeLog for 3.6 compared to 3.5.* ***** diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 363bfb67e80..ecaf0213bc0 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -225,13 +225,6 @@ function project_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, // Success in building document. We build meta file. dol_meta_create($object); - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('PROJECT_BUILDDOC',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers - return 1; } else diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index c8cc0b65fbc..e6505c05283 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -295,6 +295,18 @@ class pdf_baleine extends ModelePDFProjects $pdf->Close(); $pdf->Output($file,'F'); + + // Add pdfgeneration hook + if (! is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + } + $hookmanager->initHooks(array('pdfgeneration')); + $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + global $action; + $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); From a220634d30ec87c673054e3a9305874205ba3da0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Aug 2014 14:53:30 +0200 Subject: [PATCH 494/502] Revert "Fix: define new ref before trigger" This reverts commit 6ab41766c864f2de8980f0d9bd87805d40bb4e3e. --- htdocs/commande/class/commande.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index aefdb620551..ac66f7fb048 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011 Jean Heimburger @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by + * it under the terms of the GNU *General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * @@ -301,13 +301,6 @@ class Commande extends CommonOrder } } - // Set new ref and current status - if (! $error) - { - $this->ref = $num; - $this->statut = 1; - } - if (! $error) { // Call trigger @@ -316,6 +309,13 @@ class Commande extends CommonOrder // End call triggers } + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->statut = 1; + } + if (! $error) { $this->db->commit(); From 86d91ff698599b61d63018f5ee0a941fbff83499 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Aug 2014 15:03:55 +0200 Subject: [PATCH 495/502] Fix: Setting new property of object must be done only after all database actions are ok (and if ok). --- htdocs/compta/facture/class/facture.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9b0e236af35..c46f48ed1c6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1763,16 +1763,6 @@ class Facture extends CommonInvoice } } - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->facnumber=$num; - $this->statut=1; - $this->brouillon=0; - $this->date_validation=$now; - } - // Trigger calls if (! $error) { @@ -1782,6 +1772,16 @@ class Facture extends CommonInvoice //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail // End call triggers } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->facnumber=$num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } } else { From af92eb372589f56e8e212538e5c6b465d74acdc9 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Wed, 20 Aug 2014 07:49:53 +0200 Subject: [PATCH 496/502] Problem of merging --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 0c25049d7e2..868496f3316 100644 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -972,7 +972,6 @@ CREATE TABLE llx_holiday_types ( deleteAt DATETIME, nbCongesDeducted varchar(255) NOT NULL, nbCongesEveryMonth varchar(255) NOT NULL -<<<<<<< HEAD ); -- Change on table c_civilite @@ -983,17 +982,13 @@ ALTER TABLE llx_c_civility ADD UNIQUE INDEX uk_c_civility(code); ALTER TABLE llx_adherent CHANGE civilite civility VARCHAR(6); ALTER TABLE llx_socpeople CHANGE civilite civility VARCHAR(6); ALTER TABLE llx_user CHANGE civilite civility VARCHAR(6); -======= ) ENGINE=innodb; ALTER TABLE llx_c_type_fees CHANGE libelle label VARCHAR(30); ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label; - ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_element (fk_element); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date); ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour); - ->>>>>>> refs/remotes/Upstream/develop From 820ae820885316b1581ccb8148da9350ea3d6220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 20 Aug 2014 10:46:09 +0200 Subject: [PATCH 497/502] Fix: module still using deprecated dictionnaries --- htdocs/core/modules/modProductBatch.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 2209fffb4ad..0cd30f04d22 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -78,13 +78,13 @@ class modProductBatch extends DolibarrModules $this->tabs = array(); - // Dictionnaries + // Dictionaries if (! isset($conf->productbatch->enabled)) { $conf->productbatch=new stdClass(); $conf->productbatch->enabled=0; } - $this->dictionnaries=array(); + $this->dictionaries=array(); // Boxes $this->boxes = array(); // List of boxes From 9f02bc78a79b4c7b46cbea73d60769bc19b7437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 20 Aug 2014 10:54:35 +0200 Subject: [PATCH 498/502] Fix: module still using deprecated civilite_id --- htdocs/core/modules/mailings/contacts1.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 3d0b0946b8f..2c80f4e9549 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -239,7 +239,7 @@ class mailing_contacts1 extends MailingTargets 'firstname' => $obj->firstname, 'other' => ($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'. - ($langs->transnoentities("UserTitle").'='.($obj->civilite_id?$langs->transnoentities("Civility".$obj->civilite_id):'')), + ($langs->transnoentities("UserTitle").'='.($obj->civility_id?$langs->transnoentities("Civility".$obj->civility_id):'')), 'source_url' => $this->url($obj->id), 'source_id' => $obj->id, 'source_type' => 'contact' From 1d5fb1320b21f6733c2fa7cf2aa61476a35137a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 20 Aug 2014 19:03:58 +0200 Subject: [PATCH 499/502] Fix: missing global declarations --- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/class/fournisseur.product.class.php | 2 +- htdocs/user/logout.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 50a18f5e57c..22466a3143f 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -365,7 +365,7 @@ class Fichinter extends CommonObject */ function setValid($user) { - global $langs, $conf; + global $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $error=0; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 367ba5b972e..bbb6dbdb33a 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -154,7 +154,7 @@ class ProductFournisseur extends Product */ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0) { - global $conf,$mysoc; + global $conf; // Clean parameter if (empty($qty)) $qty=0; diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 81434828592..37ff691fdcc 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -38,6 +38,7 @@ if (!empty($_SESSION["dol_authmode"]) && ($_SESSION["dol_authmode"] == 'forceuse die("Disconnection does not work when connection was made in mode ".$_SESSION["dol_authmode"]); } +global $conf, $langs, $user; // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; From bc0c5fb55ead1f05880baddd0634380190095a87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Aug 2014 14:24:06 +0200 Subject: [PATCH 500/502] New: Can modify order with status approved if it was not sent yet to supplier. --- htdocs/fourn/commande/fiche.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index e536c81f21c..a5d377c9e39 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -158,10 +158,11 @@ else if ($action == 'setremisepercent' && $user->rights->fournisseur->commande-> else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver) { - if (in_array($object->statut, array(1, 5, 6, 7, 9))) + if (in_array($object->statut, array(1, 2, 5, 6, 7, 9))) { if ($object->statut == 1) $newstatus=0; // Validated->Draft - else if ($object->statut == 5) $newstatus=4; // Received->Received partially + else if ($object->statut == 2) $newstatus=0; // Approved->Draft + else if ($object->statut == 5) $newstatus=4; // Received->Received partially else if ($object->statut == 6) $newstatus=2; // Canceled->Approved else if ($object->statut == 7) $newstatus=3; // Canceled->Process running else if ($object->statut == 9) $newstatus=1; // Refused->Validated @@ -1833,7 +1834,7 @@ elseif (! empty($object->id)) } // Reopen - if (in_array($object->statut, array(5, 6, 7, 9))) + if (in_array($object->statut, array(2, 5, 6, 7, 9))) { if ($user->rights->fournisseur->commande->commander) { From c799f0f10fd9dfbf783924fbc6276a9659635b98 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Aug 2014 15:02:18 +0200 Subject: [PATCH 501/502] Uniformize code: New: Call to hook after generation is also done into odt. Fix: Missing hook before save. --- .../doc/doc_generic_order_odt.modules.php | 2 ++ .../doc/doc_generic_shipment_odt.modules.php | 2 ++ .../doc/doc_generic_invoice_odt.modules.php | 2 ++ .../pdf/doc_generic_project_odt.modules.php | 2 ++ .../task/pdf/doc_generic_task_odt.modules.php | 26 +++++++++++++++++-- .../doc/doc_generic_proposal_odt.modules.php | 2 ++ .../societe/doc/doc_generic_odt.modules.php | 2 ++ 7 files changed, 36 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 67d45c39bb3..895ad153fc8 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -482,6 +482,8 @@ class doc_generic_order_odt extends ModelePDFCommandes } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index beed6fb5cdb..b4325139878 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -482,6 +482,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 9b89555a9ff..0084df11e72 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -439,6 +439,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php index 75b06755b80..5b3aa9a85e2 100644 --- a/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/pdf/doc_generic_project_odt.modules.php @@ -1019,6 +1019,8 @@ class doc_generic_project_odt extends ModelePDFProjects } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php index 2c0bdc4f53b..acbd33bcc5a 100644 --- a/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/pdf/doc_generic_task_odt.modules.php @@ -816,9 +816,31 @@ class doc_generic_task_odt extends ModelePDFTask } + // Call the beforeODTSave hook + $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); + $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + + // Write new file - $odfHandler->saveToDisk($file); - + if (!empty($conf->global->MAIN_ODT_AS_PDF)) { + try { + $odfHandler->exportAsAttachedPDF($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } + } + else { + try { + $odfHandler->saveToDisk($file); + }catch (Exception $e){ + $this->error=$e->getMessage(); + return -1; + } + } + + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 9b03ecd1070..f216d69a0fd 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -517,6 +517,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 539bc169958..90ced6322b7 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -416,6 +416,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc } } + $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); From fc02f0f08f76475307ae1b32af72ff6dc481ce9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Aug 2014 23:43:11 +0200 Subject: [PATCH 502/502] Fix: No new inside a constructor method. --- htdocs/projet/activity/list.php | 2 +- htdocs/projet/class/project.class.php | 5 ++--- htdocs/projet/element.php | 28 +++++++++++++-------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 09cc56c54e8..c0b3743c980 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -121,7 +121,7 @@ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // R if ($id) { $project->fetch($id); - $project->societe->fetch($project->societe->id); + $project->fetch_thirdparty(); } $tasksarray=$taskstatic->getTasksArray(0,0,($project->id?$project->id:$projectsListId),$socid,0); // We want to see all task of project i am allowed to see, not only mine. Later only mine will be editable later. diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 3279221d0c4..7f8fd52c500 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -53,7 +53,6 @@ class Project extends CommonObject var $statuts; var $oldcopy; - /** * Constructor * @@ -62,7 +61,6 @@ class Project extends CommonObject function __construct($db) { $this->db = $db; - $this->societe = new Societe($db); $this->statuts_short = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); $this->statuts = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); @@ -982,6 +980,7 @@ class Project extends CommonObject // Load source object $clone_project->fetch($fromid); + $clone_project->fetch_thirdparty(); $orign_dt_start=$clone_project->date_start; $orign_project_ref=$clone_project->ref; @@ -1009,7 +1008,7 @@ class Project extends CommonObject require_once DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.'.php'; $modProject = new $obj; - $defaultref = $modProject->getNextValue($clone_project->societe->id,$clone_project); + $defaultref = $modProject->getNextValue(is_object($clone_project->thirdparty)?$clone_project->thirdparty->id:0,$clone_project); } if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 53559c74333..abdf6f81b5b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -89,7 +89,7 @@ $userstatic=new User($db); $project = new Project($db); $project->fetch($projectid,$ref); -$project->societe->fetch($project->societe->id); +$project->fetch_thirdparty(); // To verify role of users $userAccess = $project->restrictedProjectArea($user); @@ -115,7 +115,7 @@ print ''; print ''.$langs->trans("Label").''.$project->title.''; print ''.$langs->trans("ThirdParty").''; -if (! empty($project->societe->id)) print $project->societe->getNomUrl(1); +if (! empty($project->thirdparty->id)) print $project->thirdparty->getNomUrl(1); else print ' '; print ''; @@ -229,7 +229,7 @@ foreach ($listofreferent as $key => $value) print_titre($langs->trans($title)); - $selectList=$formproject->select_element($tablename,$project->societe->id); + $selectList=$formproject->select_element($tablename,$project->thirdparty->id); if (!$selectList || ($selectList<0)) { setEventMessage($formproject->error,'errors'); @@ -244,7 +244,7 @@ foreach ($listofreferent as $key => $value) print ''; } print ''; - + print ''; print ''; print ''; @@ -272,7 +272,7 @@ foreach ($listofreferent as $key => $value) { if ($element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice } - + $var=!$var; print ""; @@ -294,7 +294,7 @@ foreach ($listofreferent as $key => $value) print ''; // Amount - if (empty($value['disableamount'])) + if (empty($value['disableamount'])) { print '
'.$langs->trans("Ref").''.$langs->trans("Date").'
'; if (! $qualifiedfortotal) print ''; @@ -304,7 +304,7 @@ foreach ($listofreferent as $key => $value) } // Amount - if (empty($value['disableamount'])) + if (empty($value['disableamount'])) { print ''; if (! $qualifiedfortotal) print ''; @@ -341,30 +341,30 @@ foreach ($listofreferent as $key => $value) if ($project->statut > 0) { - if ($project->societe->prospect || $project->societe->client) + if ($project->thirdparty->prospect || $project->thirdparty->client) { if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer) { - print ''.$langs->trans("AddProp").''; + print ''.$langs->trans("AddProp").''; } if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer) { - print ''.$langs->trans("AddCustomerOrder").''; + print ''.$langs->trans("AddCustomerOrder").''; } if ($key == 'invoice' && ! empty($conf->facture->enabled) && $user->rights->facture->creer) { - print ''.$langs->trans("AddCustomerInvoice").''; + print ''.$langs->trans("AddCustomerInvoice").''; } } - if ($project->societe->fournisseur) + if ($project->thirdparty->fournisseur) { if ($key == 'order_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) { - print ''.$langs->trans("AddSupplierInvoice").''; + print ''.$langs->trans("AddSupplierInvoice").''; } if ($key == 'invoice_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) { - print ''.$langs->trans("AddSupplierOrder").''; + print ''.$langs->trans("AddSupplierOrder").''; } } }