//AB/ Project EDI Interchange //AB/ Object prj is a VIEW_Project //AB/ Set ProjectName to "EDI Interchange" //AB/ Set ProjectFileName to "EDI.VW" //AB/ Set GenerateFileName to "NONAME" // Project Object Structure // EDI is a dbView // oSoggobb_DD is a DataDictionary // oDelegato_DD is a DataDictionary // oTextBox1 is a Textbox // oTextBox2 is a Textbox // Textbox3 is a Textbox // Textbox4 is a Textbox // Textbox5 is a Textbox // Textbox6 is a Textbox // Textbox7 is a Textbox // Textbox8 is a Textbox // Textbox9 is a Textbox // Textbox10 is a Textbox // Textbox11 is a Textbox // Textbox12 is a Textbox // Textbox13 is a Textbox // Textbox14 is a Textbox // oCheckBox1 is a CheckBox // oCheckBox2 is a CheckBox // oSoggobbCodice_Ricerca is a dbForm // oSoggobbNome_Societa is a dbForm // oDelegatoPiva is a dbForm // oDelegatoDenominazione is a dbForm // oForm1 is a Form // oForm2 is a Form // oForm3 is a Form // oForm4 is a Form // oForm5 is a Form // oForm6 is a Form // oForm7 is a Form // oForm8 is a Form // oForm9 is a Form // oForm10 is a Form // oLineControl2 is a LineControl // LineControl3 is a LineControl // Form11 is a Form // Button1 is a Button // oList1 is a List // oTextBox3 is a Textbox // oForm11 is a Form // oForm12 is a Form // oTextBox4 is a Textbox // oForm13 is a Form // CheckBox3 is a CheckBox // CheckBox4 is a CheckBox // CheckBox5 is a CheckBox // CheckBox6 is a CheckBox // Form14 is a Form // Button2 is a Button // LineControl4 is a LineControl // Form15 is a Form // CheckBox7 is a CheckBox // Textbox15 is a Textbox // Textbox16 is a Textbox // BitmapContainer1 is a BitmapContainer // Textbox17 is a Textbox // BitmapContainer2 is a BitmapContainer // Register all objects Register_Object BitmapContainer1 Register_Object BitmapContainer2 Register_Object Button1 Register_Object Button2 Register_Object CheckBox3 Register_Object CheckBox4 Register_Object CheckBox5 Register_Object CheckBox6 Register_Object CheckBox7 Register_Object EDI Register_Object Form11 Register_Object Form14 Register_Object Form15 Register_Object LineControl3 Register_Object LineControl4 Register_Object oCheckBox1 Register_Object oCheckBox2 Register_Object oDelegato_DD Register_Object oDelegatoDenominazione Register_Object oDelegatoPiva Register_Object oForm1 Register_Object oForm10 Register_Object oForm11 Register_Object oForm12 Register_Object oForm13 Register_Object oForm2 Register_Object oForm3 Register_Object oForm4 Register_Object oForm5 Register_Object oForm6 Register_Object oForm7 Register_Object oForm8 Register_Object oForm9 Register_Object oLineControl2 Register_Object oList1 Register_Object oSoggobb_DD Register_Object oSoggobbCodice_Ricerca Register_Object oSoggobbNome_Societa Register_Object oTextBox1 Register_Object oTextBox2 Register_Object oTextBox3 Register_Object oTextBox4 Register_Object Textbox10 Register_Object Textbox11 Register_Object Textbox12 Register_Object Textbox13 Register_Object Textbox14 Register_Object Textbox15 Register_Object Textbox16 Register_Object Textbox17 Register_Object Textbox3 Register_Object Textbox4 Register_Object Textbox5 Register_Object Textbox6 Register_Object Textbox7 Register_Object Textbox8 Register_Object Textbox9 //AB/ AppBuild VIEW //AB-IgnoreStart Use DFAllEnt.pkg Use SOGGOBB.DD Use DELEGATO.DD //AB-IgnoreEnd DEFERRED_VIEW Activate_EDI FOR ; ; Object EDI is a dbView //AB-StoreTopStart on_key key_Enter send NEXT Set Verify_Exit_msg to CloseEdiPanel //AB-StoreTopEnd Set Border_Style to Border_Normal Set Label to "EDI - Interchange - IDOC - Record di Testa" Set Size to 261 445 Set Location to 5 4 //AB-DDOStart Object oSoggobb_DD is a Soggobb_DataDictionary End_Object // oSoggobb_DD Object oDelegato_DD is a Delegato_DataDictionary End_Object // oDelegato_DD Set Main_DD to (oSoggobb_DD(Current_Object)) Set Server to (oSoggobb_DD(Current_Object)) //AB-DDOEnd Object oTextBox1 is a Textbox Set Object_Color to 30 40 Set Label to "Obbligato" Set Size to 9 35 Set Location to 5 132 //AB-StoreStart //Set Object_Color to 30 40 //AB-StoreEnd End_Object // oTextBox1 Object oTextBox2 is a Textbox Set Object_Color to 30 40 Set Label to "Delegato" Set Size to 9 33 Set Location to 23 133 //AB-StoreStart //Set Object_Color to 30 40 //AB-StoreEnd End_Object // oTextBox2 Object Textbox3 is a Textbox Set Border_Style to Border_ClientEdge Set Label to " Tracciato - Dati Utente " Set Justification_Mode to jMode_Center Set Size to 11 81 Set Location to 41 45 End_Object // Textbox3 Object Textbox4 is a Textbox Set Label to "Sostituire con il proprio codice utente abilitato. (4 caratteri)" Set Size to 9 195 Set Location to 62 133 End_Object // Textbox4 Object Textbox5 is a Textbox Set Label to "Riservato a SDA . (12 Spazi)" Set Size to 9 99 Set Location to 76 133 End_Object // Textbox5 Object Textbox6 is a Textbox Set Label to "Il Nome del Flusso. [Codice utente/Mese/Giorno/ . / I /contatore > 01..99 nr. trasmissione]" Set Size to 9 305 Set Location to 91 133 End_Object // Textbox6 Object Textbox7 is a Textbox Set Label to "Riservato a SDA . (12 Spazi)" Set Size to 9 99 Set Location to 103 133 End_Object // Textbox7 Object Textbox8 is a Textbox Set Label to "Il codice della propria Sezione Doganale. Per Prove indica il Nr. 061102" Set Size to 9 253 Set Location to 114 133 End_Object // Textbox8 Object Textbox9 is a Textbox Set Label to "(6 numeri) - Ricerca in Menu-Tabelle-Manutenzione - DOGANE." Set Size to 9 214 Set Location to 122 133 End_Object // Textbox9 Object Textbox10 is a Textbox Set Label to "Lasciare inalterato - 4 Spazi -" Set Size to 9 105 Set Location to 134 133 End_Object // Textbox10 Object Textbox11 is a Textbox Set Label to "Partita Iva / Codice Fiscale oppure Codice Operatore doganale. (16 digit max.)" Set Size to 9 286 Set Location to 146 133 End_Object // Textbox11 Object Textbox12 is a Textbox Set Label to "Non cambiare. Modifica soltanto se trasmette una Sede secondaria." Set Size to 9 246 Set Location to 160 133 End_Object // Textbox12 Object Textbox13 is a Textbox Set Label to "Riservato a SDA. (1 Spazio)" Set Size to 9 98 Set Location to 174 133 End_Object // Textbox13 Object Textbox14 is a Textbox Set Label to "Numero di record presenti nel flusso (compreso il record di testa) - 5 Num" Set Size to 9 247 Set Location to 188 133 End_Object // Textbox14 Object oCheckBox1 is a CheckBox On_Item 'seleziona' Send NONE Set Label to "seleziona" Set Size to 9 47 Set Location to 5 375 //AB-StoreStart Procedure OnChange //obbligato Local Integer bChecked Get Checked_State to bChecked If bChecked Begin Set Enabled_State of (oSoggobbCodice_Ricerca(current_object)) to True Set Enabled_State of (oDelegatoPiva(current_object)) to False Set Checked_State of (oCheckBox2(current_object)) to False Set Value of (oDelegatoPiva(current_object)) to "" Set Value of (oDelegatoDenominazione(current_object)) to "" End Else Begin Set Enabled_State of (oSoggobbCodice_Ricerca(current_object)) to False Set Value of (oSoggobbCodice_Ricerca(current_object)) to "" Set Value of (oSoggobbNOME_Societa(current_object)) to "" CLEAR SOGGOBB End End_Procedure //AB-StoreEnd End_Object // oCheckBox1 Object oCheckBox2 is a CheckBox On_Item 'seleziona' Send NONE Set Label to "seleziona" Set Size to 9 47 Set Location to 23 375 //AB-StoreStart Procedure OnChange //delegato Local Integer bChecked Get Checked_State to bChecked If bChecked Begin Set Enabled_State of (oSoggobbCodice_Ricerca(current_object)) to False Set Enabled_State of (oDelegatoPiva(current_object)) to True Set Checked_State of (oCheckBox1(current_object)) to False Set Value of (oSoggobbCodice_Ricerca(current_object)) to "" Set Value of (oSoggobbNOME_Societa(current_object)) to "" End Else Begin Set Enabled_State of (oDelegatoPiva(current_object)) to False Set Value of (oDelegatoPiva(current_object)) to "" Set Value of (oDelegatoDenominazione(current_object)) to "" CLEAR DELEGATO End End_Procedure //AB-StoreEnd End_Object // oCheckBox2 Object oSoggobbCodice_Ricerca is a dbForm Entry_Item Soggobb.Codice_ricerca Set Label to "Codice" Set Label_Row_Offset to 1 Set Label_Col_Offset to 30 Set Size to 11 87 Set Location to 4 40 //AB-StoreStart Set Enabled_State to False Set prompt_button_value to "f4" //scelta obbligato Set Prompt_Button_Mode to pb_PromptOn Procedure OnChange Local String sStr sStr2 Local integer rVal Get Checked_State of (oCheckBox1(current_object)) to rVal if (rVal =1) begin //avoid if Rec activ when opening 'vista' Get Value item 0 to sStr //value = Codice Obbligato uppercase sStr trim sStr to sStr Get Value of (oForm7(current_object)) to sStr2 //Piva attuale uppercase sStr2 trim sStr2 to sStr2 If sStr gt "" begin Move Soggobb.Cod_Iva to sStr //we use Piva value uppercase sStr trim sStr to sStr Get YesNo_Box ("Sostituire il codice fiscale ?\n"; +sStr2+" con:\n"; +sStr); "Il Campo nr. 7" 1 to rVal if (rVal =MBR_Yes); Set Value of (oForm7(current_object)) to sStr End End //if oCheckBox1 checked else; CLEAR SOGGOBB End_Procedure //CLEAR dBase che potrebbe essere attivo da un altra funzione //if CheckBox is 'not checked'. Procedure Refresh Integer mode Local Integer Srvr# Crnt bChecked Local string sStr Get Server to Srvr# Get Current_Record of Srvr# to Crnt Forward Send Refresh mode if Crnt begin Get Checked_State of (oCheckBox1(current_object)) to bChecked if (bChecked =0) begin Set Value item 0 to "" CLEAR SOGGOBB end end End_Procedure //AB-StoreEnd End_Object // oSoggobbCodice_Ricerca Object oSoggobbNome_Societa is a dbForm Entry_Item Soggobb.Nome_societa Set Label to "Societa'" Set Label_Row_Offset to 1 Set Label_Col_Offset to 32 Set Size to 11 161 Set Location to 4 208 //AB-StoreStart Set Enabled_State to False //AB-StoreEnd End_Object // oSoggobbNome_Societa Object oDelegatoPiva is a dbForm Entry_Item Delegato.Piva Set Server to (oDelegato_DD(Current_Object)) Set Label to "Piva" Set Label_Row_Offset to 1 Set Label_Col_Offset to 30 Set Size to 11 87 Set Location to 22 40 //AB-StoreStart Set Enabled_State to False Set prompt_button_value to "f4" //scelta Delegato Set Prompt_Button_Mode to pb_PromptOn Procedure OnChange Local String sStr sStr2 Local integer rVal Get Checked_State of (oCheckBox2(current_object)) to rVal if (rVal =1) begin //avoid if Rec activ when opening 'vista' Get Value item 0 to sStr uppercase sStr trim sStr to sStr Get Value of (oForm7(current_object)) to sStr2 uppercase sStr2 trim sStr2 to sStr2 If sStr gt "" begin Get YesNo_Box ("Sostituire il codice fiscale ?\n"; +sStr2+" con:\n"; +sStr); "Il Campo nr. 7" 1 to rVal if (rVal =MBR_Yes); Set Value of (oForm7(current_object)) to sStr end end //if oCheckBox2 checked else; CLEAR DELEGATO End_Procedure //CLEAR dBase che potrebbe essere attivo da un altra funzione //if CheckBox is 'not checked'. Procedure Refresh Integer mode Local Integer Srvr# Crnt bChecked Get Server to Srvr# Get Current_Record of Srvr# to Crnt Forward Send Refresh mode if Crnt begin Get Checked_State of (oCheckBox2(current_object)) to bChecked if (bChecked =0) begin Set Value item 0 to "" CLEAR DELEGATO end end End_Procedure //AB-StoreEnd End_Object // oDelegatoPiva Object oDelegatoDenominazione is a dbForm Entry_Item Delegato.Denominazione Set Server to (oDelegato_DD(Current_Object)) Set Label to "Delegato" Set Label_Row_Offset to 1 Set Label_Col_Offset to 32 Set Size to 11 161 Set Location to 22 208 //AB-StoreStart Set Enabled_State to False //AB-StoreEnd End_Object // oDelegatoDenominazione Object oForm1 is a Form Set Label to "1)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 60 41 //AB-StoreStart Set Enabled_State to False Get_profile_string "INTRA" "EDICodiceUtente" to sGlobalStr If sGlobalStr eq ''; Move "ABCD" to sGlobalStr Set_profile_string "INTRA" "EDICodiceUtente" to sGlobalStr Set Value item 0 to sGlobalStr //AB-StoreEnd End_Object // oForm1 Object oForm2 is a Form Set Label to "2)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 74 41 //AB-StoreStart Set Enabled_State to False Set Value item 0 to " " //AB-StoreEnd End_Object // oForm2 Object oForm3 is a Form Set Label to "3)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 88 41 //AB-StoreStart Set Enabled_State to False Procedure InputFileNameData Local string sStr sFileName Local integer iLen Move '' to sFileName Get Value of (oForm1(current_object)) to sStr uppercase sStr Append sFileName sStr mid todaydate to sStr 2 4 Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr //append month left todaydate to sStr 2 //append day Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr ".I01" //+ a basic File extension Set Value item 0 to sFileName end_procedure Send InputFileNameData //AB-StoreEnd End_Object // oForm3 Object oForm4 is a Form Set Label to "4)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 102 41 //AB-StoreStart Set Enabled_State to False Set Value item 0 to " " //AB-StoreEnd End_Object // oForm4 Object oForm5 is a Form Set Label to "5)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 116 41 //AB-StoreStart Set Enabled_State to False Get_profile_string "INTRA" "EDISezioneDogana" to sGlobalStr Set Value item 0 to sGlobalStr //AB-StoreEnd End_Object // oForm5 Object oForm6 is a Form Set Label to "6)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 130 40 //AB-StoreStart Set Enabled_State to False Set Value item 0 to " " //AB-StoreEnd End_Object // oForm6 Object oForm7 is a Form Set Label to "7)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 144 40 //AB-StoreStart Set Enabled_State to False Procedure InputCodiceIva Local string sStr Get_profile_string "INTRA" "EDICodiceFiscale" to sStr uppercase sStr Set Value item 0 to sStr end_procedure Send InputCodiceIva //AB-StoreEnd End_Object // oForm7 Object oForm8 is a Form Set Label to "8)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 158 40 //AB-StoreStart Set Enabled_State to False Get_profile_string "INTRA" "EDISedeUtente" to sGlobalStr if sGlobalStr eq ''; move "001" to sGlobalStr //default value Set value item 0 to sGlobalStr //AB-StoreEnd End_Object // oForm8 Object oForm9 is a Form Set Label to "9)" Set Label_Col_Offset to 12 Set Size to 11 87 Set Location to 172 40 //AB-StoreStart Set Enabled_State to False Set Value item 0 to " " //AB-StoreEnd End_Object // oForm9 Object oForm10 is a Form Set Label to "10)" Set Label_Col_Offset to 15 Set Size to 11 87 Set Location to 186 40 //AB-StoreStart Set Enabled_State to False //AB-StoreEnd End_Object // oForm10 Object oLineControl2 is a LineControl Set Line_Style to lnBUMP Set Size to 2 435 Set Location to 20 2 End_Object // oLineControl2 Object LineControl3 is a LineControl Set Line_Style to lnSINGLE Set Line_Thickness to 10 Set Size to 2 435 Set Location to 36 2 End_Object // LineControl3 Object Form11 is a Form Set Label to "Tracciato:" Set Label_Row_Offset to 2 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Size to 11 342 Set Location to 201 40 Set Status_Help to "Il Record di Testa in base ai Valori attuali." //AB-StoreStart //Tracciato Set Object_Color to 3900 1000 set Skip_State to true Procedure OnSetFocus //do not Shadow, keep color, don't enter send next end_procedure //AB-StoreEnd End_Object // Form11 Object Button1 is a Button Set Label to "Salva Dati Utente" Set Size to 13 72 Set Location to 40 365 //AB-StoreStart Set Status_Help to "Salva i Dati richiesti x la formazione del Tracciato." Procedure OnClick Local String sStr sFileName sFillStr sTracciato sStr2 Local Date dtVar Local Integer iLen icounter rVal Sysdate4 todayDate //reassign nel caso data cambiata dall'utente con progr. aperto. Set Value of (Form11(current_object)) to '' //sTracciato Set Value of (oForm12(current_object)) to '' //sFileName Set Value of (Form14(current_object)) to '' //Acquisti o Cessioni Set Value of (oForm11(current_object)) to '' //Itemcounter Set Value of (oForm13(current_object)) to '' //Show obbligato del Flusso data Send Delete_Data to (oList1(current_object)) //register Record user data //FILENAME - BASIC DATA Move '' to sFileName Get Value of (oForm1(current_object)) to sStr //codice utente abilitato ! uppercase sStr trim sStr to sStr Set_profile_string "INTRA" "EDICodiceUtente" to sStr If (sStr eq '' OR sStr eq 'ABCD') Begin Set_profile_string "INTRA" "EDICodiceUtente" to "ABCD" //a DEFAULT VALUE - NON abilitato Move "ABCD" to sStr Send Info_Box "Manca il Codice Utente abilitato.\nInserito Codice Utente 'ABCD'" "Salva Dati Utente" End Set Value of (oForm1(current_object)) to sStr //codice utente abilitato ! Append sFileName sStr //codice utente Append sTracciato sStr //codice utente Append sTracciato " " //riservato SDA 12 spazi //Nome File = combinazione di valori diversi //codice utente + MM + GG + '.' + 'I' + '01..99' //Move (CurrentDateTime()) to dtVar //get DateTime //Move (DateGetMonth(dtVar)) to sStr //get Month mid todaydate to sStr 2 4 Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr //append month //Move (DateGetDay(dtVar)) to sStr //get Day left todaydate to sStr 2 Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr //append Day Append sFileName ".I01" //append File extention 'I' + contatore Set Value of (oForm3(current_object)) to sFileName //Nome File - varia x gg x trasmissione Append sTracciato sFileName Append sTracciato " " //riservato SDA 12 spazi Get Value of (oForm5(current_object)) to sStr //Codice Sezione Dogana 6 digit trim sStr to sStr Move (Length(sStr)) to iLen If iLen LT 6 begin Move "000000" to sStr Send Info_Box "Manca il codice dogana di appartenenza !" "Attenzione" End Set_profile_string "INTRA" "EDISezioneDogana" to sStr Append sTracciato sStr //+ codice dogana Append sTracciato " " //riservato Get Value of (oForm7(current_object)) to sStr //Codice Fiscale uppercase sStr trim sStr to sStr if sStr eq ''; Send Info_Box "Manca il Codice Fiscale" "Attenzione" Move '' to sFillStr Move (Length(sStr)) to iLen Move (16 -iLen) to iLen //16 characters in Total - Fill with empty space Insert (repeat(" ",iLen)) in sFillStr at 1 Append sStr sFillStr //adjust with spaces to the right Set_profile_string "INTRA" "EDICodiceFiscale" to sStr Set Value of (oForm7(current_object)) to sStr //Codice Fiscale Append sTracciato sStr //codice fiscale, piva, tessera oper.doganale Get Value of (oForm8(current_object)) to sStr //Sede Utente trim sStr to sStr If sStr eq '' begin move "001" to sStr //default value Set_profile_string "INTRA" "EDISedeUtente" to sStr end else begin Move (Length(sStr)) to iLen Move (3 -iLen) to iLen //3 characters - Fill FRONT with '0' Insert (repeat("0",iLen)) in sStr at 1 Set_profile_string "INTRA" "EDISedeUtente" to sStr end Set Value of (oForm8(current_object)) to sStr Append sTracciato sStr //sede utente Append sTracciato " " //riservato SDA //append Nr Record Scambi.Cee + 1 for this record Move "00000" to sStr //Nr of rec default digit Append sTracciato sStr //Record's + this one //Save Contatore Get Value of (Form15(current_object)) to sStr Get_profile_string "INTRA" "EDIContatore" to sStr2 Move sStr to iLen Move sStr2 to icounter if iLen ne icounter begin if iLen eq 0 move '0' to sStr if icounter eq 0 move '0' to sStr2 Get YesNo_Box ("Contatore interno: "+sStr2; +"\nContatore scelto : "+sStr+" ?"); "Conferma il Contatore Scelto ?" 1 to rVal end if (rVal =MBR_Yes); Set_profile_string "INTRA" "EDIContatore" to sStr else; Set Value of (Form15(current_object)) to sStr2 //show data on view Set Value of (Form11(current_object)) to sTracciato Set Value of (oForm12(current_object)) to sFileName Set Checked_State of (CheckBox7(current_object)) to False Send Info_Box "I dati utente sono salvati." "Salva Dati Utente" End_Procedure //AB-StoreEnd End_Object // Button1 Object oList1 is a List Item_List On_Item '' Send NONE End_Item_List Set Select_Mode to SINGLE_SELECT Set Object_Color to 120 120 Set Size to 32 393 Set Location to 221 40 //AB-StoreStart Procedure OnChange Local Integer iItem iTotItem Local String sStr sStr2 Get item_count to iTotItem If iTotItem gt 0 Begin //start if items exist Move "" to sStr2 Get Current_item to iItem //Func ReadStreamDiskValue legge la global var sglongstr_1 Get Value item iItem to sglongstr_1 //return in global str Get ReadStreamDiskValue 23 1 to sStr //legge sglonstr_1 If sStr eq "0" Begin //frontespizio ? = 0 ? Get ReadStreamDiskValue 35 11 to sStr //Piva obbligato Set Value of (oForm13(current_object)) to '' //Obbligato Name Open SOGGOBB Clear SOGGOBB Find GT SOGGOBB by Recnum While [Found] //show obbligato name If (Trim(Soggobb.Cod_Iva)) eq sStr Begin Set Value of (oForm13(current_object)) to SOGGOBB.Nome_Societa Indicate Found False End Else; Find Gt SOGGOBB by Recnum End End End End_Procedure Procedure Fill_List Send Add_Item Msg_None sGlobalStr //global str End_Procedure // Fill_List Procedure ReadInFlusso Local Integer itemcounter Local String sStr MoveInt 0 to itemcounter Move ("C:\Intra_Nc\dafirmare\" + sGlobalStr) to sStr //in sGlobalStr = FileName combinato Direct_Input sStr Readln sGlobalStr [not SeqEof] Repeat If sGlobalStr gt "" Begin Increment itemcounter Send Fill_List End Readln sGlobalStr Until [SeqEof] Close_Input Set Value of (oForm11(current_object)) to (String(itemcounter)) Get Value item 1 to sglongstr_1 //2. Rec in Lista = 1. Frontespizio Get ReadStreamDiskValue 29 1 to sStr //A/C Acqui o Cessioni ? if sStr eq 'A' move "Acquisti" to sStr else move "Cessioni" to sStr Set Value of (Form14(current_object)) to sStr Clear SOGGOBB //Clear Obbligato field after inserting in list1 Clear DELEGATO End_Procedure //AB-StoreEnd End_Object // oList1 Object oTextBox3 is a Textbox Set Label to "Flusso:" Set Size to 9 26 Set Location to 222 14 End_Object // oTextBox3 Object oForm11 is a Form Set Form_Border Item 0 to Border_None Set Size to 11 35 Set Location to 210 396 //AB-StoreStart //Nr of Records Set Enabled_State to False Set Form_Border Item 0 to Border_StaticEdge //Set Form_Justification_Mode to Form_DisplayCenter Set form_justification_mode item 0 to (FORM_DISPLAYCENTER) //AB-StoreEnd End_Object // oForm11 Object oForm12 is a Form Set Form_Border Item 0 to Border_None Set Size to 9 79 Set Location to 212 41 //AB-StoreStart //FileName Set Enabled_State to False //AB-StoreEnd End_Object // oForm12 Object oTextBox4 is a Textbox Set Label to "File >" Set Size to 9 19 Set Location to 212 20 End_Object // oTextBox4 Object oForm13 is a Form Set Form_Border Item 0 to Border_None Set Size to 9 181 Set Location to 212 129 Set Status_Help to "Mostra Obbligato del Flusso." //AB-StoreStart Set Enabled_State to False //AB-StoreEnd End_Object // oForm13 Object CheckBox3 is a CheckBox On_Item '' Send NONE Set Size to 9 12 Set Location to 160 13 //AB-StoreStart Set Select_State to False Set Status_Help to "Apre/Chiude Campo nr 8 x eventuali cambiamenti." Procedure OnChange Local integer bChecked Get Checked_State to bChecked if bChecked; Set Enabled_State of (oForm8(current_object)) to True else; Set Enabled_State of (oForm8(current_object)) to False end_procedure //AB-StoreEnd End_Object // CheckBox3 Object CheckBox4 is a CheckBox On_Item '' Send NONE Set Size to 9 12 Set Location to 145 13 //AB-StoreStart Set Select_State to False Set Status_Help to "Apre/Chiude." Procedure OnChange Local integer bChecked Get Checked_State to bChecked if bChecked; Set Enabled_State of (oForm7(current_object)) to True else; Set Enabled_State of (oForm7(current_object)) to False end_procedure //AB-StoreEnd End_Object // CheckBox4 Object CheckBox5 is a CheckBox On_Item '' Send NONE Set Size to 9 12 Set Location to 117 13 //AB-StoreStart Set Select_State to False Set Status_Help to "Apre/Chiude." Procedure OnChange Local integer bChecked Get Checked_State to bChecked if bChecked; Set Enabled_State of (oForm5(current_object)) to True else; Set Enabled_State of (oForm5(current_object)) to False end_procedure //AB-StoreEnd End_Object // CheckBox5 Object CheckBox6 is a CheckBox On_Item '' Send NONE Set Size to 9 12 Set Location to 61 13 //AB-StoreStart Set Select_State to False Set Status_Help to "Apre/Chiude." Procedure OnChange Local integer bChecked Get Checked_State to bChecked if bChecked; Set Enabled_State of (oForm1(current_object)) to True else; Set Enabled_State of (oForm1(current_object)) to False end_procedure //AB-StoreEnd End_Object // CheckBox6 Object Form14 is a Form Set Form_Border Item 0 to Border_None Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Size to 9 65 Set Location to 213 317 //AB-StoreStart //Show if Acquisti o Cessioni Set Enabled_State to False Set Form_Border Item 0 to Border_StaticEdge //Set Form_Justification_Mode to Form_DisplayCenter Set form_justification_mode item 0 to (FORM_DISPLAYCENTER) //AB-StoreEnd End_Object // Form14 Object Button2 is a Button Set Label to "Crea il Record di Trasmissione" Set Size to 13 117 Set Location to 40 133 //AB-StoreStart Set Status_Help to "Crea il 'Record di Testa' ed il File di Trasmissione." Procedure OnClick Send CreaEDIRecord end_procedure //AB-StoreEnd End_Object // Button2 Object LineControl4 is a LineControl Set Line_Style to lnSINGLE Set Line_Thickness to 10 Set Size to 2 435 Set Location to 55 2 End_Object // LineControl4 Object Form15 is a Form Set Form_Border Item 0 to Border_Normal Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Object_Color to 30 200 Set Size to 13 15 Set Location to 40 260 Set Status_Help to "Ultimo Nr. di Trasmissione. Usa soltanto in caso di assoluta necessita' !" //AB-StoreStart Set Skip_State to True Set form_justification_mode item 0 to (FORM_DISPLAYCENTER) Set Enabled_State to False Set Currency_Mask item 0 to 2 0 Procedure ShowContatore Local string sStr Local integer iLen Local date dtVar Sysdate4 todayDate //reassign nel caso data cambiata dall'utente. //Nr del contatore giornalieri di trasmissione 1..99 Get_profile_string "INTRA" "EDILastUseDate" to dtVar if todaydate gt dtVar begin Set_profile_string "INTRA" "EDILastUseDate" to todaydate //make equal date Move "00" to sStr //1. trasmissione oggi + 1 Set_profile_string "INTRA" "EDIContatore" to sStr end else begin Get_profile_string "INTRA" "EDIContatore" to sStr Trim sStr to sStr Move sStr to iLen Move iLen to sStr //cut eventual '00' if sStr eq '' begin Move "00" to sStr Set_profile_string "INTRA" "EDIContatore" to sStr end end Set Value item 0 to sStr end_procedure Send ShowContatore //AB-StoreEnd End_Object // Form15 Object CheckBox7 is a CheckBox On_Item '' Send NONE Set Size to 9 12 Set Location to 42 277 //AB-StoreStart Set Select_State to False Procedure OnChange Local integer bChecked Get Checked_State to bChecked if bChecked begin Set Enabled_State of (Form15(current_object)) to True Set Object_Color of (Form15(current_object)) to 30 200 Send Info_Box "Per salvare un cambio nr. trasmissione\nusa il Bottone [Salva Dati Utente]"; "INFO" Send Info_Box ("Per cambiare il contatore tenere presente: \n"; +"Il Numero (1..99) deve essere 1 inferiore !\n"; +"Se richiesto nr. 1 - indicare '0'\n"; +"Se richiesto nr. 10 - indicare '9' ."); "AVVISO - Contatore nr. trasmissione" end else; Set Enabled_State of (Form15(current_object)) to False end_procedure //AB-StoreEnd End_Object // CheckBox7 Object Textbox15 is a Textbox Set Label to "Contatore" Set Size to 9 34 Set Location to 42 289 End_Object // Textbox15 Object Textbox16 is a Textbox Set Label to ">>" Set Size to 9 9 Set Location to 42 251 End_Object // Textbox16 Object BitmapContainer1 is a BitmapContainer Set Border_Style to Border_None Set Bitmap to "C:\INTRA_NC\BITMAPS\Save.bmp" Set Initial_Folder to "C:\Intra_Nc\Bitmaps" Set Size to 8 10 Set Location to 42 355 //AB-StoreStart Procedure mouse_down integer window integer char_pos Local Integer Srvr# Rec iRet hoAcquiinp hoAcquiRet Changed forward send mouse_down window char_pos Send OnClick to (Button1(current_object)) //Save Utente Data end_procedure //AB-StoreEnd End_Object // BitmapContainer1 Object Textbox17 is a Textbox Set Label to "Record's" Set Size to 9 33 Set Location to 200 397 End_Object // Textbox17 Object BitmapContainer2 is a BitmapContainer Set Border_Style to Border_None Set Bitmap to "C:\INTRA_NC\BITMAPS\Forwarde.bmp" Set Bitmap_Style to Bitmap_Center Set Initial_Folder to "C:\Intra_Nc\Bitmaps" Set Size to 10 12 Set Location to 41 11 End_Object // BitmapContainer2 //AB-StoreStart //CREA TESTATA PER TRASMISSIONE INTERCHANGE //TESTATA + DATA TIPO Intrastat 'SCAMBI.CEE' = NUOVO FILE + NOME //CON NUMERO PROGRESSIVO x OGNI TRASMISSIONE STESSO GG. INIZIA CON 01 ogni giorno. Procedure CreaEDIRecord Local String sStr sFileName sFillStr sTracciato sStr2 sActualContatore Local Date dtVar Local Integer iLen icounter iERROR rVal Move '' to sTracciato Move '' to sFileName MoveInt 0 to iERROR Sysdate4 todayDate //reassign nel caso data cambiata dall'utente con progr. aperto. //salva il contatore giornaliero attuale + ripristina in caso di errori Get_profile_string "INTRA" "EDIContatore" to sActualContatore Set Value of (Form11(current_object)) to '' //sTracciato Set Value of (oForm12(current_object)) to '' //sFileName Set Value of (Form14(current_object)) to "" Set Value of (oForm13(current_object)) to "" Set Value of (oForm11(current_object)) to "" Send Delete_Data to (oList1(current_object)) //Check if Acquisti or Cessioni + Ask if proceeding File_Exist "C:\Intra_NC\Data\Scambi.Cee" DummyInt //il file Cee creato if DummyInt begin Direct_Input 'C:\Intra_Nc\Data\Scambi.Cee' //Acquisti oppure Cessioni Readln sglongstr_1 //return in global str //sglongstr_1 used by Function CLOSE_INPUT Get ReadStreamDiskValue 29 1 to sStr //A/C Acqui o Cessioni ? if sStr eq 'A' move "Acquisti" to sStr else move "Cessioni" to sStr Get YesNo_Box "Crea Flusso Interchange ?" sStr 1 to rVal if (rVal =MBR_No); Procedure_Return end //register Record user data //1) Codice Utente Get_profile_string "INTRA" "EDICodiceUtente" to sStr trim sStr to sStr If sStr eq '' begin Move "ABCD" to sStr MoveInt 1 to iERROR Set_profile_string "INTRA" "EDICodiceUtente" to sStr end Append sTracciato sStr Move sStr to sFileName //1.value x Filename //2) riservato SDA 12 spazi Append sTracciato " " //3) Nome del nuovo EDI-File //Nome File = combinazione di valori diversi //codice utente + MM + GG + '.' + 'I' + '01..99' //Month 'MM' mid todaydate to sStr 2 4 //Global Str 4 Yeardigit string Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr //DAY 'GG' left todaydate to sStr 2 Move (Length(sStr)) to iLen If iLen eq 1; Move (Insert("0", sStr, 1)) to sStr Append sFileName sStr //FileExtention Append sFileName ".I" //'I' = Interchange fix value //Nr del contatore giornalieri di trasmissione 1..99 Get_profile_string "INTRA" "EDILastUseDate" to dtVar if todaydate gt dtVar begin Set_profile_string "INTRA" "EDILastUseDate" to todaydate //make equal date Move "01" to sStr //1. trasmissione oggi Set_profile_string "INTRA" "EDIContatore" to sStr end else if todaydate LT dtVar begin ERROR 300 "Data inferiore alla Data Precedente." Move todaydate to sStr Move dtVar to sStr2 Send Info_Box ("Controlla la Data di Sistema !\n"; +"Data odierna : "+ sStr +"\n"; +"Data ultimo uso: "+ sStr2 ) "Attenzione" Set_profile_string "INTRA" "EDILastUseDate" to todaydate //adjust to today Set_profile_string "INTRA" "EDIContatore" to "01" Send Info_Box ("La Data 'ultimo uso' e' stata cambiata in:\n"; + sStr +"\nIl contatore trasmissione inizia con '01'") "AVVISO" Move "01" to sStr //default 1. trasmissione end else begin //date = equal = same day = increment contatore Get_profile_string "INTRA" "EDIContatore" to sStr Move sStr to icounter increment icounter Move icounter to sStr Set_profile_string "INTRA" "EDIContatore" to sStr end trim sStr to sStr Move (Length(sStr)) to iLen If ((iLen eq 1)AND(sStr GT 0)); //adjust if gt 0 Move (Insert("0", sStr, 1)) to sStr else if sStr eq "" begin Move "01" to sStr Set_profile_string "INTRA" "EDIContatore" to sStr //Default Start Value x Day end Set Value of (Form15(current_object)) to sStr //contatore on vista Append sFileName sStr //FileName completo //Tracciato + Nome File Append sTracciato sFileName //4) riservato SDA 12 spaci Append sTracciato " " //5) Codice Sezione Dogana Get_profile_string "INTRA" "EDISezioneDogana" to sStr Move sStr to icounter if icounter eq 0; increment iERROR trim sStr to sStr Move (Length(sStr)) to iLen If iLen LT 6 begin Move "000000" to sStr Set_profile_string "INTRA" "EDISezioneDogana" to sStr increment iERROR Send Info_Box "Controlla il codice della propria Sezione doganale" "ATTENZIONE" End Append sTracciato sStr //6) Riservato 4 spaci Append sTracciato " " //7) Codice Fiscale / Piva / Tessera oper. doganale Move "" to sFillStr Get_profile_string "INTRA" "EDICodiceFiscale" to sStr uppercase sStr trim sStr to sStr if sStr eq ''; increment iERROR Move (Length(sStr)) to iLen Move (16 -iLen) to iLen //16 characters - Fill at END with empty space Insert (repeat(" ",iLen)) in sFillStr at 1 Append sStr sFillStr //adjust with spaces to the right Append sTracciato sStr //8) Sede Utente = 001 x Default, differente solo se Sede differente Get_profile_string "INTRA" "EDISedeUtente" to sStr If sStr eq '' begin move "001" to sStr //default value Set_profile_string "INTRA" "EDISedeUtente" to sStr increment iERROR Send Info_Box "Manca il nr. Sede Utente.\nInserito '001'" "ATTENZIONE" end else begin Move (Length(sStr)) to iLen Move (3 -iLen) to iLen //3 characters - Fill FRONT with '0' Insert (repeat("0",iLen)) in sStr at 1 end Append sTracciato sStr //9) riservato SDA 1 spazio Append sTracciato " " //10) Nr di Records tipo scambi.cee + questo (1) record testata //Conta i Record's File_Exist "C:\Intra_NC\Data\Scambi.Cee" DummyInt //esiste Flusso Cee File if DummyInt begin MoveInt 0 to icounter Direct_Input 'C:\Intra_Nc\Data\Scambi.Cee' //Acquisti oppure Cessioni Readln sStr [not SEQEOF] Repeat If sStr gt "" Increment icounter //conta i Rec presenti Readln sStr Until [SEQEOF] Close_INPUT increment icounter //+ 1 x Testata Record Move icounter to sStr Move (Length(sStr)) to iLen Move (5 -iLen) to iLen //max. 99999 Insert (repeat("0",iLen)) in sStr at 1 Append sTracciato sStr //Record's + this one //FINE TRACCIATO TESTATA in sTracciato //CREA NUOVO FLUSSO FILE FOR INTERCHANGE //nella Dir separata '\dafirmare' //Questi File vengono letti dal programma 'FRIMA & VERIFICA' e //completati + copiati nella Dir '\firmati', if (iERROR =0) begin //Check if same filename existing. could be if transmission nr. //has been changed by user ! During 1 day only the transmission nr. //is changing file names. Move ("C:\Intra_NC\dafirmare\"+sFileName) to sStr File_Exist sStr DummyInt //esiste Flusso Cee File con rec testata if DummyInt begin Get YesNo_Box ("Il File: "+sFileName + " esiste gia' !\n\n"; +"Sostituire questo File ?") "AVVISO" 1 to rVal if (rVal =MBR_NO) begin Set_profile_string "INTRA" "EDIContatore" to sActualContatore Set Value of (Form15(current_object)) to sActualContatore Set Checked_State of (CheckBox7(current_object)) to False //close Field Contatore PROCEDURE_RETURN end end //if File exist already Direct_Input 'C:\Intra_Nc\Data\Scambi.Cee' //Acquisti oppure Cessioni Direct_Output ('C:\Intra_Nc\dafirmare\' + sFileName) writeln sTracciato //start with 1. Testata Record Readln sStr If sStr gt "" writeln sStr [not SEQEOF] Repeat Readln sStr If sStr gt "" Writeln sStr Until [SEQEOF] CLOSE_INPUT CLOSE_OUTPUT end else; Send Info_Box ("Riscontrati Errori: "+string(iERROR); +"\nCompleta i dati utente richiesti.\n"; +"Salva i dati. [Salva Dati Utente]") "Tracciato non eseguito" end //if File 'Scambi.cee' esiste. else begin //file 'scambi.cee' not found Move "00000" to sStr //Nr of rec default digit Append sTracciato sStr //Record's + this one increment iERROR Send Info_Box "Non trovo il File 'Scambi.Cee' in:\nC:\Intra_Nc\Data" "EDI - Calcola Nr. Record's" end //show data if (iERROR =0) begin Set Value of (Form11(current_object)) to sTracciato Set Value of (oForm12(current_object)) to sFileName //new filename = tipo 'ABCD0820.I01' //Codice ABCD + MM Agosto + GG 20 + .I + contatore 01 Move sFileName to sGlobalStr //pass new Filename Send ReadInFlusso to (oList1(current_object)) //using sGlobalStr end if iERROR begin //ripristina il contatore Set_profile_string "INTRA" "EDIContatore" to sActualContatore Set Value of (Form15(current_object)) to sActualContatore end Set Checked_State of (CheckBox7(current_object)) to False //close Field Contatore End_Procedure //CreaEDIRecord Procedure CloseEdiPanel Clear SOGGOBB Clear DELEGATO Send Delete_Data to (oList1(current_object)) Send Cancel_sBarValue Set Enabled_State of (oSoggobbCodice_Ricerca(current_object)) to False Set Enabled_State of (oDelegatoPiva(current_object)) to False Set Checked_State of (oCheckBox1(current_object)) to False Set Checked_State of (oCheckBox2(current_object)) to False Set Value of (oForm13(current_object)) to "" Set Value of (oForm11(current_object)) to "" Set Checked_State of (CheckBox7(current_object)) to False //close Field Contatore end_procedure //AB-StoreEnd CD_End_Object // EDI //AB/ End_Object // prj