cosmetic : improve appearance

This commit is contained in:
sparkyx 2024-06-21 11:54:08 +02:00
parent 5c2d0045f7
commit 2810a32db6
11 changed files with 109 additions and 81 deletions

View file

@ -129,6 +129,7 @@ if ( isset($_SESSION[SESSION_KEY.'isValid']) && $_SESSION[SESSION_KEY.'isValid']
$name=$array[0]['vw_name'];
// use for followup
$sell=(isNumber($array[0]['vw_sell']) == 1) ? $array[0]['vw_sell'] : 0 ;
$buy=(isNumber($array[0]['vw_buy']) == 1) ?$array[0]['vw_buy']:0;

View file

@ -1366,7 +1366,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
$W1->label="";
$W1->name="e_march".$i;
$W1->value=$march;
$W1->table=1;
$W1->table=0;
$W1->set_dblclick("fill_ipopcard(this);");
$W1->set_attribute('ipopup','ipopcard');

View file

@ -1487,7 +1487,7 @@ EOF;
$W1->label = "";
$W1->name = "e_march" . $i;
$W1->value = $march;
$W1->table = 1;
$W1->table = 0;
$W1->set_attribute('typecard', 'cred');
$W1->set_dblclick("fill_ipopcard(this);");
$W1->set_attribute('ipopup', 'ipopcard');

View file

@ -226,6 +226,7 @@ class Tva_Rate_MTable extends Manage_Table_SQL
$tva_rate=new Tva_rate_SQL($cn);
$tva_rate->setp("tva_id",$new_tva_id);
$tva_rate->setp("tva_rate", $this->table->tva_rate);
$tva_rate->setp("tva_code", $this->table->tva_code);
$tva_rate->setp("tva_label", $this->table->tva_label);
$tva_rate->setp("tva_comment", $this->table->tva_comment);
$tva_rate->setp("tva_both_side", $this->table->tva_both_side);
@ -336,6 +337,9 @@ class Tva_Rate_MTable extends Manage_Table_SQL
if (strlen($this->table->tva_code)>5){
$this->set_error("tva_code", _("code tva : Maximum 5 caractères"));
}
if (isNumber($this->table->tva_code) == 1){
$this->set_error("tva_code", _("code tva : doit aussi contenir des lettres"));
}
if ($this->count_error()!=0)
return false;
return true;

View file

@ -100,6 +100,8 @@ $g_failed = "<span style=\"font-size:18px;color:red\">&#x2716;</span>";
$g_succeed = "<span style=\"font-size:18px;color:green\">&#x2713;</span>";
define('SMALLX', '#xe816;');
define('BUTTONADD', "&#10010;");
define('ICON_SEARCH', '&#x1F50E;');
define('ICON_CLEAN', '&#x2715;');
// If noalyss_version is not defined it is likely directly taken from
// git and so this variable is not set, this cause some issue

View file

@ -50,6 +50,7 @@ class Tva_Rate_SQL extends Table_Data_SQL
, "tva_both_side"=>"tva_both_side"
,"tva_payment_purchase"=>"tva_payment_purchase"
,"tva_payment_sale"=>"tva_payment_sale"
,"tva_code"=>"tva_code"
);
/*
* Type of columns
@ -63,7 +64,7 @@ class Tva_Rate_SQL extends Table_Data_SQL
, "tva_both_side"=>"numeric"
,"tva_payment_purchase"=>"text"
,"tva_payment_sale"=>"text"
,"tva_code"=>"text"
);

View file

@ -40,8 +40,8 @@ class Icon_Action
static function icon_magnifier($id, $p_javascript, $p_style="")
{
$r="";
$r.=sprintf('<span id="%s" class=" smallbutton icon" style="%s" onclick="%s">&#xf50d;</span>',
$id, $p_style, $p_javascript);
$r.=sprintf('<span id="%s" class=" smallbutton icon" style="%s" onclick="%s">%s</span>',
$id, $p_style, $p_javascript,ICON_SEARCH);
return $r;
}
/**
@ -54,8 +54,8 @@ class Icon_Action
static function button_magnifier($id, $p_javascript, $p_style="")
{
$r="";
$r.=sprintf('<input type="button" id="%s" class=" smallbutton icon" style="%s" onclick="%s" value="&#xf50d;">',
$id, $p_style, $p_javascript);
$r.=sprintf('<input type="button" id="%s" class=" smallbutton icon" style="%s" onclick="%s" value="%s">',
$id, $p_style, $p_javascript,ICON_SEARCH);
return $r;
}
@ -82,8 +82,8 @@ class Icon_Action
*/
static function clean_zone($id, $p_javascript, $p_style="")
{
$r=sprintf('<input class="smallbutton " onclick="%s" id="%s" value="X" %s type="button" style="">',
$p_javascript, $id, $p_style
$r=sprintf('<input class="smallbutton " onclick="%s" id="%s" value="%s" %s type="button" style="">',
$p_javascript, $id, ICON_CLEAN,$p_style
);
return $r;
}

View file

@ -143,6 +143,7 @@ class IDate extends HtmlInput
%s
/>
<span class="smallbutton icon"
style="color:cornflowerblue"
id="%s_trigger"
/>
&#xe811;

View file

@ -77,21 +77,21 @@ class ITva_Popup extends HtmlInput
$r="";
switch ($this->filter) {
case 'none':
$sql="select tva_code
$sql="select tva_code,tva_label
from v_tva_rate
where
tva_purchase <> '#' and tva_sale <> '#'
order by tva_code ";
break;
case 'sale':
$sql="select tva_code
$sql="select tva_code,tva_label
from v_tva_rate
where
tva_sale <> '#'
order by tva_code ";
break;
case 'purchase':
$sql="select tva_code
$sql="select tva_code,tva_label
from v_tva_rate
where
tva_purchase <> '#'
@ -100,9 +100,11 @@ class ITva_Popup extends HtmlInput
}
$a_tva_code=$cn->get_array($sql);
if ( empty($a_tva_code)) return "";
$r.=sprintf('<datalist id="dl_tva_%s">',$this->id);
$r.=sprintf('<datalist id="dl_tva_%s"">',$this->id);
foreach ($a_tva_code as $item) {
$r.=sprintf('<option value="%s"></option>',$item['tva_code']);
$r.=sprintf('<option value="%s">%s %s</option>'
,$item['tva_code'],$item['tva_code']
,htmlentities($item['tva_label']));
}
$r.='</datalist>';
return $r;
@ -137,9 +139,11 @@ class ITva_Popup extends HtmlInput
$strAttribut = $this->get_node_attribute();
$str = '<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" placeholder="%s" size="3" %s %s list="dl_tva_%s">';
$str = '<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" placeholder="%s" size="6" %s %s
list="dl_tva_%s" autocomplete="off">';
$r = sprintf($str, $this->name, $this->value, $this->id, _("C.TVA"),$this->js, $strAttribut,$this->id);
$r.=$code;
$r.=$this->make_datalist();
if ($this->in_table)
$table = '<table>' . '<tr>' . td($r);
@ -183,7 +187,8 @@ class ITva_Popup extends HtmlInput
// button
$bt = new ISmallButton('bt_' . $this->id);
$bt->tabindex = "-1";
$bt->label = _(' TVA ');
$bt->label = ICON_SEARCH;
$bt->set_attribute('gDossier', dossier::id());
$bt->set_attribute('ctl', $this->id);
$bt->set_attribute('popup', 'popup_tva');

View file

@ -104,7 +104,7 @@ $hidden=($this->has_quantity()==0)?'d-none':'';
<h2><?php echo $f_legend_detail?></h2>
<table id="sold_item" >
<tr>
<th style="width:auto"colspan="2">Code <?php echo Icon_Action::infobulle(0)?></th>
<th style="width:auto"colspan="1">Code <?php echo Icon_Action::infobulle(0)?></th>
<th class="visible_gt800 visible_gt1155"><?php echo _('Dénomination')?></th>
<?php if ($flag_tva =='Y') : ?>
<th class="text-center" ><?php echo _('prix/unité htva')?><?php echo Icon_Action::infobulle(6)?></th>
@ -124,10 +124,10 @@ $hidden=($this->has_quantity()==0)?'d-none':'';
</tr>
<?php foreach ($array as $item) {
echo '<tr>';
// echo "<td>";
echo "<td>";
echo $item['quick_code'];
// echo "</td>";
echo '<td>'.$item['bt'].$item['card_add'].'</td>';
echo $item['bt'].$item['card_add'].'</td>';
?>
<td class="visible_gt800 visible_gt1155"><?php echo $item['denom'] ?></td>
<?php
@ -151,8 +151,7 @@ echo '</tr>';
</td>
<td> </td>
<td class="visible_gt800 visible_gt1155"> </td>
<td> </td>
<td> </td>
<td class="col_quant <?=$hidden?> text-center"'> </td>
<td style="text-align:center" class="visible_gt800"> <span id="htva">0.0</span></td>
<?php if ( $flag_tva=='Y' ) : ?>
<td> </td>
@ -166,13 +165,13 @@ echo '</tr>';
</td>
<td class="num visible_gt800"></td>
<td class="col_quant <?=$hidden?> text-center"'> </td>
<?php if ($flag_tva=='Y') {?>
<td style="text-align:center" class="visible_gt800 visible_gt1155"></td>
<td></td>
<td class="visible_gt800"></td>
<?php } ?>
<td></td>
<td></td>
<td></td>
<td style="text-align:center">
<span id="p_currency_euro"></span>

View file

@ -1,65 +1,80 @@
begin;
with correct_periode as (select jr_tech_per, jr_grpt_id from jrn)
update jrnx set j_tech_per = jr_tech_per from correct_periode where correct_periode.jr_grpt_id=j_grpt and correct_periode.jr_tech_per != j_tech_per;
update menu_ref set me_menu='Navigateur &#x1F9ED;' where me_code ~ 'NAVI';
update menu_ref set me_menu='Configuration &#x1F527;' where me_code='CFG';
ALTER TABLE public.tva_rate ADD CONSTRAINT tva_code_number_check CHECK (isnumeric(tva_code) = false);
ALTER TABLE public.tva_rate ADD tva_code text ;
ALTER TABLE public.tva_rate ADD CONSTRAINT tva_code_unique UNIQUE (tva_code);
update tva_rate set tva_code=null;
drop view if exists public.vw_fiche_attr;
drop VIEW public.v_tva_rate;
CREATE OR REPLACE VIEW public.v_tva_rate
AS SELECT tva_rate.tva_id,
CREATE OR REPLACE VIEW public.vw_fiche_attr
AS SELECT a.f_id,
a.fd_id,
a.ad_value AS vw_name,
k.ad_value AS vw_first_name,
b.ad_value AS vw_sell,
c.ad_value AS vw_buy,
d.ad_value AS tva_code,
tva_rate.tva_id,
tva_rate.tva_rate,
tva_rate.tva_code,
tva_rate.tva_label,
tva_rate.tva_comment,
split_part(tva_rate.tva_poste, ','::text, 1) AS tva_purchase,
split_part(tva_rate.tva_poste, ','::text, 2) AS tva_sale,
tva_rate.tva_both_side,
tva_rate.tva_payment_purchase,
tva_rate.tva_payment_sale
FROM tva_rate;
e.ad_value AS vw_addr,
f.ad_value AS vw_cp,
j.ad_value AS quick_code,
h.ad_value AS vw_description,
i.ad_value AS tva_num,
fiche_def.frd_id,
l.ad_value AS accounting,
a.f_enable
FROM ( SELECT fiche.f_id,
fiche.fd_id,
fiche.f_enable,
fiche_detail.ad_value
FROM fiche
LEFT JOIN fiche_detail USING (f_id)
WHERE fiche_detail.ad_id = 1) a
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 6) b ON a.f_id = b.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 7) c ON a.f_id = c.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 2) d ON a.f_id = d.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 14) e ON a.f_id = e.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 15) f ON a.f_id = f.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 23) j ON a.f_id = j.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 9) h ON a.f_id = h.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 13) i ON a.f_id = i.f_id
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 32) k ON a.f_id = k.f_id
LEFT JOIN tva_rate ON d.ad_value = tva_rate.tva_id::text
JOIN fiche_def USING (fd_id)
LEFT JOIN ( SELECT fiche_detail.f_id,
fiche_detail.ad_value
FROM fiche_detail
WHERE fiche_detail.ad_id = 5) l ON a.f_id = l.f_id;
CREATE OR REPLACE FUNCTION update_tva_code ()
returns int4
AS
$BODY$
declare
/*
* Section for variables
*/
counter int:=0;
letter int;
x record;
e record;
str_tva_code text;
begin
-- basic loop
for x in select distinct tva_rate from public.tva_rate order by tva_rate
loop
letter :=65;
for e in select * from public.tva_rate where tva_rate = x.tva_rate loop
str_tva_code := round(e.tva_rate*1000)::text||chr(letter);
update tva_rate set tva_code=str_tva_code where tva_id=e.tva_id;
letter := letter+1;
counter := counter+1;
end loop;
end loop;
return counter;
end;
$BODY$
LANGUAGE plpgsql;
select update_tva_code();
drop function update_tva_code();
alter table public.tva_rate alter tva_code set not null;
ALTER TABLE public.op_predef_detail ALTER COLUMN opd_tva_id TYPE text USING opd_tva_id::text;
insert into version (val,v_description) values (197,'Adapt for VAT CODE');
commit;
COMMENT ON VIEW public.vw_fiche_attr IS 'Some attribute for all cards';