diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 94ce450ff30..5bdaa3c5828 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -147,6 +147,7 @@ if ($result) { print '
'; print '' . $langs->trans("Addanaccount") . ''; + print '' . $langs->trans("ApplyMassCategories") . ''; // print '' . $langs->trans("ImportAccount") . ''; // print '' . $langs->trans("CheckProductAccountancyCode") . ''; print '

'; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php new file mode 100644 index 00000000000..f0013632b53 --- /dev/null +++ b/htdocs/accountancy/admin/categories.php @@ -0,0 +1,157 @@ + + * + * 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/accountancy/admin/categories.php + * \ingroup Advanced accountancy + * \brief Page to assign mass categories to accounts + */ +require '../../main.inc.php'; + +// Class +require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancycategory.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; + +$error = 0; + +// Langs +$langs->load("bills"); +$langs->load("accountancy"); + +$mesg = ''; +$action = GETPOST('action'); +$cat_id = GETPOST('account_category'); +$selectcpt = GETPOST('cpt_bk'); +$cpt_id = GETPOST('cptid'); + +if($cat_id == 0){ + $cat_id = null; +} + +$id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'int'); +$cancel = GETPOST('cancel'); + +// Security check +if (! $user->admin) + accessforbidden(); + +$AccCat = new AccountancyCategory($db); + +// si ajout de comptes +if(!empty($selectcpt)){ + $cpts = array(); + $i = 0; + foreach ($selectcpt as $selectedOption){ + $cpts[$i] = "'".$selectedOption."'"; + $i++; + } + + if($AccCat->updateAccAcc($cat_id, $cpts)){ + setEventMessages($langs->trans('Saved'), null, 'mesgs'); + }else{ + setEventMessages($langs->trans('errors'), null, 'errors'); + } + + +} +if ($action == 'delete') { + if($cpt_id){ + if($AccCat->deleteCptCat($cpt_id)){ + setEventMessages($langs->trans('Deleted'), null, 'mesgs'); + }else{ + setEventMessages($langs->trans('errors'), null, 'errors'); + } + } +} + +/* + * View + */ +llxheader('', $langs->trans('AccountAccounting')); + +$formaccounting = new FormAccounting($db); +$form = new Form($db); + + print load_fiche_titre($langs->trans('Categories')); + + print '
' . "\n"; + print ''; + print ''; + + dol_fiche_head(); + + print ''; + // Category + print ''; + print ''; + + + if(!empty($cat_id)){ + $obj = $AccCat->getCptBK($cat_id); + print ''; + print ''; + } + + print '
' . $langs->trans("AccountingCategory") . ''; + $formaccounting->select_accounting_category($cat_id, 'account_category', 1); + print ''; + print '
' . $langs->trans("AddCompteFromBK") . ''; + if(!empty($obj)){ + print ' - '; + } + print '
'; + + dol_fiche_end(); + + print '
'; + +if ($action == 'display' || $action == 'delete') { + + print ''; + + print ''; + + if(!empty($cat_id)){ + $obj = $AccCat->display($cat_id); + $j=1; + if(!empty($obj)){ + foreach ( $obj as $cpt ) { + $var = ! $var; + print ""; + print ''; + print ''; + print $form->formconfirm($_SERVER["PHP_SELF"]."?account_category=$cat_id&cptid=".$cpt->rowid, $langs->trans("DeleteCptCategory"), $langs->trans("ConfirmDeleteCptCategory"), "delete", '', 0, "action-delete".$j); + print ''; + print "\n"; + $j++; + } + } + } + + print "
'.$langs->trans("Numerocompte").''.$langs->trans("Description").'Action
' . length_accountg($cpt->account_number) . '' . $cpt->label . '
"; +} + +llxFooter(); + +$db->close(); \ No newline at end of file diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index e04cc7132f0..e663557d22c 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 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 @@ -205,8 +205,8 @@ if ($action == 'create') { // Ref print ""; - print '' . $langs->trans("Ref") . ''; - print $object->rowid; + print '' . $langs->trans("Ref") . ''; + print $object->ref; print ''; // Label @@ -252,11 +252,11 @@ if ($action == 'create') { print ''; - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; // Ref print ''; @@ -270,16 +270,16 @@ if ($action == 'create') { // Date start print ''; // Date end 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 ''; -print ""; +//print ""; +//print ''; +//print ""; print '
' . $langs->trans("Ref") . ''; - print $object->rowid; + print $object->ref; print ''; print $linkback; 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 '
'; - 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 '
'; print ''; @@ -261,7 +252,7 @@ if ($resql) // Build barcode on disk (not used, this is done to make debug easier) $result=$module->writeBarCode($obj->example,$obj->encoding,'Y'); // Generate on the fly and output barcode with generator - $url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); + $url=DOL_URL_ROOT.'/viewimage.php?modulepart=barcode&generator='.urlencode($obj->coder).'&code='.urlencode($obj->example).'&encoding='.urlencode($obj->encoding); //print $url; print ''; } @@ -296,7 +287,7 @@ if (empty($conf->use_javascript_ajax)) // TODO Implement code behind action updateengine //print '
'; } -print ''; +//print ''; print "
"; @@ -331,9 +322,7 @@ if (! isset($_SERVER['WINDIR'])) $langs->load("errors"); print '
'.$langs->trans("ErrorFileNotFound",$conf->global->GENBARCODE_LOCATION).''; } - print ''; - print ''; - print ''; + print ''; } // Module products @@ -344,10 +333,7 @@ if (! empty($conf->product->enabled)) print ''; print '"; - print ''; + print ''; } // Module thirdparty @@ -358,13 +344,13 @@ if (! empty($conf->societe->enabled)) print ''; print '"; - print ''; + print ''; } print "
'.$langs->trans("SetDefaultBarcodeTypeProducts").''; $formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1); - print ''; - print ''; - print "
'.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1); - print ''; - print ''; - print "
\n"; +print '
'; +print ''; +print "
"; 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 "
"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index f1bf108f14c..59aa71b5595 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -197,7 +197,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) else { $var=!$var; - print ''.$langs->trans("NoProposal").''; + print ''.$langs->trans("NoProposal").''; } print "
"; @@ -277,7 +277,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos else { $var=!$var; - print ''.$langs->trans("NoProposal").''; + print ''.$langs->trans("NoProposal").''; } print "
"; @@ -357,7 +357,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) else { $var=!$var; - print ''.$langs->trans("NoOrder").''; + print ''.$langs->trans("NoOrder").''; } print "
"; @@ -438,7 +438,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande else { $var=!$var; - print ''.$langs->trans("NoSupplierOrder").''; + print ''.$langs->trans("NoSupplierOrder").''; } print "
"; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0aa828dc77a..fa1b2064ed2 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -216,6 +216,11 @@ if (! empty($conf->commande->enabled)) $i++; } } + else + { + $var=!$var; + print ''.$langs->trans("NoOrder").''; + } print "
"; } } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 0f513412a93..f0a8c82df1b 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -199,7 +199,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } else { - print ''.$langs->trans("NoInvoice").''; + print ''.$langs->trans("NoInvoice").''; } print "
"; $db->free($resql); @@ -275,7 +275,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } else { - print ''.$langs->trans("NoInvoice").''; + print ''.$langs->trans("NoInvoice").''; } print "
"; $db->free($resql); diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 04fccce1285..f20cf663b2c 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -273,7 +273,7 @@ class modAccounting extends DolibarrModules $this->rights[$r][0] = 50440; $this->rights[$r][1] = 'Manage chart of accounts'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'chartofaccount'; $this->rights[$r][5] = ''; $r++; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c52c72ff509..b4b82be7726 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1736,72 +1736,80 @@ else if ($id || $ref) { 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 ''.$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 ''.$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 ''.$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 ''.$langs->trans("ReOpen").''; + } + + // Send + if ($object->statut > 0) + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) + { + print ''.$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 ''.$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 ''.$langs->trans($label).''; + } + } + + if ($user->rights->expedition->supprimer) + { + print ''.$langs->trans("Delete").''; + } + } - // Send - if ($object->statut > 0) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) - { - print ''.$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 ''.$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 ''.$langs->trans($label).''; - } - } - - if ($user->rights->expedition->supprimer) - { - print ''.$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 +-- +-- 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_accounting_journal ADD UNIQUE INDEX uk_accounting_journal_code (code); diff --git a/htdocs/install/mysql/tables/llx_accounting_journal.sql b/htdocs/install/mysql/tables/llx_accounting_journal.sql new file mode 100644 index 00000000000..bc514f0ed9b --- /dev/null +++ b/htdocs/install/mysql/tables/llx_accounting_journal.sql @@ -0,0 +1,27 @@ +-- ============================================================================ +-- Copyright (C) 2016 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 . +-- +-- Table of journals for accountancy +-- ============================================================================ + +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; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 64c0d88df48..46375e49ff9 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -149,6 +149,8 @@ FicheVentilation=Breakdown card GeneralLedgerIsWritten=Operations are written in the general ledger MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s +## Admin +ApplyMassCategories=Apply mass categories ## Export Exports=Exports