DOLAR 32,3027
EURO 34,7055
ALTIN 2383,792
BIST 10276,88
Adana Adıyaman Afyon Ağrı Aksaray Amasya Ankara Antalya Ardahan Artvin Aydın Balıkesir Bartın Batman Bayburt Bilecik Bingöl Bitlis Bolu Burdur Bursa Çanakkale Çankırı Çorum Denizli Diyarbakır Düzce Edirne Elazığ Erzincan Erzurum Eskişehir Gaziantep Giresun Gümüşhane Hakkari Hatay Iğdır Isparta İstanbul İzmir K.Maraş Karabük Karaman Kars Kastamonu Kayseri Kırıkkale Kırklareli Kırşehir Kilis Kocaeli Konya Kütahya Malatya Manisa Mardin Mersin Muğla Muş Nevşehir Niğde Ordu Osmaniye Rize Sakarya Samsun Siirt Sinop Sivas Şanlıurfa Şırnak Tekirdağ Tokat Trabzon Tunceli Uşak Van Yalova Yozgat Zonguldak
İstanbul °C

Efatura Sonuç

11.05.2017
A+
A-

datasec[] = $fr; $new_offset = strlen(implode(“”, $this->datasec)); $cdrec = “\x50\x4b\x01\x02″; $cdrec .=”\x00\x00″; $cdrec .=”\x0a\x00″; $cdrec .=”\x00\x00″; $cdrec .=”\x00\x00″; $cdrec .=”\x00\x00\x00\x00”; $cdrec .= pack(“V”,0); $cdrec .= pack(“V”,0); $cdrec .= pack(“V”,0); $cdrec .= pack(“v”, strlen($name) ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $ext = “\x00\x00\x10\x00”; $ext = “\xff\xff\xff\xff”; $cdrec .= pack(“V”, 16 ); $cdrec .= pack(“V”, $this -> old_offset ); $cdrec .= $name; $this -> ctrl_dir[] = $cdrec; $this -> old_offset = $new_offset; return; } function add_file($data, $name) { $fp = fopen($data,”r”); $data = fread($fp,filesize($data)); fclose($fp); $name = str_replace(“”, “/”, $name); $unc_len = strlen($data); $crc = crc32($data); $zdata = gzcompress($data); $zdata = substr ($zdata, 2, -4); $c_len = strlen($zdata); $fr = “\x50\x4b\x03\x04”; $fr .= “\x14\x00”; $fr .= “\x00\x00”; $fr .= “\x08\x00”; $fr .= “\x00\x00\x00\x00”; $fr .= pack(“V”,$crc); $fr .= pack(“V”,$c_len); $fr .= pack(“V”,$unc_len); $fr .= pack(“v”, strlen($name) ); $fr .= pack(“v”, 0 ); $fr .= $name; $fr .= $zdata; $fr .= pack(“V”,$crc); $fr .= pack(“V”,$c_len); $fr .= pack(“V”,$unc_len); $this -> datasec[] = $fr; $new_offset = strlen(implode(“”, $this->datasec)); $cdrec = “\x50\x4b\x01\x02″; $cdrec .=”\x00\x00″; $cdrec .=”\x14\x00″; $cdrec .=”\x00\x00″; $cdrec .=”\x08\x00″; $cdrec .=”\x00\x00\x00\x00”; $cdrec .= pack(“V”,$crc); $cdrec .= pack(“V”,$c_len); $cdrec .= pack(“V”,$unc_len); $cdrec .= pack(“v”, strlen($name) ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“v”, 0 ); $cdrec .= pack(“V”, 32 ); $cdrec .= pack(“V”, $this -> old_offset ); $this -> old_offset = $new_offset; $cdrec .= $name; $this -> ctrl_dir[] = $cdrec; } function file() { $data = implode(“”, $this -> datasec); $ctrldir = implode(“”, $this -> ctrl_dir); return $data . $ctrldir . $this -> eof_ctrl_dir . pack(“v”, sizeof($this -> ctrl_dir)) . pack(“v”, sizeof($this -> ctrl_dir)) . pack(“V”, strlen($ctrldir)) . pack(“V”, strlen($data)) . “\x00\x00”; } } $zipTest = new zipfile(); $zipTest->add_dir(“”); $fieldseparator = “;”; $lineseparator = “\n”; $csvfile = $_FILES[‘file’][‘tmp_name’]; $addauto = 0; $save = 1; if(!file_exists($csvfile)) { echo “File not found. Make sure you specified the correct path.\n”; exit; } $file = fopen($csvfile,”r”); if(!$file) { echo “Error opening data file.\n”; exit; } $size = filesize($csvfile); if(!$size) { echo “File is empty.\n”; exit; } $csvcontent = fread($file,$size); fclose($file); $xml = new DOMDocument(“1.0″,”UTF-8″); $root = $xml->createElementNS(‘http:/fitcons.com/eInvoice/’, ‘InvoiceList’); $xml->appendChild($root); foreach(split($lineseparator,$csvcontent) as $line) { $lines++; $line = trim($line,” \t”); $line = str_replace(“\r”,””,$line); $line = str_replace(“‘”,”\'”,$line); $linearray = explode($fieldseparator,$line); if($linearray[24]>0){ $faturatarihi=iconv(“ISO-8859-9″,”UTF-8”,$linearray[0]); $InvoiceTypekodu=iconv(“ISO-8859-9″,”UTF-8”,$linearray[1]); $Notlar=iconv(“ISO-8859-9″,”UTF-8”,$linearray[2]); $DocumentCurrencykodu=iconv(“ISO-8859-9″,”UTF-8”,$linearray[3]); $CustomerIdentifier=iconv(“ISO-8859-9″,”UTF-8”,$linearray[4]); $CustomerWebPage=iconv(“ISO-8859-9″,”UTF-8”,$linearray[5]); $Customervkn=iconv(“ISO-8859-9″,”UTF-8”,$linearray[6]); $customerpartyname=iconv(“ISO-8859-9″,”UTF-8”,$linearray[7]); $customerstreet=iconv(“ISO-8859-9″,”UTF-8”,$linearray[8]); $customerbuilding=iconv(“ISO-8859-9″,”UTF-8”,$linearray[9]); $customerbuildingnumber=iconv(“ISO-8859-9″,”UTF-8”,$linearray[10]); $customersubdivision=iconv(“ISO-8859-9″,”UTF-8”,$linearray[11]); $customercity=iconv(“ISO-8859-9″,”UTF-8”,$linearray[12]); $customerpostal=iconv(“ISO-8859-9″,”UTF-8”,$linearray[13]); $customercountry=iconv(“ISO-8859-9″,”UTF-8”,$linearray[14]); $customervergidairesi=iconv(“ISO-8859-9″,”UTF-8”,$linearray[15]); $customertelephone=iconv(“ISO-8859-9″,”UTF-8”,$linearray[16]); $customerfax=iconv(“ISO-8859-9″,”UTF-8”,$linearray[17]); $customermail=iconv(“ISO-8859-9″,”UTF-8”,$linearray[18]); $taxcurrencycode=iconv(“ISO-8859-9″,”UTF-8”,$linearray[3]); $KDV=str_replace(‘,’,’.’,iconv(“ISO-8859-9″,”UTF-8”,$linearray[19])); $kdvharicfiyat=str_replace(‘,’,’.’,iconv(“ISO-8859-9″,”UTF-8”,$linearray[20])); $kdvdahilfiyat=str_replace(‘,’,’.’,iconv(“ISO-8859-9″,”UTF-8”,$linearray[21])); $faturalananadet=iconv(“ISO-8859-9″,”UTF-8”,$linearray[22]); $urunadi=iconv(“ISO-8859-9″,”UTF-8”,$linearray[23]); $faturano=iconv(“ISO-8859-9″,”UTF-8”,$linearray[24]); $faturaturu=iconv(“ISO-8859-9″,”UTF-8”,$linearray[25]); // $=$linearray[]; $firmapartyname=iconv(“ISO-8859-9″,”UTF-8″,”Tur Assist Yardım Ve Servis LTD. ŞTİ.”); $firmastreetname=iconv(“ISO-8859-9″,”UTF-8″,”19 Mayıs Mh. Dr Ismet Öztürk Sk”); $firmabuildingname=iconv(“ISO-8859-9″,”UTF-8″,”Şişli Plaza Ofis Katları E – Blok”); $firmabuildingnumber=iconv(“ISO-8859-9″,”UTF-8″,”B-2”); $firmaCitySubdivisionName=iconv(“ISO-8859-9″,”UTF-8″,”ŞİŞLİ”); $firmacityname=iconv(“ISO-8859-9″,”UTF-8″,”İSTANBUL”); $firmapostalzone=iconv(“ISO-8859-9″,”UTF-8″,”34360”); $firmacountry=iconv(“ISO-8859-9″,”UTF-8″,”TÜRKİYE”); $firmavergidairesi=iconv(“ISO-8859-9″,”UTF-8″,”Boğaziçi Kurumlar Vergi Dairesi”); //INVOICE TA I BURADAN BAŞLIYOR $UUID = $xml->createElement(“UUID”); $EnvUUID = $xml->createElement(“EnvUUID”); $ID = $xml->createElement(“ID”); $ProfileID = $xml->createElement(“ProfileID”); $ProfileIDText = $xml->createTextNode(“$faturaturu”); $ProfileID->appendChild($ProfileIDText); $CopyIndicator = $xml->createElement(“CopyIndicator”); $CopyIndicatorText = $xml->createTextNode(‘false’); $CopyIndicator->appendChild($CopyIndicatorText); $IssueDate = $xml->createElement(“IssueDate”); $IssueDateText = $xml->createTextNode(“$faturatarihi”); $IssueDate->appendChild($IssueDateText); $InvoiceTypeCode = $xml->createElement(“InvoiceTypeCode”); $InvoiceTypeCodeText = $xml->createTextNode(“$InvoiceTypekodu”); $InvoiceTypeCode->appendChild($InvoiceTypeCodeText); $Note = $xml->createElement(“Note”); $NoteText = $xml->createTextNode(“$Notlar”); $Note->appendChild($NoteText); $DocumentCurrencyCode = $xml->createElement(“DocumentCurrencyCode”); $DocumentCurrencyCodeText = $xml->createTextNode(“$DocumentCurrencykodu”); $DocumentCurrencyCode->appendChild($DocumentCurrencyCodeText); $LineCountNumeric = $xml->createElement(“LineCountNumeric”); $LineCountNumericText = $xml->createTextNode(‘1’); $LineCountNumeric->appendChild($LineCountNumericText); //AccountingSupplierParty Buradan Başlıyor *************************** $AccountingSupplierPartyIdentifier = $xml->createElement(“Identifier”); $AccountingSupplierPartyIdentifierIdentifierText = $xml->createTextNode(‘urn:mail:defaultgb@ingbank.com.tr’); $AccountingSupplierPartyIdentifier->appendChild($AccountingSupplierPartyIdentifierIdentifierText); $AccountingSupplierPartyWebsiteURI = $xml->createElement(“WebsiteURI”); $AccountingSupplierPartyWebsiteURIText = $xml->createTextNode(‘http://www.turassist.com’); $AccountingSupplierPartyWebsiteURI->appendChild($AccountingSupplierPartyWebsiteURIText); $AccountingSupplierPartyPartyIdentificationID = $xml->createElement(“ID”); $schemaidSUPP = $xml->createAttribute(“schemeID”); $schemaidSUPP->value=”VKN”; $AccountingSupplierPartyPartyIdentificationIDtext = $xml->createTextNode(‘8690057625’); $AccountingSupplierPartyPartyIdentificationID->appendChild($schemaidSUPP); $AccountingSupplierPartyPartyIdentificationID->appendChild($AccountingSupplierPartyPartyIdentificationIDtext); $AccountingSupplierPartyPartyName = $xml->createElement(“PartyName”); $AccountingSupplierPartyPartyNameText = $xml->createTextNode(“$firmapartyname”); $AccountingSupplierPartyPartyName->appendChild($AccountingSupplierPartyPartyNameText); $AccountingSupplierPartyPostalAddressRoom = $xml->createElement(“Room”); $AccountingSupplierPartyPostalAddressStreetName = $xml->createElement(“StreetName”); $AccountingSupplierPartyPostalAddressStreetNametext = $xml->createTextNode(“$firmastreetname”); $AccountingSupplierPartyPostalAddressStreetName->appendChild($AccountingSupplierPartyPostalAddressStreetNametext); $AccountingSupplierPartyPostalAddressBuildingName = $xml->createElement(“BuildingName”); $AccountingSupplierPartyPostalAddressBuildingNametext = $xml->createTextNode(“$firmabuildingname”); $AccountingSupplierPartyPostalAddressBuildingName->appendChild($AccountingSupplierPartyPostalAddressBuildingNametext); $AccountingSupplierPartyPostalAddressBuildingNumber = $xml->createElement(“BuildingNumber”); $AccountingSupplierPartyPostalAddressBuildingNumbertext = $xml->createTextNode(“$firmabuildingnumber”); $AccountingSupplierPartyPostalAddressBuildingNumber->appendChild($AccountingSupplierPartyPostalAddressBuildingNumbertext); $AccountingSupplierPartyPostalAddressCitySubdivisionName = $xml->createElement(“CitySubdivisionName”); $AccountingSupplierPartyPostalAddressCitySubdivisionNametext = $xml->createTextNode(“$firmaCitySubdivisionName”); $AccountingSupplierPartyPostalAddressCitySubdivisionName->appendChild($AccountingSupplierPartyPostalAddressCitySubdivisionNametext); $AccountingSupplierPartyPostalAddressCityName = $xml->createElement(“CityName”); $AccountingSupplierPartyPostalAddressCityNametext = $xml->createTextNode(“$firmacityname”); $AccountingSupplierPartyPostalAddressCityName->appendChild($AccountingSupplierPartyPostalAddressCityNametext); $AccountingSupplierPartyPostalAddressPostalZone = $xml->createElement(“PostalZone”); $AccountingSupplierPartyPostalAddressPostalZonetext = $xml->createTextNode(“$firmapostalzone”); $AccountingSupplierPartyPostalAddressPostalZone->appendChild($AccountingSupplierPartyPostalAddressPostalZonetext); $AccountingSupplierPartyPostalAddressCountry = $xml->createElement(“Country”); $AccountingSupplierPartyPostalAddressCountrytext = $xml->createTextNode(“$firmacountry”); $AccountingSupplierPartyPostalAddressCountry->appendChild($AccountingSupplierPartyPostalAddressCountrytext); $AccountingSupplierPartyPostalAddressRegion = $xml->createElement(“Region”); $AccountingSupplierPartyTaxSchemeName = $xml->createElement(“Name”); $AccountingSupplierPartyTaxSchemeNametext = $xml->createTextNode(“$firmavergidairesi”); $AccountingSupplierPartyTaxSchemeName->appendChild($AccountingSupplierPartyTaxSchemeNametext); $AccountingSupplierPartyContactTelephone = $xml->createElement(“Telephone”); $AccountingSupplierPartyContactTelephonetext = $xml->createTextNode(‘2122968161’); $AccountingSupplierPartyContactTelephone->appendChild($AccountingSupplierPartyContactTelephonetext); $AccountingSupplierPartyContactTelefax = $xml->createElement(“Telefax”); $AccountingSupplierPartyContactTelefaxtext = $xml->createTextNode(‘2122968161’); $AccountingSupplierPartyContactTelefax->appendChild($AccountingSupplierPartyContactTelefaxtext); $AccountingSupplierPartyContactElectronicMail = $xml->createElement(“ElectronicMail”); $AccountingSupplierPartyContactElectronicMailtext = $xml->createTextNode(‘tciloglu@turassist.com’); $AccountingSupplierPartyContactElectronicMail->appendChild($AccountingSupplierPartyContactElectronicMailtext); // AccountingSupplierParty burada bitiyor ********************** //AccountingCustomerParty Buradan Başlıyor ********************* $AccountingCustomerPartyIdentifier = $xml->createElement(“Identifier”); $AccountingCustomerPartyIdentifierIdentifierText = $xml->createTextNode(“$CustomerIdentifier”); $AccountingCustomerPartyIdentifier->appendChild($AccountingCustomerPartyIdentifierIdentifierText); $AccountingCustomerPartyWebsiteURI = $xml->createElement(“WebsiteURI”); $AccountingCustomerPartyWebsiteURIText = $xml->createTextNode(“$CustomerWebPage”); $AccountingCustomerPartyWebsiteURI->appendChild($AccountingCustomerPartyWebsiteURIText); $AccountingCustomerPartyPartyIdentificationID = $xml->createElement(“ID”); $schemaidCUST = $xml->createAttribute(“schemeID”); $schemaidCUST->value=”VKN”; $AccountingCustomerPartyPartyIdentificationIDtext = $xml->createTextNode(“$Customervkn”); $AccountingCustomerPartyPartyIdentificationID->appendChild($schemaidCUST); $AccountingCustomerPartyPartyIdentificationID->appendChild($AccountingCustomerPartyPartyIdentificationIDtext); $AccountingCustomerPartyPartyName = $xml->createElement(“PartyName”); $AccountingCustomerPartyPartyNameText = $xml->createTextNode(“$customerpartyname”); $AccountingCustomerPartyPartyName->appendChild($AccountingCustomerPartyPartyNameText); $AccountingCustomerPartyPostalAddressRoom = $xml->createElement(“Room”); $AccountingCustomerPartyPostalAddressStreetName = $xml->createElement(“StreetName”); $AccountingCustomerPartyPostalAddressStreetNametext = $xml->createTextNode(“$customerstreet”); $AccountingCustomerPartyPostalAddressStreetName->appendChild($AccountingCustomerPartyPostalAddressStreetNametext); $AccountingCustomerPartyPostalAddressBuildingName = $xml->createElement(“BuildingName”); $AccountingCustomerPartyPostalAddressBuildingNametext = $xml->createTextNode(“$customerbuilding”); $AccountingCustomerPartyPostalAddressBuildingName->appendChild($AccountingCustomerPartyPostalAddressBuildingNametext); $AccountingCustomerPartyPostalAddressBuildingNumber = $xml->createElement(“BuildingNumber”); $AccountingCustomerPartyPostalAddressBuildingNumbertext = $xml->createTextNode(“$customerbuildingnumber”); $AccountingCustomerPartyPostalAddressBuildingNumber->appendChild($AccountingCustomerPartyPostalAddressBuildingNumbertext); $AccountingCustomerPartyPostalAddressCitySubdivisionName = $xml->createElement(“CitySubdivisionName”); $AccountingCustomerPartyPostalAddressCitySubdivisionNametext = $xml->createTextNode(“$customersubdivision”); $AccountingCustomerPartyPostalAddressCitySubdivisionName->appendChild($AccountingCustomerPartyPostalAddressCitySubdivisionNametext); $AccountingCustomerPartyPostalAddressCityName = $xml->createElement(“CityName”); $AccountingCustomerPartyPostalAddressCityNametext = $xml->createTextNode(“$customercity”); $AccountingCustomerPartyPostalAddressCityName->appendChild($AccountingCustomerPartyPostalAddressCityNametext); $AccountingCustomerPartyPostalAddressPostalZone = $xml->createElement(“PostalZone”); $AccountingCustomerPartyPostalAddressPostalZonetext = $xml->createTextNode(“$customerpostal”); $AccountingCustomerPartyPostalAddressPostalZone->appendChild($AccountingCustomerPartyPostalAddressPostalZonetext); $AccountingCustomerPartyPostalAddressCountry = $xml->createElement(“Country”); $AccountingCustomerPartyPostalAddressCountrytext = $xml->createTextNode(“$customercountry”); $AccountingCustomerPartyPostalAddressCountry->appendChild($AccountingCustomerPartyPostalAddressCountrytext); $AccountingCustomerPartyPostalAddressRegion = $xml->createElement(“Region”); $AccountingCustomerPartyTaxSchemeName = $xml->createElement(“Name”); $AccountingCustomerPartyTaxSchemeNametext = $xml->createTextNode(“$customervergidairesi”); $AccountingCustomerPartyTaxSchemeName->appendChild($AccountingCustomerPartyTaxSchemeNametext); $AccountingCustomerPartyContactTelephone = $xml->createElement(“Telephone”); $AccountingCustomerPartyContactTelephonetext = $xml->createTextNode(“$customertelephone”); $AccountingCustomerPartyContactTelephone->appendChild($AccountingCustomerPartyContactTelephonetext); $AccountingCustomerPartyContactTelefax = $xml->createElement(“Telefax”); $AccountingCustomerPartyContactTelefaxtext = $xml->createTextNode(“$customerfax”); $AccountingCustomerPartyContactTelefax->appendChild($AccountingCustomerPartyContactTelefaxtext); $AccountingCustomerPartyContactElectronicMail = $xml->createElement(“ElectronicMail”); $AccountingCustomerPartyContactElectronicMailtext = $xml->createTextNode(“$customermail”); $AccountingCustomerPartyContactElectronicMail->appendChild($AccountingCustomerPartyContactElectronicMailtext); // AccountingCustomerParty burada bitiyor ********************************** //TaxTotal Buradan Başlıyor ********************* $TaxTotalTaxAmount = $xml->createElement(“TaxAmount”); $TaxAmountATT = $xml->createAttribute(“currencyID”); $TaxAmountATT->value=”$taxcurrencycode”; $TaxTotalTaxAmountText = $xml->createTextNode(“$KDV”); $TaxTotalTaxAmount->appendChild($TaxAmountATT); $TaxTotalTaxAmount->appendChild($TaxTotalTaxAmountText); $TaxTotalTaxSubTotalTaxableAmount = $xml->createElement(“TaxableAmount”); $TaxableAmountATT = $xml->createAttribute(“currencyID”); $TaxableAmountATT->value=”$taxcurrencycode”; $TaxTotalTaxSubTotalTaxableAmounttext = $xml->createTextNode(“$KDV”); $TaxTotalTaxSubTotalTaxableAmount->appendChild($TaxableAmountATT); $TaxTotalTaxSubTotalTaxableAmount->appendChild($TaxTotalTaxSubTotalTaxableAmounttext); $TaxTotalTaxSubTotalTaxAmount = $xml->createElement(“TaxAmount”); $TaxAmountATT2 = $xml->createAttribute(“currencyID”); $TaxAmountATT2->value=”$taxcurrencycode”; $TaxTotalTaxSubTotalTaxAmounttext = $xml->createTextNode(“$KDV”); $TaxTotalTaxSubTotalTaxAmount->appendChild($TaxAmountATT2); $TaxTotalTaxSubTotalTaxAmount->appendChild($TaxTotalTaxSubTotalTaxAmounttext); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeName = $xml->createElement(“Name”); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeNametext = $xml->createTextNode(‘KDV’); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeName->appendChild($TaxTotalTaxSubTotalTaxCategoryTaxSchemeNametext); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeTaxTypeCode = $xml->createElement(“TaxTypeCode”); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeTaxTypeCodetext = $xml->createTextNode(‘0015’); $TaxTotalTaxSubTotalTaxCategoryTaxSchemeTaxTypeCode->appendChild($TaxTotalTaxSubTotalTaxCategoryTaxSchemeTaxTypeCodetext); // TaxTotal burada bitiyor ********************************** //LegalMonetaryTotal Buradan Başlıyor ********************* $LineExtensionAmount = $xml->createElement(“LineExtensionAmount”); $LineExtensionAmountATT = $xml->createAttribute(“currencyID”); $LineExtensionAmountATT->value=”$taxcurrencycode”; $LineExtensionAmountText = $xml->createTextNode(“$kdvharicfiyat”); $LineExtensionAmount->appendChild($LineExtensionAmountATT); $LineExtensionAmount->appendChild($LineExtensionAmountText); $TaxExclusiveAmount = $xml->createElement(“TaxExclusiveAmount”); $TaxExclusiveAmountTextATT = $xml->createAttribute(“currencyID”); $TaxExclusiveAmountTextATT->value=”$taxcurrencycode”; $TaxExclusiveAmountText = $xml->createTextNode(“$kdvharicfiyat”); $TaxExclusiveAmount->appendChild($TaxExclusiveAmountTextATT); $TaxExclusiveAmount->appendChild($TaxExclusiveAmountText); $TaxInclusiveAmount = $xml->createElement(“TaxInclusiveAmount”); $TaxInclusiveAmountATT = $xml->createAttribute(“currencyID”); $TaxInclusiveAmountATT->value=”$taxcurrencycode”; $TaxInclusiveAmountText = $xml->createTextNode(“$kdvdahilfiyat”); $TaxInclusiveAmount->appendChild($TaxInclusiveAmountATT); $TaxInclusiveAmount->appendChild($TaxInclusiveAmountText); $PayableAmount = $xml->createElement(“PayableAmount”); $PayableAmountATT = $xml->createAttribute(“currencyID”); $PayableAmountATT->value=”$taxcurrencycode”; $PayableAmountText = $xml->createTextNode(“$kdvdahilfiyat”); $PayableAmount->appendChild($PayableAmountATT); $PayableAmount->appendChild($PayableAmountText); // LegalMonetaryTotal burada bitiyor ********************************** //InvoiceLine Buradan Başlıyor ********************* $InvoiceLineID = $xml->createElement(“ID”); $InvoiceLineIDText = $xml->createTextNode(‘1’); $InvoiceLineID->appendChild($InvoiceLineIDText); $InvoicedQuantity = $xml->createElement(“InvoicedQuantity”); $InvoicedQuantityTextATT = $xml->createAttribute(“unitCode”); $InvoicedQuantityTextATT->value=”NIU”; $InvoicedQuantityText = $xml->createTextNode(“$faturalananadet”); $InvoicedQuantity->appendChild($InvoicedQuantityTextATT); $InvoicedQuantity->appendChild($InvoicedQuantityText); $InvoiceLineLineExtensionAmount = $xml->createElement(“LineExtensionAmount”); $InvoiceLineLineExtensionAmountATT = $xml->createAttribute(“currencyID”); $InvoiceLineLineExtensionAmountATT->value=”TRL”; $InvoiceLineLineExtensionAmountText = $xml->createTextNode(“$kdvharicfiyat”); $InvoiceLineLineExtensionAmount->appendChild($InvoiceLineLineExtensionAmountATT); $InvoiceLineLineExtensionAmount->appendChild($InvoiceLineLineExtensionAmountText); $InvoiceLineItemName = $xml->createElement(“Name”); $InvoiceLineItemNameText = $xml->createTextNode(“$urunadi”); $InvoiceLineItemName->appendChild($InvoiceLineItemNameText); $InvoiceLinePricePriceAmount = $xml->createElement(“PriceAmount”); $InvoiceLinePricePriceAmountATT = $xml->createAttribute(“currencyID”); $InvoiceLinePricePriceAmountATT->value=”TRL”; $InvoiceLinePricePriceAmountText = $xml->createTextNode(“$kdvharicfiyat”); $InvoiceLinePricePriceAmount->appendChild($InvoiceLinePricePriceAmountATT); $InvoiceLinePricePriceAmount->appendChild($InvoiceLinePricePriceAmountText); // InvoiceLine burada bitiyor ********************************** //Extensions Buradan Başlıyor ********************* $CustInvID = $xml->createElement(“CustInvID”); $CustInvIDText = $xml->createTextNode(“$faturano”); $CustInvID->appendChild($CustInvIDText); $CustInvType = $xml->createElement(“CustInvType”); $CustInvTypeText = $xml->createTextNode(‘0’); $CustInvType->appendChild($CustInvTypeText); $IsOnBehalf = $xml->createElement(“IsOnBehalf”); $IsOnBehalfText = $xml->createTextNode(‘0’); $IsOnBehalf->appendChild($IsOnBehalfText); $SystemID = $xml->createElement(“SystemID”); $SystemIDText = $xml->createTextNode(‘0’); $SystemID->appendChild($SystemIDText); $Agent = $xml->createElement(“Agent”); $AgentText = $xml->createTextNode(”); $Agent->appendChild($AgentText); // Extensions burada bitiyor ********************************** $Extensions = $xml->createElement(“Extensions”); $InvoiceLine = $xml->createElement(“InvoiceLine”); $InvoiceLineItem = $xml->createElement(“Item”); $InvoiceLinePrice = $xml->createElement(“Price”); $LegalMonetaryTotal = $xml->createElement(“LegalMonetaryTotal”); $TaxTotalTaxSubTotalTaxCategoryTaxScheme = $xml->createElement(“TaxScheme”); $TaxTotalTaxSubTotalTaxCategory = $xml->createElement(“TaxCategory”); $TaxTotalTaxSubTotal = $xml->createElement(“TaxSubTotal”); $TaxTotal = $xml->createElement(“TaxTotal”); $AccountingCustomerPartyContact = $xml->createElement(“Contact”); $AccountingCustomerPartyTaxScheme = $xml->createElement(“TaxScheme”); $AccountingCustomerPartyPostalAddress = $xml->createElement(“PostalAddress”); $AccountingCustomerPartyPartyIdentification = $xml->createElement(“PartyIdentification”); $AccountingCustomerParty = $xml->createElement(“AccountingCustomerParty”); $AccountingSupplierPartyContact = $xml->createElement(“Contact”); $AccountingSupplierPartyTaxScheme = $xml->createElement(“TaxScheme”); $AccountingSupplierPartyPostalAddress = $xml->createElement(“PostalAddress”); $AccountingSupplierPartyPartyIdentification = $xml->createElement(“PartyIdentification”); $AccountingSupplierParty = $xml->createElement(“AccountingSupplierParty”); $Invoice = $xml->createElement(“Invoice”); $Invoice->appendChild($UUID); $Invoice->appendChild($EnvUUID); $Invoice->appendChild($ID); $Invoice->appendChild($ProfileID); $Invoice->appendChild($CopyIndicator); $Invoice->appendChild($IssueDate); $Invoice->appendChild($InvoiceTypeCode); $Invoice->appendChild($Note); $Invoice->appendChild($DocumentCurrencyCode); $Invoice->appendChild($LineCountNumeric); /*AccountingSupplierParty Başladı*/ $AccountingSupplierParty->appendChild($AccountingSupplierPartyIdentifier); $AccountingSupplierParty->appendChild($AccountingSupplierPartyWebsiteURI); $AccountingSupplierPartyPartyIdentification->appendChild($AccountingSupplierPartyPartyIdentificationID); $AccountingSupplierParty->appendChild($AccountingSupplierPartyPartyIdentification); $AccountingSupplierParty->appendChild($AccountingSupplierPartyPartyName); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressRoom); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressStreetName); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressBuildingName); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressBuildingNumber); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressCitySubdivisionName); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressCityName); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressPostalZone); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressRegion); $AccountingSupplierPartyPostalAddress->appendChild($AccountingSupplierPartyPostalAddressCountry); $AccountingSupplierParty->appendChild($AccountingSupplierPartyPostalAddress); $AccountingSupplierPartyTaxScheme->appendChild($AccountingSupplierPartyTaxSchemeName); $AccountingSupplierParty->appendChild($AccountingSupplierPartyTaxScheme); $AccountingSupplierPartyContact->appendChild($AccountingSupplierPartyContactTelephone); $AccountingSupplierPartyContact->appendChild($AccountingSupplierPartyContactTelefax); $AccountingSupplierPartyContact->appendChild($AccountingSupplierPartyContactElectronicMail); $AccountingSupplierParty->appendChild($AccountingSupplierPartyContact); /*AccountingSupplierParty bitti*/ /*AccountingCustomerParty Başladı*/ $AccountingCustomerParty->appendChild($AccountingCustomerPartyIdentifier); $AccountingCustomerParty->appendChild($AccountingCustomerPartyWebsiteURI); $AccountingCustomerPartyPartyIdentification->appendChild($AccountingCustomerPartyPartyIdentificationID); $AccountingCustomerParty->appendChild($AccountingCustomerPartyPartyIdentification); $AccountingCustomerParty->appendChild($AccountingCustomerPartyPartyName); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressRoom); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressStreetName); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressBuildingName); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressBuildingNumber); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressCitySubdivisionName); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressCityName); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressPostalZone); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressRegion); $AccountingCustomerPartyPostalAddress->appendChild($AccountingCustomerPartyPostalAddressCountry); $AccountingCustomerParty->appendChild($AccountingCustomerPartyPostalAddress); $AccountingCustomerPartyTaxScheme->appendChild($AccountingCustomerPartyTaxSchemeName); $AccountingCustomerParty->appendChild($AccountingCustomerPartyTaxScheme); $AccountingCustomerPartyContact->appendChild($AccountingCustomerPartyContactTelephone); $AccountingCustomerPartyContact->appendChild($AccountingCustomerPartyContactTelefax); $AccountingCustomerPartyContact->appendChild($AccountingCustomerPartyContactElectronicMail); $AccountingCustomerParty->appendChild($AccountingCustomerPartyContact); /*AccountingCustomerParty bitti*/ /*TaxTotal Başladı*/ $TaxTotal->appendChild($TaxTotalTaxAmount); $TaxTotalTaxSubTotal->appendChild($TaxTotalTaxSubTotalTaxableAmount); $TaxTotalTaxSubTotal->appendChild($TaxTotalTaxSubTotalTaxAmount); $TaxTotal->appendChild($TaxTotalTaxSubTotal); $TaxTotalTaxSubTotalTaxCategoryTaxScheme->appendChild($TaxTotalTaxSubTotalTaxCategoryTaxSchemeName); $TaxTotalTaxSubTotalTaxCategoryTaxScheme->appendChild($TaxTotalTaxSubTotalTaxCategoryTaxSchemeTaxTypeCode); $TaxTotalTaxSubTotal->appendChild($TaxTotalTaxSubTotalTaxCategory); $TaxTotalTaxSubTotalTaxCategory->appendChild($TaxTotalTaxSubTotalTaxCategoryTaxScheme); /*TaxTotal bitti*/ /*LegalMonetaryTotal Başladı*/ $LegalMonetaryTotal->appendChild($LineExtensionAmount); $LegalMonetaryTotal->appendChild($TaxExclusiveAmount); $LegalMonetaryTotal->appendChild($TaxInclusiveAmount); $LegalMonetaryTotal->appendChild($PayableAmount); /*LegalMonetaryTotal bitti*/ /*InvoiceLine Başladı*/ $InvoiceLine->appendChild($InvoiceLineID); $InvoiceLine->appendChild($InvoicedQuantity); $InvoiceLine->appendChild($InvoiceLineLineExtensionAmount); $InvoiceLineItem->appendChild($InvoiceLineItemName); $InvoiceLine->appendChild($InvoiceLineItem); $InvoiceLinePrice->appendChild($InvoiceLinePricePriceAmount); $InvoiceLine->appendChild($InvoiceLinePrice); /*InvoiceLine bitti*/ /*Extensions Başladı*/ $Extensions->appendChild($CustInvID); $Extensions->appendChild($CustInvType); $Extensions->appendChild($IsOnBehalf); $Extensions->appendChild($SystemID); $Extensions->appendChild($Agent); /*Extensions bitti*/ $Invoice->appendChild($AccountingSupplierParty); $Invoice->appendChild($AccountingCustomerParty); $Invoice->appendChild($TaxTotal); $Invoice->appendChild($LegalMonetaryTotal); $Invoice->appendChild($InvoiceLine); $Invoice->appendChild($Extensions); $root->appendChild($Invoice); } } $xml->formatOutput = true; $tarihi=date(“Y-m-d_H_i_s”); //echo “

“. $xml->saveXML() .”“; $filename=”E_FATURA_”.$tarihi.”.xml”; $xml->save($filename) or die(“Error”); $zipTest->add_file($filename, $filename); $zipadi=$tarihi.”.zip”; $zipfilename = $zipadi; $fd = fopen ($zipfilename, “wb”); $out = fwrite ($fd, $zipTest -> file()); fclose ($fd); echo ” Dosyayı İndirmel İçin Buraya Tıklayınız

“; // echo ”

Dosyayı İndirmel İçin Buraya Tıklayınız

“; ?>


YORUMLAR

Solve : *
27 − 23 =


Henüz yorum yapılmamış. İlk yorumu yukarıdaki form aracılığıyla siz yapabilirsiniz.