Exemplo n.º 1
0
echo "<BR>";
// echo "TABLE MESSAGE INFO<BR>";
// print_r($E->TABLE_MESSAGE);
// print_r($E->TABLE_INDEXATION);
// $E->DisplayIndexationMessage();
while ($E->ReadDirectMessage()) {
    echo "Segment Number:" . $E->GetCurrentNumberSegment() . " => " . $E->GetCurrentSegmentName() . " => " . $E->GetCurrentSegmentOccurence() . " GROUP:" . $E->GetCurrentGroupName() . " => " . $E->GetCurrentGroupOccurence() . "<BR>";
    // Recherche NAD+IV dans le groupe "2"
    if (strcmp($E->GetCurrentGroupName(), "2") === 0) {
        if (strcmp($E->GetCurrentSegmentName(), "NAD") === 0) {
            if (strcmp($E->GetCurrentDataSegment("10.3035"), "IV") === 0) {
                $NAD_IV = $E->GetCurrentDataSegment("20.C082.10.3039");
                echo "IDENTIFIANT FACTURE A (NAD+IV):" . $NAD_IV . "<BR>";
                $E->PutBUFFER("FACTURE", 1, 1, "INVOICE");
                $E->PutBUFFER("FACTURE", 1, 10, $NAD_IV);
                $E->PutBUFFER("FACTURE", 2, 12, str_pad($NAD_IV, 35, "#"));
                $E->PutBUFFER("FACTURE", 2, 1, "INV_LINE");
                $E->PutBUFFER("FACTURE", 2, 100, "POS100");
            } else {
                echo "ERREUR...NAD NON TRAITE ICI:" . $E->GetCurrentDataSegment("10.3035") . "<BR>";
                $E->ValidCurrentSegment();
                $E->DisplayCurrentSegment();
            }
        }
    }
}
echo "END Segment Number:" . $E->GetCurrentNumberSegment() . " => " . $E->GetCurrentSegmentName() . " => " . $E->GetCurrentSegmentOccurence() . " GROUP:" . $E->GetCurrentGroupName() . " => " . $E->GetCurrentGroupOccurence() . "<BR>";
$E->PrintOutputFile("FACTURE");
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "TEMP DE REACTION {$time} secondes\n";