Code enhanced - Standardize field name #14697

This commit is contained in:
Alexandre SPANGARO 2021-02-20 07:08:37 +01:00
parent 994dde91da
commit 1017d480f9
6 changed files with 25 additions and 21 deletions

View File

@ -19,7 +19,8 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field tva move to total_tva in llx_supplier_proposal
* Field total move to total_ttc in llx_supplier_proposal
***** ChangeLog for 13.0.1 compared to 13.0.0 *****

View File

@ -3232,7 +3232,7 @@ abstract class CommonObject
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva = 'total_tva';
if ($this->element == 'propal') $fieldttc = 'total';
if ($this->element == 'expensereport') $fieldtva = 'total_tva';
if ($this->element == 'supplier_proposal') $fieldttc = 'total';
if ($this->element == 'supplier_proposal') $fieldtva = 'total_tva';
if (empty($nodatabaseupdate))
{

View File

@ -173,3 +173,7 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOragnisationEventEventSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendes', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendes)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOragnisationEventBulkMailToAttendes)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOragnisationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
-- Code enhanced - Standardize field name
ALTER TABLE llx_supplier_proposal CHANGE COLUMN tva total_tva double(24,8) default 0;
ALTER TABLE llx_supplier_proposal CHANGE COLUMN total total_ttc double(24,8) default 0;

View File

@ -37,10 +37,10 @@ CREATE TABLE llx_supplier_proposal (
remise_absolue double DEFAULT 0,
remise double DEFAULT 0,
total_ht double(24,8) DEFAULT 0,
tva double(24,8) DEFAULT 0,
total_tva double(24,8) DEFAULT 0,
localtax1 double(24,8) DEFAULT 0,
localtax2 double(24,8) DEFAULT 0,
total double(24,8) DEFAULT 0,
total_ttc double(24,8) DEFAULT 0,
fk_account integer DEFAULT NULL,
fk_currency varchar(3) DEFAULT NULL,
fk_cond_reglement integer DEFAULT NULL,

View File

@ -906,8 +906,8 @@ class SupplierProposal extends CommonObject
$sql .= ", remise";
$sql .= ", remise_percent";
$sql .= ", remise_absolue";
$sql .= ", tva";
$sql .= ", total";
$sql .= ", total_tva";
$sql .= ", total_ttc";
$sql .= ", datec";
$sql .= ", ref";
$sql .= ", fk_user_author";
@ -1200,7 +1200,7 @@ class SupplierProposal extends CommonObject
global $conf;
$sql = "SELECT p.rowid, p.entity, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
$sql .= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.total_ttc, p.total_tva, p.localtax1, p.localtax2, p.total_ht";
$sql .= ", p.datec";
$sql .= ", p.date_valid as datev";
$sql .= ", p.date_livraison as delivery_date";
@ -1239,12 +1239,11 @@ class SupplierProposal extends CommonObject
$this->remise = $obj->remise;
$this->remise_percent = $obj->remise_percent;
$this->remise_absolue = $obj->remise_absolue;
$this->total = $obj->total; // TODO deprecated
$this->total_ht = $obj->total_ht;
$this->total_tva = $obj->tva;
$this->total_tva = $obj->total_tva;
$this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total;
$this->total_ttc = $obj->total_ttc;
$this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_project;
$this->model_pdf = $obj->model_pdf;
@ -2784,7 +2783,7 @@ class SupplierProposalLine extends CommonObjectLine
// Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne

View File

@ -152,7 +152,7 @@ $arrayfields = array(
'sp.date_valid'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
'sp.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
@ -253,7 +253,7 @@ if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DI
$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.tva as total_vat, sp.total as total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
$sql .= ' sp.rowid, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
$sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,';
$sql .= ' sp.datec as date_creation, sp.tms as date_update,';
$sql .= " p.rowid as project_id, p.ref as project_ref,";
@ -299,8 +299,8 @@ if ($search_ref) $sql .= natural_search('sp.ref', $search_ref);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_login) $sql .= natural_search('u.login', $search_login);
if ($search_montant_ht) $sql .= natural_search('sp.total_ht=', $search_montant_ht, 1);
if ($search_montant_vat != '') $sql .= natural_search("sp.tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql .= natural_search("sp.total", $search_montant_ttc, 1);
if ($search_montant_vat != '') $sql .= natural_search("sp.total_tva", $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql .= natural_search("sp.total_ttc", $search_montant_ttc, 1);
if ($search_multicurrency_code != '') $sql .= ' AND sp.multicurrency_code = "'.$db->escape($search_multicurrency_code).'"';
if ($search_multicurrency_tx != '') $sql .= natural_search('sp.multicurrency_tx', $search_multicurrency_tx, 1);
if ($search_multicurrency_montant_ht != '') $sql .= natural_search('sp.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
@ -552,7 +552,7 @@ if ($resql)
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
print '</td>';
}
if (!empty($arrayfields['sp.total_vat']['checked']))
if (!empty($arrayfields['sp.total_tva']['checked']))
{
// Amount
print '<td class="liste_titre right">';
@ -653,7 +653,7 @@ if ($resql)
if (!empty($arrayfields['sp.date_valid']['checked'])) print_liste_field_titre($arrayfields['sp.date_valid']['label'], $_SERVER["PHP_SELF"], 'sp.date_valid', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['sp.date_livraison']['checked'])) print_liste_field_titre($arrayfields['sp.date_livraison']['label'], $_SERVER["PHP_SELF"], 'sp.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['sp.total_ht']['checked'])) print_liste_field_titre($arrayfields['sp.total_ht']['label'], $_SERVER["PHP_SELF"], 'sp.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_vat']['checked'])) print_liste_field_titre($arrayfields['sp.total_vat']['label'], $_SERVER["PHP_SELF"], 'sp.total_vat', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_tva']['checked'])) print_liste_field_titre($arrayfields['sp.total_tva']['label'], $_SERVER["PHP_SELF"], 'sp.total_tva', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.total_ttc']['checked'])) print_liste_field_titre($arrayfields['sp.total_ttc']['label'], $_SERVER["PHP_SELF"], 'sp.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['sp.multicurrency_code']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_code', '', $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) print_liste_field_titre($arrayfields['sp.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
@ -803,12 +803,12 @@ if ($resql)
$totalarray['val']['sp.total_ht'] += $obj->total_ht;
}
// Amount VAT
if (!empty($arrayfields['sp.total_vat']['checked']))
if (!empty($arrayfields['sp.total_tva']['checked']))
{
print '<td class="right">'.price($obj->total_vat)."</td>\n";
print '<td class="right">'.price($obj->total_tva)."</td>\n";
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_vat';
$totalarray['val']['sp.total_vat'] += $obj->total_vat;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_tva';
$totalarray['val']['sp.total_tva'] += $obj->total_tva;
}
// Amount TTC
if (!empty($arrayfields['sp.total_ttc']['checked']))