From 207033ee081b7b98830a5e6fe35cdf19652b418b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 27 Apr 2010 22:03:07 +0000 Subject: [PATCH] Lettering ========= Added in the GESTION part, for the customer + supplier Improve cosmetic --- html/ajax_misc.php | 13 +++-- include/class_lettering.php | 2 +- include/client_card.inc.php | 16 +++++- include/lettering.gestion.inc.php | 82 +++++++++++++++++++++++++++++++ include/supplier_card.inc.php | 18 +++++-- include/template/letter_all.php | 7 +++ 6 files changed, 129 insertions(+), 9 deletions(-) create mode 100644 include/lettering.gestion.inc.php diff --git a/html/ajax_misc.php b/html/ajax_misc.php index e2bbd1227..068aaf1c2 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -234,13 +234,15 @@ jr_comment,j_montant, j_debit,jr_internal from jrnx join jrn on (j_grpt=jr_grpt_ //min amount $line=td(_('Montant min. ')); $min=new INum('min_amount'); - $min->value=(isset($min_amount))?$min_amount:0; + $min->value=(isset($min_amount))?$min_amount:$row['j_montant']; + $min_amount=(isset($min_amount))?$min_amount:$row['j_montant']; $line.=td($min->input()); // max amount $line.=td(_('Montant max. ')); $max=new INum('max_amount'); - $max->value=(isset($max_amount))?$max_amount:0; + $max->value=(isset($max_amount))?$max_amount:$row['j_montant']; + $max_amount=(isset($max_amount))?$max_amount:$row['j_montant']; $line.=td($max->input()); $r.=tr($line); @@ -263,7 +265,8 @@ jr_comment,j_montant, j_debit,jr_internal from jrnx join jrn on (j_grpt=jr_grpt_ array('label'=>_('Credit'),'value'=>1), array('label'=>_('Les 2'),'value'=>3) ); - $iside->selected=(isset($side))?$side:0; + $iside->selected=(isset($side))?$side:($row['j_debit']=='t')?0:1; + $side=(isset($side))?$side:($row['j_debit']=='t')?0:1; $r.=tr($line.td($iside->input())); $r.=''; $r.=''; @@ -281,6 +284,10 @@ jr_comment,j_montant, j_debit,jr_internal from jrnx join jrn on (j_grpt=jr_grpt_ if ( isset($_REQUEST['p_action'])) $form.=HtmlInput::hidden('p_action',$_REQUEST['p_action']); if ( isset($_REQUEST['sa'])) $form.=HtmlInput::hidden('sa',$_REQUEST['sa']); if ( isset($_REQUEST['acc'])) $form.=HtmlInput::hidden('acc',$_REQUEST['acc']); + if ( isset($_REQUEST['sc'])) $form.=HtmlInput::hidden('sc',$_REQUEST['sc']); + if ( isset($_REQUEST['sb'])) $form.=HtmlInput::hidden('sb',$_REQUEST['sb']); + if ( isset($_REQUEST['f_id'])) $form.=HtmlInput::hidden('f_id',$_REQUEST['f_id']); + // display a list of operation from the other side + box button if ( $ot == 'account') { $obj=new Lettering_Account($cn,$row['j_poste']); diff --git a/include/class_lettering.php b/include/class_lettering.php index b989bc055..6ec47e4a7 100644 --- a/include/class_lettering.php +++ b/include/class_lettering.php @@ -315,7 +315,7 @@ class Lettering_Account extends Lettering{ isNumber($this->fil_amount_max)==1 && isNumber($this->fil_amount_min)==1 && ($this->fil_amount_max != 0 || $this->fil_amount_min != 0) ) - $filter_amount=" and j_montant between $this->fil_amount_min and $this->fil_amount_max "; + $filter_amount=" and j_montant >= $this->fil_amount_min and j_montant<=$this->fil_amount_max "; $sql=" select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt, j_montant,j_debit,jr_comment,jr_internal, diff --git a/include/client_card.inc.php b/include/client_card.inc.php index 96791d85d..3146597da 100644 --- a/include/client_card.inc.php +++ b/include/client_card.inc.php @@ -59,21 +59,27 @@ case 'cn': case 'op': $def=4; break; +case 'let': + $def=6; + break; default: $def=1; $ss_action='dc'; } $f=new fiche($cn,$_REQUEST['f_id']); -echo '

'.$f->get_quick_code()." ".$f->strAttribut(ATTR_DEF_NAME).'

'; echo '
'; echo ShowItem(array( array($root."&sc=dc",_('Fiche'),_('Détail de la fiche'),1), array($root.'&sc=sv',_('Suivi'),_('Suivi client, devis, bon de commande, courrier'),2), array($root.'&sc=cn',_('Contact'),_('Liste de contacts de ce client'),3), array($root.'&sc=op',_('Opérations'),_('Toutes les opérations'),4), + array($root.'&sc=let',_('Lettrage'),_('Opérations & Lettrages'),6), array('?p_action=client&'.dossier::get(),_('Retour liste'),_('Retour à la liste des clients'),5) ), - 'H',"mtitle","mtitle",$def,' width="100%"'); + 'H',"mtitle","mtitle",$def,''); +echo '
'; +echo '
'; +echo '

'.$f->get_quick_code()." ".$f->strAttribut(ATTR_DEF_NAME).'

'; echo '
'; //--------------------------------------------------------------------------- @@ -128,3 +134,9 @@ if ( $ss_action == 'cn') { echo $f_add_button->input(); echo ''; } +/*---------------------------------------------------------------------------- + * Lettering + *----------------------------------------------------------------------------*/ +if ( $def==6 ) { + require_once('lettering.gestion.inc.php'); +} diff --git a/include/lettering.gestion.inc.php b/include/lettering.gestion.inc.php new file mode 100644 index 000000000..9b9efdf78 --- /dev/null +++ b/include/lettering.gestion.inc.php @@ -0,0 +1,82 @@ +'; +echo ''; +//if (! isset($_REQUEST['seek'])) exit; +echo '
'; +//-------------------------------------------------------------------------------- +// record the data +//-------------------------------------------------------------------------------- +if ( isset($_POST['record'])) { + $letter=new Lettering_Account($cn); + $letter->save($_POST); +} +//-------------------------------------------------------------------------------- +// Show the result +//-------------------------------------------------------------------------------- +echo '
'; +$fiche=new Fiche($cn,$_REQUEST['f_id']); +$quick_code=$fiche->get_quick_code(); +$letter=new Lettering_Card($cn); +$letter->set_parameter('quick_code',$quick_code); +$letter->set_parameter('start',$start->value); +$letter->set_parameter('end',$end->value); + +if ( $sel->selected == 0 ) + echo $letter->show_list('all'); +if ( $sel->selected == 1 ) + echo $letter->show_list('letter'); +if ( $sel->selected == 2 ) + echo $letter->show_list('unletter'); + +echo '
'; +echo ''; +?> \ No newline at end of file diff --git a/include/supplier_card.inc.php b/include/supplier_card.inc.php index b6f9de823..686100826 100644 --- a/include/supplier_card.inc.php +++ b/include/supplier_card.inc.php @@ -59,23 +59,29 @@ case 'cn': case 'op': $def=4; break; +case 'let': + $def=6; + break; default: $def=1; $ss_action='dc'; } $f=new fiche($cn,$_REQUEST['f_id']); -echo '

'.$f->get_quick_code()." ".$f->strAttribut(ATTR_DEF_NAME).'

'; + echo '
'; echo ShowItem(array( array($root."&sc=dc",_('Fiche'),_('Détail de la fiche'),1), array($root.'&sc=sv',_('Suivi'),_('Suivi Fournisseur, devis, bon de commande, courrier'),2), array($root.'&sc=cn',_('Contact'),_('Liste de contacts de ce fournisseur'),3), array($root.'&sc=op',_('Opérations'),_('Toutes les opérations'),4), + array($root.'&sc=let',_('Lettrage'),_('Opérations & Lettrages'),6), array('?p_action=supplier&'.dossier::get(),_('Retour liste'),_('Retour à la liste des fournisseurs'),5) ), - 'H',"mtitle","mtitle",$def,' width="100%"'); + 'H',"mtitle","mtitle",$def,' '); +echo '
'; +echo '
'; +echo '

'.$f->get_quick_code()." ".$f->strAttribut(ATTR_DEF_NAME).'

'; echo '
'; - //--------------------------------------------------------------------------- // Show Detail of a card and category //--------------------------------------------------------------------------- @@ -128,3 +134,9 @@ if ( $ss_action == 'cn') { echo $f_add_button->input(); echo ''; } +/*---------------------------------------------------------------------------- + * Lettering + *----------------------------------------------------------------------------*/ +if ( $def==6 ) { + require_once('lettering.gestion.inc.php'); +} diff --git a/include/template/letter_all.php b/include/template/letter_all.php index 2fd6e824a..52013df15 100644 --- a/include/template/letter_all.php +++ b/include/template/letter_all.php @@ -1,3 +1,10 @@ +content) == 0 ) : +?> +

+ +