';
- $linkback = '' . $langs->trans("BackToList") . '';
+ $linkback = '' . $langs->trans("BackToList") . '';
// Ref
print '| ' . $langs->trans("Ref") . ' | ';
- print $object->rowid;
+ print $object->ref;
print ' | ';
print $linkback;
print ' |
';
@@ -270,16 +270,16 @@ if ($action == 'create') {
// Date start
print '| ';
- print $form->editfieldkey("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+ print $form->editfieldkey("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print ' | ';
- print $form->editfieldval("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+ print $form->editfieldval("DateStart", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print ' |
';
// Date end
print '| ';
- print $form->editfieldkey("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+ print $form->editfieldkey("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print ' | ';
- print $form->editfieldval("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+ print $form->editfieldval("DateEnd", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
print ' |
';
// Statut
diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index 92ea01660ac..ef880aa8113 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -19,7 +19,7 @@
/**
* \file htdocs/accountancy/class/accountancycategory.class.php
* \ingroup Advanced accountancy
- * \brief File of class to manage categories of an accounting account_category
+ * \brief File of class to manage categories of an accounting category_type
*/
// Class
@@ -243,7 +243,7 @@ class AccountancyCategory
}
else
{
- $sql = "SELECT c.rowid, c.code, c.label, c.account_category ";
+ $sql = "SELECT c.rowid, c.code, c.label, c.category_type ";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c, ".MAIN_DB_PREFIX."c_country as co";
$sql.= " WHERE c.active = 1 AND c.fk_country = co.rowid";
$sql.= " AND co.code = '".$mysoc->country_code."'";
@@ -343,7 +343,7 @@ class AccountancyCategory
{
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
- $sql.= " WHERE c.active = 1 AND c.account_category = 1 ";
+ $sql.= " WHERE c.active = 1 AND c.category_type = 1 ";
$sql.= " AND c.fk_country = ".$mysoc->country_id;
$sql.= " ORDER BY c.position ASC";
}
@@ -351,7 +351,7 @@ class AccountancyCategory
{
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position";
$sql.= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c, ".MAIN_DB_PREFIX."c_country as co";
- $sql.= " WHERE c.active = 1 AND c.account_category = 1 AND c.fk_country = co.rowid";
+ $sql.= " WHERE c.active = 1 AND c.category_type = 1 AND c.fk_country = co.rowid";
$sql.= " AND co.code = '".$mysoc->country_code."'";
$sql.= " ORDER BY c.position ASC";
}
diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index b7cc6e94bf2..29475d712df 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -62,21 +62,12 @@ if ($action == 'setcoder')
}
else if ($action == 'update')
{
- if (GETPOST('submit_GENBARCODE_LOCATION'))
- {
- $location = GETPOST('GENBARCODE_LOCATION','alpha');
- $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
- }
- if (GETPOST('submit_PRODUIT_DEFAULT_BARCODE_TYPE'))
- {
- $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha');
- $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
- }
- if (GETPOST('submit_GENBARCODE_BARCODETYPE_THIRDPARTY'))
- {
- $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
- $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
- }
+ $location = GETPOST('GENBARCODE_LOCATION','alpha');
+ $res = dolibarr_set_const($db, "GENBARCODE_LOCATION",$location,'chaine',0,'',$conf->entity);
+ $coder_id = GETPOST('PRODUIT_DEFAULT_BARCODE_TYPE','alpha');
+ $res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
+ $coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
+ $res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
}
else if ($action == 'updateengine')
{
@@ -195,9 +186,9 @@ $var=true;
print '
';
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
-print "';
print '
';
@@ -419,13 +405,13 @@ if ($conf->produit->enabled)
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
{
- print '';
+ print ' | ';
print img_picto($langs->trans("Activated"),'switch_on');
print ' | ';
}
else
{
- print '';
+ print ' | ';
print img_picto($langs->trans("Disabled"),'switch_off');
print ' | ';
}
@@ -442,7 +428,7 @@ if ($conf->produit->enabled)
print "
\n";
}
-print '';
+//print '';
print "';
- if ($object->statut == 0 && $num_prod > 0)
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook))
{
- if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
- || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
- {
- print '
id.'&action=valid">'.$langs->trans("Validate").'';
- }
- else
- {
- print '
'.$langs->trans("Validate").'';
- }
- }
- // TODO add alternative status
- // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
- if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
- {
- print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ if ($object->statut == 0 && $num_prod > 0)
+ {
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
+ {
+ print '
id.'&action=valid">'.$langs->trans("Validate").'';
+ }
+ else
+ {
+ print '
'.$langs->trans("Validate").'';
+ }
+ }
+
+ // TODO add alternative status
+ // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
+ if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
+ {
+ print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ }
+
+ // Send
+ if ($object->statut > 0)
+ {
+ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
+ {
+ print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
+ }
+ else print '
'.$langs->trans('SendByMail').'';
+ }
+
+ // Create bill and Close shipment
+ if (! empty($conf->facture->enabled) && $object->statut > 0)
+ {
+ if ($user->rights->facture->creer)
+ {
+ print '
'.$langs->trans("CreateBill").'';
+ }
+ }
+
+ // This is just to generate a delivery receipt
+ //var_dump($object->linkedObjectsIds['delivery']);
+ if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
+ {
+ print '
id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'';
+ }
+ // Close
+ if (! empty($conf->facture->enabled) && $object->statut > 0)
+ {
+ if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
+ {
+ $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
+ // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
+ if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
+ {
+ $label="ClassifyBilled";
+ $paramaction='classifybilled';
+ }
+ print '
id.'&action='.$paramaction.'">'.$langs->trans($label).'';
+ }
+ }
+
+ if ($user->rights->expedition->supprimer)
+ {
+ print '
id.'&action=delete">'.$langs->trans("Delete").'';
+ }
+
}
- // Send
- if ($object->statut > 0)
- {
- if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
- {
- print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
- }
- else print '
'.$langs->trans('SendByMail').'';
- }
-
- // Create bill and Close shipment
- if (! empty($conf->facture->enabled) && $object->statut > 0)
- {
- if ($user->rights->facture->creer)
- {
- print '
'.$langs->trans("CreateBill").'';
- }
- }
-
- // This is just to generate a delivery receipt
- //var_dump($object->linkedObjectsIds['delivery']);
- if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
- {
- print '
id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'';
- }
- // Close
- if (! empty($conf->facture->enabled) && $object->statut > 0)
- {
- if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
- {
- $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
- // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
- if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
- {
- $label="ClassifyBilled";
- $paramaction='classifybilled';
- }
- print '
id.'&action='.$paramaction.'">'.$langs->trans($label).'';
- }
- }
-
- if ($user->rights->expedition->supprimer)
- {
- print '
id.'&action=delete">'.$langs->trans("Delete").'';
- }
-
print '
';
}
diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql
index d9cd97be585..e525ec1088f 100644
--- a/htdocs/install/mysql/data/llx_10_c_regions.sql
+++ b/htdocs/install/mysql/data/llx_10_c_regions.sql
@@ -294,3 +294,5 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va
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 Peru (id country=181)
+insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18101, '', 0, 'PerĂº', 1);
\ No newline at end of file
diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql
index 029ed4299c3..fb7fa83517b 100644
--- a/htdocs/install/mysql/data/llx_20_c_departements.sql
+++ b/htdocs/install/mysql/data/llx_20_c_departements.sql
@@ -1283,3 +1283,31 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0010', 14003, '', 0, '', 'Esch-sur-Alzette', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0011', 14003, '', 0, '', 'Luxembourg', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LU0012', 14003, '', 0, '', 'Mersch', 1);
+
+-- Provinces PerĂº (id country=181)
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AMA', 18101, '', 0, '', 'Amazonas', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ANC', 18101, '', 0, '', 'Ancash', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('APU', 18101, '', 0, '', 'Apurimac', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ARE', 18101, '', 0, '', 'Arequipa', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AYA', 18101, '', 0, '', 'Ayacucho', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CAJ', 18101, '', 0, '', 'Cajamarca', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CUS', 18101, '', 0, '', 'Cuzco', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CAL', 18101, '', 0, '', 'Callao', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HUV', 18101, '', 0, '', 'Huancavelica', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('HUC', 18101, '', 0, '', 'Huanuco', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ICA', 18101, '', 0, '', 'Ica', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JUN', 18101, '', 0, '', 'Junin', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LAL', 18101, '', 0, '', 'La Libertad', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LAM', 18101, '', 0, '', 'Lambayeque', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LIM', 18101, '', 0, '', 'Lima', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LMA', 18101, '', 0, '', 'Lima Metropolitana', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('LOR', 18101, '', 0, '', 'Loreto', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MDD', 18101, '', 0, '', 'Madre de Dios', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MOQ', 18101, '', 0, '', 'Moquegua', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PAS', 18101, '', 0, '', 'Pasco', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PIU', 18101, '', 0, '', 'Piura', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PUN', 18101, '', 0, '', 'Puno', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SAM', 18101, '', 0, '', 'San Martin', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TAC', 18101, '', 0, '', 'Tacna', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TUM', 18101, '', 0, '', 'Tumbes', 1);
+INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('UCA', 18101, '', 0, '', 'Ucayali', 1);
\ No newline at end of file
diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
index 0ab9708cb30..bf81785d3e3 100644
--- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
+++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
@@ -375,6 +375,16 @@ UPDATE llx_accounting_account SET account_parent = '0' WHERE account_parent = ''
-- VMYSQL4.1 ALTER TABLE llx_accounting_account MODIFY COLUMN account_parent integer DEFAULT 0;
-- VPGSQL8.2 ALTER TABLE llx_accounting_account ALTER COLUMN account_parent TYPE integer USING account_parent::integer;
+CREATE TABLE llx_accounting_journal
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ code varchar(32) NOT NULL,
+ label varchar(128) NOT NULL,
+ nature smallint DEFAULT 0 NOT NULL, -- type of journals (Sale / purchase / bank / various operations)
+ active smallint DEFAULT 0
+)ENGINE=innodb;
+
+ALTER TABLE llx_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code);
-- VMYSQL4.1 DROP INDEX uk_bordereau_cheque ON llx_bordereau_cheque;
-- VPGSQL8.2 DROP INDEX uk_bordereau_cheque;
diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.key.sql b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql
new file mode 100644
index 00000000000..e5083aa83d7
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_accounting_journal.key.sql
@@ -0,0 +1,20 @@
+-- ============================================================================
+-- Copyright (C) 2016 Alexandre Spangaro