quant table have now a FK to jrn, so the code has to be updated
This commit is contained in:
parent
eb39186c0a
commit
11ec6fbf59
2 changed files with 13 additions and 5 deletions
|
|
@ -39,6 +39,7 @@ require_once('class_acc_parm_code.php');
|
|||
require_once('class_acc_payment.php');
|
||||
require_once('ac_common.php');
|
||||
require_once('class_itva_popup.php');
|
||||
require_once('class_acc_ledger_info.php');
|
||||
|
||||
/*!\brief Handle the ledger of purchase,
|
||||
*
|
||||
|
|
@ -422,7 +423,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
|
|||
//-----
|
||||
if ( $owner->MY_TVA_USE=='Y') {
|
||||
$r=$this->db->exec_sql("select insert_quant_purchase ".
|
||||
"('".$internal."'". /* 1 */
|
||||
"(null".
|
||||
",".$j_id. /* 2 */
|
||||
",'".${"e_march".$i}."'". /* 3 */
|
||||
",".${"e_quant".$i}.",". /* 4 */
|
||||
|
|
@ -437,7 +438,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
|
|||
|
||||
} else {
|
||||
$r=$this->db->exec_sql("select insert_quant_purchase ".
|
||||
"('".$internal."'".
|
||||
"(null".
|
||||
",".$j_id.
|
||||
",'".${"e_march".$i}."'".
|
||||
",".${"e_quant".$i}.",".
|
||||
|
|
@ -559,7 +560,10 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
|
|||
// Set Internal code
|
||||
$this->grpt_id=$seq;
|
||||
$this->update_internal_code($internal);
|
||||
|
||||
/* update quant_purchase */
|
||||
$this->db->exec_sql('update quant_purchase set qp_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
|
||||
array($internal,$seq));
|
||||
|
||||
/* if e_suggest != e_pj then do not increment sequence */
|
||||
if ( strcmp($e_pj,$e_pj_suggest) == 0 && strlen(trim($e_pj)) != 0 ) {
|
||||
$this->inc_seq_pj();
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
if ( $owner->MY_TVA_USE=='Y') {
|
||||
/* save into quant_sold */
|
||||
$r=$this->db->exec_sql("select insert_quant_sold ($1,$2,$3,$4,$5,$6,$7,$8)",
|
||||
array($internal, /* 1 */
|
||||
array(null, /* 1 */
|
||||
$j_id, /* 2 */
|
||||
${'e_march'.$i} , /* 3 */
|
||||
${'e_quant'.$i}, /* 4 */
|
||||
|
|
@ -331,7 +331,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
|
||||
} else {
|
||||
$r=$this->db->exec_sql("select insert_quant_sold ($1,$2,$3,$4,$5,$6,$7,$8) ",
|
||||
array($internal, /* 1 */
|
||||
array(null, /* 1 */
|
||||
$j_id, /* 2 */
|
||||
${'e_march'.$i}, /* 3 */
|
||||
${'e_quant'.$i}, /* 4 */
|
||||
|
|
@ -410,6 +410,10 @@ class Acc_Ledger_Sold extends Acc_Ledger {
|
|||
$this->db->exec_sql("update jrn set jr_internal='".$internal."' where ".
|
||||
" jr_grpt_id = ".$seq);
|
||||
|
||||
/* update quant_sold */
|
||||
$this->db->exec_sql('update quant_sold set qs_internal = $1 where j_id in (select j_id from jrnx where j_grpt=$2)',
|
||||
array($internal,$seq));
|
||||
|
||||
/* Save the attachment or generate doc*/
|
||||
if ( isset ($_FILES['pj'])) {
|
||||
if ( strlen(trim($_FILES['pj']['name'])) != 0 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue