Task #1762 , printtva peut mettre donner les totaux de tva
suivant l'exigibilité configuré par Code TVA , par date de paiement ou par date d'opération
This commit is contained in:
parent
6b96cb0a44
commit
096169b987
39 changed files with 694 additions and 228 deletions
|
|
@ -57,6 +57,7 @@ try
|
|||
$get_option=$http->get('p_simple', "string");
|
||||
$get_from_periode=$http->get('from_periode', 'number');
|
||||
$get_to_periode=$http->get('to_periode', 'number');
|
||||
$filter_operation=$http->get("operation_type");
|
||||
}
|
||||
catch (Exception $exc)
|
||||
{
|
||||
|
|
@ -119,14 +120,14 @@ if ( $get_option=="E")
|
|||
case 'VEN':
|
||||
$ledger=new Acc_Ledger_Sold($cn, $get_jrn);
|
||||
$ret_detail=$ledger->get_detail_sale($get_from_periode,
|
||||
$get_to_periode);
|
||||
$get_to_periode,$filter_operation);
|
||||
$a_heading=Acc_Ledger_Sold::heading_detail_sale();
|
||||
|
||||
break;
|
||||
case 'ACH':
|
||||
$ledger=new Acc_Ledger_Purchase($cn, $get_jrn);
|
||||
$ret_detail=$ledger->get_detail_purchase($get_from_periode,
|
||||
$get_to_periode);
|
||||
$get_to_periode,$filter_operation);
|
||||
$a_heading=Acc_Ledger_Purchase::heading_detail_purchase();
|
||||
break;
|
||||
default:
|
||||
|
|
@ -199,6 +200,7 @@ if ($get_option=='A')
|
|||
$get_from_periode, $get_to_periode, 'A');
|
||||
|
||||
}
|
||||
$acc_ledger_history->set_filter_operation($filter_operation);
|
||||
$acc_ledger_history->export_csv();
|
||||
exit;
|
||||
}
|
||||
|
|
@ -298,6 +300,7 @@ if ($get_option=="L" || $get_option == 'D')
|
|||
$get_from_periode, $get_to_periode, 'D');
|
||||
|
||||
}
|
||||
$acc_ledger_history->set_filter_operation($filter_operation);
|
||||
$acc_ledger_history->export_csv();
|
||||
return;
|
||||
}
|
||||
|
|
@ -309,12 +312,14 @@ if ($get_option=="L" || $get_option == 'D')
|
|||
{
|
||||
$acc_ledger_history=new Acc_Ledger_History_Purchase($cn, [$Jrn->id],
|
||||
$get_from_periode, $get_to_periode, 'D');
|
||||
$acc_ledger_history->set_filter_operation($filter_operation);
|
||||
$acc_ledger_history->export_csv();
|
||||
}
|
||||
if ($jrn_type=="VEN")
|
||||
{
|
||||
$acc_ledger_history=new Acc_Ledger_History_Sale($cn, [$Jrn->id],
|
||||
$get_from_periode, $get_to_periode, 'D');
|
||||
$acc_ledger_history->set_filter_operation($filter_operation);
|
||||
$acc_ledger_history->export_csv();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ try
|
|||
{
|
||||
$jrn_id=$http->get('jrn_id',"number");
|
||||
$p_simple=$http->get('p_simple',"string");
|
||||
|
||||
$filter_operation=$http->get("operation_type");
|
||||
|
||||
}
|
||||
catch (Exception $exc)
|
||||
|
|
@ -74,8 +74,8 @@ $ret = "";
|
|||
|
||||
$jrn_type = $Jrn->get_type();
|
||||
|
||||
$pdf = Print_Ledger::factory($cn, $p_simple, "PDF", $Jrn);
|
||||
|
||||
$pdf = Print_Ledger::factory($cn, $p_simple, "PDF", $Jrn,$filter_operation);
|
||||
$pdf->set_filter_operation($filter_operation);
|
||||
$pdf->setDossierInfo($Jrn->jrn_def_name);
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ for ($i = 0; $i < $nb_sale; $i++) {
|
|||
}
|
||||
$pdf->line_new();
|
||||
|
||||
$nb_array = count($array);
|
||||
$nb_array = count($a_sum);
|
||||
// initialize totals
|
||||
for ($e=2;$e<$nb_col;$e++){
|
||||
$a_tot[$a_col[$e]]=0;
|
||||
|
|
@ -187,14 +187,14 @@ for ($i = 0; $i < $nb_array; $i++) {
|
|||
$colname=$a_col[$e];
|
||||
if ( $e ==0 ) {
|
||||
// first column TVA_LABEL
|
||||
$pdf->write_cell(40, 5, $array[$i][$colname], 1, 0, 'L');
|
||||
$pdf->write_cell(40, 5, $a_sum[$i][$colname], 1, 0, 'L');
|
||||
} elseif ($e == 1 ){
|
||||
// Secund col. tva rate
|
||||
$pdf->write_cell(40, 5, nbm($array[$i][$colname]*100), 1, 0, 'R');
|
||||
$pdf->write_cell(40, 5, nbm($a_sum[$i][$colname]*100), 1, 0, 'R');
|
||||
}else {
|
||||
// Other cols,display amount and compute total
|
||||
$a_tot[$colname] = bcadd($a_tot[$colname], $array[$i][$colname]);
|
||||
$pdf->write_cell(40, 5, nbm($array[$i][$colname]), 1, 0, 'R');
|
||||
$a_tot[$colname] = bcadd($a_tot[$colname], $a_sum[$i][$colname]);
|
||||
$pdf->write_cell(40, 5, nbm($a_sum[$i][$colname]), 1, 0, 'R');
|
||||
}
|
||||
}
|
||||
$pdf->line_new();
|
||||
|
|
@ -328,6 +328,7 @@ for ($e=0;$e<$nb_col;$e++){
|
|||
}
|
||||
$pdf->line_new();
|
||||
|
||||
$array=$tax_summary->get_summary_purchase();
|
||||
$nb_array = count($array);
|
||||
// initialize totals
|
||||
for ($e=2;$e<$nb_col;$e++){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue