mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Enhance vat edition
This commit is contained in:
parent
a204862c24
commit
e79292cb19
|
|
@ -266,7 +266,7 @@ $tabsql[DICT_ACTIONCOMM] = "SELECT a.id as rowid, a.code as code, a.libelle A
|
|||
$tabsql[DICT_CHARGESOCIALES] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, 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[DICT_TYPENT] = "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.position, 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[DICT_CURRENCIES] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
|
||||
$tabsql[DICT_TVA] = "SELECT t.rowid, t.entity, t.type_vat, t.code, 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 AND t.entity IN (".getEntity($tabname[DICT_TVA]).")";
|
||||
$tabsql[DICT_TVA] = "SELECT t.rowid, t.entity, t.code, t.type_vat, 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 AND t.entity IN (".getEntity($tabname[DICT_TVA]).")";
|
||||
$tabsql[DICT_TYPE_CONTACT] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
|
||||
$tabsql[DICT_PAYMENT_TERM] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity IN (".getEntity($tabname[DICT_PAYMENT_TERM]).")";
|
||||
$tabsql[DICT_PAIEMENT] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity IN (".getEntity($tabname[DICT_PAIEMENT]).")";
|
||||
|
|
@ -360,7 +360,7 @@ $tabfield[DICT_ACTIONCOMM] = "code,libelle,type,color,position";
|
|||
$tabfield[DICT_CHARGESOCIALES] = "code,libelle,country,accountancy_code";
|
||||
$tabfield[DICT_TYPENT] = "code,libelle,country_id,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
|
||||
$tabfield[DICT_CURRENCIES] = "code,label,unicode";
|
||||
$tabfield[DICT_TVA] = "country_id,country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[DICT_TVA] = "country_id,country,code,type_vat,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfield[DICT_TYPE_CONTACT] = "element,source,code,libelle,position";
|
||||
$tabfield[DICT_PAYMENT_TERM] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
|
||||
$tabfield[DICT_PAIEMENT] = "code,libelle,type";
|
||||
|
|
@ -407,7 +407,7 @@ $tabfieldvalue[DICT_ACTIONCOMM] = "code,libelle,type,color,position";
|
|||
$tabfieldvalue[DICT_CHARGESOCIALES] = "code,libelle,country,accountancy_code";
|
||||
$tabfieldvalue[DICT_TYPENT] = "code,libelle,country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
|
||||
$tabfieldvalue[DICT_CURRENCIES] = "code,label,unicode";
|
||||
$tabfieldvalue[DICT_TVA] = "country,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfieldvalue[DICT_TVA] = "country,code,type_vat,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
|
||||
$tabfieldvalue[DICT_TYPE_CONTACT] = "element,source,code,libelle,position";
|
||||
$tabfieldvalue[DICT_PAYMENT_TERM] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder";
|
||||
$tabfieldvalue[DICT_PAIEMENT] = "code,libelle,type";
|
||||
|
|
@ -454,7 +454,7 @@ $tabfieldinsert[DICT_ACTIONCOMM] = "code,libelle,type,color,position";
|
|||
$tabfieldinsert[DICT_CHARGESOCIALES] = "code,libelle,fk_pays,accountancy_code";
|
||||
$tabfieldinsert[DICT_TYPENT] = "code,libelle,fk_country".(getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? ',position' : '');
|
||||
$tabfieldinsert[DICT_CURRENCIES] = "code_iso,label,unicode";
|
||||
$tabfieldinsert[DICT_TVA] = "fk_pays,type_vat,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
|
||||
$tabfieldinsert[DICT_TVA] = "fk_pays,code,type_vat,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note,entity";
|
||||
$tabfieldinsert[DICT_TYPE_CONTACT] = "element,source,code,libelle,position";
|
||||
$tabfieldinsert[DICT_PAYMENT_TERM] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity";
|
||||
$tabfieldinsert[DICT_PAIEMENT] = "code,libelle,type,entity";
|
||||
|
|
@ -729,7 +729,7 @@ if ($id == DICT_TYPE_CONTACT) {
|
|||
|
||||
// Define type_vatList (used for dictionary "llx_c_tva")
|
||||
$type_vatList = array(
|
||||
"0" => $langs->trans("All"),
|
||||
"0" => $langs->trans("Sell").'+'.$langs->trans("Buy"),
|
||||
"1" => $langs->trans("Sell"),
|
||||
"2" => $langs->trans("Buy")
|
||||
);
|
||||
|
|
@ -1308,7 +1308,7 @@ if (GETPOSTINT('id') == DICT_SOCIALNETWORKS && $from == 'socialnetworksetup') {
|
|||
$linkback = '';
|
||||
if ($id && empty($from)) {
|
||||
$title .= ' - '.$langs->trans($tablib[$id]);
|
||||
$linkback = '<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
||||
$linkback = '<a href="'.$_SERVER['PHP_SELF'].'">'.img_picto($langs->trans("BackToDictionaryList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToDictionaryList").'</span></a>';
|
||||
}
|
||||
$titlepicto = 'title_setup';
|
||||
if ($id == DICT_TVA && GETPOST('from') == 'accountancy') {
|
||||
|
|
@ -1518,7 +1518,7 @@ if ($id > 0) {
|
|||
}
|
||||
if ($value == 'localtax1') {
|
||||
$valuetoshow = $langs->trans("RateOfTaxN", '2');
|
||||
$class = "center";
|
||||
$class = "center minwidth75";
|
||||
}
|
||||
if ($value == 'localtax2_type') {
|
||||
$valuetoshow = $langs->trans("UseLocalTax")." 3";
|
||||
|
|
@ -1527,7 +1527,7 @@ if ($id > 0) {
|
|||
}
|
||||
if ($value == 'localtax2') {
|
||||
$valuetoshow = $langs->trans("RateOfTaxN", '3');
|
||||
$class = "center";
|
||||
$class = "center minwidth75";
|
||||
}
|
||||
if ($value == 'type_vat') {
|
||||
$valuetoshow = $langs->trans("VATType");
|
||||
|
|
@ -1865,6 +1865,11 @@ if ($id > 0) {
|
|||
print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
|
||||
print '</td>';
|
||||
$colspan++;
|
||||
} elseif ($value == 'type_vat') {
|
||||
print '<td class="liste_titre">';
|
||||
print $form->selectarray('search_'.$value, $type_vatList, (empty($obj->{$value}) ? '' : $obj->{$value}), 1);
|
||||
print '</td>';
|
||||
$colspan++;
|
||||
} else {
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
|
|
@ -1946,27 +1951,27 @@ if ($id > 0) {
|
|||
|
||||
if ($value == 'type_vat') {
|
||||
$valuetoshow = $langs->trans("VATType");
|
||||
$cssprefix = "center ";
|
||||
$cssprefix = "center minwidth75 ";
|
||||
$sortable = 0;
|
||||
}
|
||||
if ($value == 'localtax1_type') {
|
||||
$valuetoshow = $langs->trans("UseLocalTax")." 2";
|
||||
$cssprefix = "center ";
|
||||
$cssprefix = "center minwidth75 ";
|
||||
$sortable = 0;
|
||||
}
|
||||
if ($value == 'localtax1') {
|
||||
$valuetoshow = $langs->trans("RateOfTaxN", '2');
|
||||
$cssprefix = "center ";
|
||||
$cssprefix = "center minwidth75 ";
|
||||
$sortable = 0;
|
||||
}
|
||||
if ($value == 'localtax2_type') {
|
||||
$valuetoshow = $langs->trans("UseLocalTax")." 3";
|
||||
$cssprefix = "center ";
|
||||
$cssprefix = "center minwidth75 ";
|
||||
$sortable = 0;
|
||||
}
|
||||
if ($value == 'localtax2') {
|
||||
$valuetoshow = $langs->trans("RateOfTaxN", '3');
|
||||
$cssprefix = "center ";
|
||||
$cssprefix = "center minwidth75 ";
|
||||
$sortable = 0;
|
||||
}
|
||||
if ($value == 'organization') {
|
||||
|
|
@ -2429,11 +2434,7 @@ if ($id > 0) {
|
|||
} elseif ($value == 'localtax1' || $value == 'localtax2') {
|
||||
$class = "center";
|
||||
} elseif ($value == 'type_vat') {
|
||||
if ($obj->type_vat != 0) {
|
||||
$valuetoshow = $type_vatList[$valuetoshow];
|
||||
} else {
|
||||
$valuetoshow = $langs->transnoentitiesnoconv("All");
|
||||
}
|
||||
$valuetoshow = $type_vatList[(int) $valuetoshow];
|
||||
$class = "center";
|
||||
} elseif ($value == 'localtax1_type') {
|
||||
if ($obj->localtax1 != 0) {
|
||||
|
|
@ -2808,7 +2809,7 @@ function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
}
|
||||
}
|
||||
if (!$transfound) {
|
||||
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'. $value .'">'.(!empty($obj->{$value}) ? $obj->{$value} : '').'</textarea>';
|
||||
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'. $value .'">'.(empty($obj->{$value}) ? '' : $obj->{$value}).'</textarea>';
|
||||
} else {
|
||||
print '<input type="hidden" name="'. $value .'" value="'.$transkey.'">';
|
||||
}
|
||||
|
|
@ -2819,10 +2820,10 @@ function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
print '<td>';
|
||||
if ($tabname == 'c_paiement' && in_array($obj->{$value}, array('LIQ', 'CB', 'CHQ', 'VIR'))) {
|
||||
// Case of code that should not be modified
|
||||
print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value} : '').'" name="'. $value .'">';
|
||||
print '<input type="hidden" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">';
|
||||
print $obj->{$value};
|
||||
} else {
|
||||
print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(!empty($obj->{$value}) ? $obj->{$value} : '').'" name="'. $value .'">';
|
||||
print '<input type="text" class="flat minwidth75 maxwidth100" value="'.(empty($obj->{$value}) ? '' : $obj->{$value}).'" name="'. $value .'">';
|
||||
}
|
||||
print '</td>';
|
||||
} elseif ($value == 'unit') {
|
||||
|
|
@ -2833,27 +2834,27 @@ function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
|||
'point' => $langs->trans('SizeUnitpoint'),
|
||||
'inch' => $langs->trans('SizeUnitinch')
|
||||
);
|
||||
print $form->selectarray('unit', $units, (!empty($obj->{$value}) ? $obj->{$value} : ''), 0, 0, 0);
|
||||
print $form->selectarray('unit', $units, (empty($obj->{$value}) ? '' : $obj->{$value}), 0, 0, 0);
|
||||
print '</td>';
|
||||
} elseif ($value == 'type_vat') {
|
||||
// VAT type 0: all, 1: sell, 2: purchase
|
||||
print '<td class="center">';
|
||||
print $form->selectarray($value, $type_vatList, (!empty($obj->{$value}) ? $obj->{$value} : ''));
|
||||
print $form->selectarray($value, $type_vatList, (empty($obj->{$value}) ? '' : $obj->{$value}), 1);
|
||||
print '</td>';
|
||||
} elseif ($value == 'localtax1_type' || $value == 'localtax2_type') {
|
||||
// Le type de taxe locale
|
||||
print '<td class="center">';
|
||||
print $form->selectarray($value, $localtax_typeList, (!empty($obj->{$value}) ? $obj->{$value} : ''));
|
||||
print $form->selectarray($value, $localtax_typeList, (empty($obj->{$value}) ? '' : $obj->{$value}));
|
||||
print '</td>';
|
||||
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
|
||||
print '<td>';
|
||||
if (isModEnabled('accounting')) {
|
||||
$fieldname = $value;
|
||||
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
|
||||
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, array(), 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
$accountancy_account = (empty($obj->$fieldname) ? 0 : $obj->$fieldname);
|
||||
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, array(), 1, 1, 'maxwidth125 maxwidthonsmartphone');
|
||||
} else {
|
||||
$fieldname = $value;
|
||||
print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'. $value .'">';
|
||||
print '<input type="text" class="flat minwidth100" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'. $value .'">';
|
||||
}
|
||||
print '</td>';
|
||||
} elseif ($value == 'fk_tva') {
|
||||
|
|
|
|||
|
|
@ -5011,7 +5011,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||
'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'ai', 'angle-double-down', 'angle-double-up', 'asset',
|
||||
'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'birthday-cake', 'bom', 'bookcal', 'bookmark', 'briefcase-medical', 'bug', 'building',
|
||||
'back', 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'birthday-cake', 'bom', 'bookcal', 'bookmark', 'briefcase-medical', 'bug', 'building',
|
||||
'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype',
|
||||
'cash-register', 'category', 'chart', 'check', 'clock', 'clone', 'close_title', 'code', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cross', 'cubes',
|
||||
'check-circle', 'check-square', 'circle', 'stop-circle', 'currency', 'multicurrency',
|
||||
|
|
@ -5059,7 +5059,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $srco
|
|||
$arrayconvpictotofa = array(
|
||||
'account' => 'university', 'accounting_account' => 'clipboard-list', 'accountline' => 'receipt', 'accountancy' => 'search-dollar', 'action' => 'calendar-alt', 'add' => 'plus-circle', 'address' => 'address-book', 'ai' => 'magic',
|
||||
'asset' => 'money-check-alt', 'autofill' => 'fill',
|
||||
'bank_account' => 'university',
|
||||
'back' => 'arrow-left', 'bank_account' => 'university',
|
||||
'bill' => 'file-invoice-dollar', 'billa' => 'file-excel', 'billr' => 'file-invoice-dollar', 'billd' => 'file-medical',
|
||||
'bookcal' => 'calendar-check',
|
||||
'supplier_invoice' => 'file-invoice-dollar', 'supplier_invoicea' => 'file-excel', 'supplier_invoicer' => 'file-invoice-dollar', 'supplier_invoiced' => 'file-medical',
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ ALTER TABLE llx_societe_perentity MODIFY COLUMN accountancy_code_customer varcha
|
|||
ALTER TABLE llx_societe_perentity MODIFY COLUMN accountancy_code_supplier varchar(32);
|
||||
|
||||
|
||||
|
||||
-- Copy categories from llx_category_bank into llx_categorie
|
||||
|
||||
INSERT INTO llx_categorie (entity, fk_parent, label, type, description, color, position, visible, date_creation)
|
||||
|
|
|
|||
|
|
@ -23,18 +23,17 @@ create table llx_c_tva
|
|||
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
fk_pays integer NOT NULL,
|
||||
type_vat smallint NOT NULL DEFAULT 0, -- 0: all, 1: sell, 2: purchase
|
||||
code varchar(10) DEFAULT '', -- a key to describe vat entry, for example FR20
|
||||
type_vat smallint NOT NULL DEFAULT 0, -- 0: all, 1: sell, 2: purchase
|
||||
taux double NOT NULL,
|
||||
localtax1 varchar(20) NOT NULL DEFAULT '0',
|
||||
localtax1_type varchar(10) NOT NULL DEFAULT '0',
|
||||
localtax2 varchar(20) NOT NULL DEFAULT '0',
|
||||
localtax2_type varchar(10) NOT NULL DEFAULT '0',
|
||||
use_default tinyint DEFAULT 0, -- set to 1 to be the default vat when no vat defined on product
|
||||
recuperableonly integer NOT NULL DEFAULT 0,
|
||||
recuperableonly integer NOT NULL DEFAULT 0, -- VAT NPR for France
|
||||
note varchar(128),
|
||||
active tinyint DEFAULT 1 NOT NULL,
|
||||
accountancy_code_sell varchar(32) DEFAULT NULL,
|
||||
accountancy_code_buy varchar(32) DEFAULT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
|
|
|||
|
|
@ -1138,7 +1138,7 @@ VATIsUsedDesc=By default when creating proposals, invoices, orders etc. the Sale
|
|||
VATIsNotUsedDesc=By default the proposed Sales tax is 0 which can be used for cases like associations, individuals or small companies.
|
||||
VATIsUsedExampleFR=In France, it means companies or organizations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared.
|
||||
VATIsNotUsedExampleFR=In France, it means associations that are non Sales tax declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (Sales tax in franchise) and paid a franchise Sales tax without any Sales tax declaration. This choice will display the reference "Non applicable Sales tax - art-293B of CGI" on invoices.
|
||||
VATType=Tax type
|
||||
VATType=Tax usage
|
||||
##### Local Taxes #####
|
||||
TypeOfSaleTaxes=Type of sales tax
|
||||
LTRate=Rate
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user