diff --git a/html/js/scripts.js b/html/js/scripts.js index 2c7f8f7e9..5d463773a 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -1190,11 +1190,18 @@ function save_predf_op(obj) return false; } + /** *ctl_concern is the widget to update - *amount_id is either a html obj. or an amount + *amount_id is either a html obj. or an amount and the field tiers if given + * @param {type} dossier + * @param {type} ctl_concern + * @param {type} amount_id + * @param {type} ledger + * @param {type} p_id_target + * @returns {undefined} */ -function search_reconcile(dossier, ctl_concern, amount_id, ledger) +function search_reconcile(dossier, ctl_concern, amount_id, ledger,p_id_target) { var dossier = g('gDossier').value; if (amount_id === undefined) @@ -1227,7 +1234,8 @@ function search_reconcile(dossier, ctl_concern, amount_id, ledger) ctl: target, ac: 'JSSEARCH', amount_id: amount_id, - ledger: ledger}; + ledger: ledger, + target : p_id_target}; var qs = encodeJSON(target); @@ -1272,14 +1280,20 @@ function search_operation(obj) alert(e.message); } } - +/** + * Update the field e_concerned, from class_iconcerned + * Value is the field where to put the quick-code but only if one checkbox has been + * selected + * @param {type} obj + * @returns {undefined} + */ function set_reconcile(obj) { try { var ctlc = obj.elements['ctlc']; - + var target=obj.elements['target'].value; for (var e = 0; e < obj.elements.length; e++) { @@ -1292,6 +1306,11 @@ function set_reconcile(obj) var nValue = str_name.replace("jr_concerned", ""); if ($(ctlc.value).value != '') { $(ctlc.value).value += ','; + + } else { + if ( target !="" && $(target).value == "") { + $(target).value=elmt.value; + } } $(ctlc.value).value += nValue; } diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 44a54b066..03c2097f9 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -626,7 +626,7 @@ class Acc_Ledger extends jrn_def_sql * @return HTML string */ - public function list_operation_to_reconcile($sql) + public function list_operation_to_reconcile($sql,$p_target) { global $g_parameter, $g_user; $gDossier = dossier::id(); @@ -650,7 +650,7 @@ class Acc_Ledger extends jrn_def_sql if ($Max == 0) return array(0, _("Aucun enregistrement trouvé")); - + $r.=HtmlInput::hidden("target", $p_target); $r.='
| '; + $r.=' | '; //internal code // button modify $r.=" | ";
@@ -3825,6 +3825,37 @@ class Acc_Ledger extends jrn_def_sql
$lib=$this->db->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($p_value));
return $lib;
}
+ /**
+ * Let you select the repository before confirming a sale or a purchase.
+ * Returns an empty string if the company doesn't use stock
+ * @brief Let you select the repository before confirming a sale or a purchase.
+ * @global type $g_parameter check if company is using stock
+ * @param type $p_readonly
+ * @param type $p_repo
+ * @return string
+ */
+ public function select_depot($p_readonly, $p_repo)
+ {
+ global $g_parameter;
+ $r=' ';
+ // Show the available repository
+ if ($g_parameter->MY_STOCK=='Y')
+ {
+ $sel=HtmlInput::select_stock($this->db, 'repo', 'W');
+ $sel->readOnly=$p_readonly;
+ if ($p_readonly==true)
+ $sel->selected=$p_repo;
+ $r.=" ';
+ return $r;
+
+ }
}
?>
\ No newline at end of file
diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php
index 284e354b6..8dc9423b8 100644
--- a/include/class_acc_ledger_fin.php
+++ b/include/class_acc_ledger_fin.php
@@ -431,6 +431,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
${"e_concerned" . $i} = (isset(${"e_concerned" . $i})) ? ${"e_concerned" . $i} : ""
;
$wConcerned = new IConcerned("e_concerned" . $i, ${"e_concerned" . $i});
+ $wConcerned->tiers="e_other" . $i;
$wConcerned->setReadOnly($pview_only);
$wConcerned->amount_id = "e_other" . $i . "_amount";
diff --git a/include/class_iconcerned.php b/include/class_iconcerned.php
index bae88eef2..f6da04187 100644
--- a/include/class_iconcerned.php
+++ b/include/class_iconcerned.php
@@ -36,6 +36,7 @@ class IConcerned extends HtmlInput
$this->amount_id=null;
$this->paid='';
$this->id=$p_id;
+ $this->tiers=""; // id of the field for the tiers to be updated
}
/*!\brief show the html input of the widget*/
public function input($p_name=null,$p_value=null)
@@ -48,7 +49,8 @@ class IConcerned extends HtmlInput
$r=sprintf("
-
+ "._('Dans le dépôt')." : "; + $r.=$sel->input(); + $r.=' '; + } else + { + $r.=''.'Stock non utilisé'.''; + } + $r.=' |
| - + | diff --git a/include/template/result_cat_card_summary.php b/include/template/result_cat_card_summary.php index 09c3f5ee4..29a359585 100644 --- a/include/template/result_cat_card_summary.php +++ b/include/template/result_cat_card_summary.php @@ -19,7 +19,7 @@ for ($i=0;$i'.$aHeading[$i]->ad_text.$span.' | '; + echo ''.$aHeading[$i]->ad_text.$span.' | '; endfor; ?>
|---|