26 require_once DIR_IMPORT_ACCOUNT.
"/include/class_impacc_csv.php";
27 require_once DIR_IMPORT_ACCOUNT.
"/include/class_impacc_verify.php";
40 throw new Exception(
"Not Yet Implemented");
51 $p_thousand, $p_decimal)
53 $and=($row->id_message==
"")?
"":
",";
59 $row->id_message=$and.
"CK_TVA_INVALID";
65 if ($row->id_date_payment!=
"")
70 $row->id_message=$and.
"CK_FORMAT_DATE";
73 $row->id_date_payment_conv=
$date;
79 if ($row->id_date_limit!=
"")
84 $row->id_message=$and.
"CK_FORMAT_DATE";
87 $row->id_date_limit_conv=
$date;
95 $p_thousand, $p_decimal);
96 if (isNumber($row->id_amount_vat_conv)==0)
98 $and=($row->id_message==
"")?
"":
",";
99 $row->id_message.=$and.
"CK_INVALID_AMOUNT";
105 $p_thousand, $p_decimal);
106 if (isNumber($row->id_quant_conv)==0)
108 $row->id_message.=$and.
"CK_INVALID_AMOUNT";
115 throw new Exception(
"Not Yet Implemented");
125 $hFile=fopen($p_file->import_file->i_tmpname,
"r");
127 $cn=Dossier::connect();
128 $delimiter=$aseparator[$p_csv->detail->s_delimiter-1][
'label'];
129 if ($p_csv->detail->s_surround==
""){
130 $p_csv->detail->s_surround=
'"';
133 while (
$row=fgetcsv($hFile, 0, $delimiter, $p_csv->detail->s_surround))
137 $insert->import_id=$p_file->import_file->id;
140 $insert->id_status=-1;
141 $insert->id_message=join(
$row, $delimiter);
146 $insert->id_date=
$row[0];
147 $insert->id_code_group=
$row[1];
148 $insert->id_acc=
$row[2];
149 $insert->id_pj=
$row[3];
150 $insert->id_label=
$row[4];
151 $insert->id_acc_second=
$row[5];
152 $insert->id_quant=
$row[6];
153 $insert->id_amount_novat=
$row[7];
154 $insert->tva_code=
$row[8];
155 $insert->id_amount_vat=
$row[9];
156 $date_limit=(isset(
$row[10]))?
$row[10]:
"";
157 $insert->id_date_limit=$date_limit;
158 $date_payment=(isset(
$row[11]))?
$row[11]:
"";
159 $insert->id_date_payment=$date_payment;
160 $insert->id_nb_row=0;
record(Impacc_Csv $p_csv, Impacc_File $p_file)
insert file into the table import_detail
for($i=0;$i< Database::num_row($ret);$i++) $row
transform($ledger_id, $import_id)
Works by id_group_code : all the rows with the same id_code_group belong to the same operation The op...
static check_date($p_date, $p_format_date)
Check that the date payment has valid format . Return false or.
Manage one row of operation of Sale / Purchase for importing them.
static check(Impacc_Import_detail_SQL $row, $p_format_date, $p_thousand, $p_decimal)
Check if Data are valid for one row.
static check_tva($p_tva_code)
Check that TVA_CODE does exist , return true if exists otherwise false.