Skip to content

Commit

Permalink
changed source codepage to ANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
landrix committed Mar 18, 2021
1 parent 9c1b62e commit 66a2cda
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 17 deletions.
12 changes: 11 additions & 1 deletion Samples/XRechnungProject.dproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{289847D5-0AA3-4C16-9133-97921118E4C5}</ProjectGuid>
<ProjectVersion>19.1</ProjectVersion>
<ProjectVersion>19.2</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>XRechnungProject.dpr</MainSource>
<Base>True</Base>
Expand Down Expand Up @@ -305,6 +305,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
Expand Down
10 changes: 6 additions & 4 deletions Samples/XRechnungUnit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,12 @@ procedure TForm1.btCreateInvoiceClick(Sender: TObject);
inv.PayableAmount := inv.PayableAmount - inv.PrepaidAmount;
end;

//TODO PayableRoundingAmount
try
Generate122(inv);
Generate201(inv);
//TODO PayableRoundingAmount
try

Generate122(inv);

Generate201(inv);
finally
inv.Free;
end;
Expand Down
43 changes: 39 additions & 4 deletions intf.Invoice.pas
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ TInvoiceUnitCodeHelper = class(TObject)
//idtfcc_F_ValueAddedTaxVATMmarginSchemeSecondhandGoods, // Indication that the VAT margin scheme for second-hand goods is applied.
idtfcc_G_FreeExportItemTaxNotCharged, // Code specifying that the item is free export and taxes are not charged.
//idtfcc_H_HigherRate, // Code specifying a higher rate of duty or tax or fee.
//idtfcc_I_ValueAddedTaxVATMarginSchemeWorksOfArt, // Margin scheme — Works of art Indication that the VAT margin scheme for works of art is applied.
//idtfcc_J_ValueAddedTaxVATMarginSchemeCollectorsItemsAndAntiques, // Indication that the VAT margin scheme for collector’s items and antiques is applied.
//idtfcc_I_ValueAddedTaxVATMarginSchemeWorksOfArt, // Margin scheme - Works of art Indication that the VAT margin scheme for works of art is applied.
//idtfcc_J_ValueAddedTaxVATMarginSchemeCollectorsItemsAndAntiques, // Indication that the VAT margin scheme for collector s items and antiques is applied.
idtfcc_K_VATExemptForEEAIntracommunitySupplyOfGoodsAndServices, // A tax category code indicating the item is VAT exempt due to an intra-community supply in the European Economic Area.
idtfcc_L_CanaryIslandsGeneralIndirectTax, // Impuesto General Indirecto Canario (IGIC) is an indirect tax levied on goods and services supplied in the Canary Islands (Spain) by traders and professionals, as well as on import of goods.
idtfcc_M_TaxForProductionServicesAndImportationInCeutaAndMelilla, // Impuesto sobre la Producción, los Servicios y la Importación (IPSI) is an indirect municipal tax, levied on the production, processing and import of all kinds of movable tangible property, the supply of services and the transfer of immovable property located in the cities of Ceuta and Melilla.
idtfcc_M_TaxForProductionServicesAndImportationInCeutaAndMelilla, // Impuesto sobre la Produccion, los Servicios y la Importacion (IPSI) is an indirect municipal tax, levied on the production, processing and import of all kinds of movable tangible property, the supply of services and the transfer of immovable property located in the cities of Ceuta and Melilla.
//idtfcc_O_ServicesOutsideScopeOfTax, // Code specifying that taxes are not applicable to the services.
idtfcc_S_StandardRate, // Code specifying the standard rate.
idtfcc_Z_ZeroRatedGoods);
Expand Down Expand Up @@ -326,6 +326,14 @@ TInvoiceTaxAmount = record

TInvoiceTaxAmountArray = TArray<TInvoiceTaxAmount>;

{$IF CompilerVersion >= 33.0}
TInvoiceTaxAmountArrayHelper = record helper for TInvoiceTaxAmountArray
public
function AddTaxAmountIfTaxExists(_TaxPercent : double; _TaxableAmount,_TaxAmount : Currency) : Boolean;
procedure SetCapacity(_Capacity : Integer);
end;
{$ENDIF}

TInvoiceAddress = record
public
StreetName : String;
Expand Down Expand Up @@ -357,7 +365,7 @@ TInvoiceAccountingParty = record
TInvoiceDeliveryInformation = record
public
Name : String;
//LocationIdentifier : String; //optional Ein Bezeichner für den Ort, an den die Waren geliefert oder an dem die Dienstleistungen erbracht werden.
//LocationIdentifier : String; //optional Ein Bezeichner fuer den Ort, an den die Waren geliefert oder an dem die Dienstleistungen erbracht werden.
Address : TInvoiceAddress;
ActualDeliveryDate : TDate; //Lieferdatum
end;
Expand Down Expand Up @@ -760,5 +768,32 @@ function TInvoiceAttachmentList.TryAddAttachmentByExtension(const _Filename: Str
Result := true;
end;

{$IF CompilerVersion >= 33.0}

{ TInvoiceTaxAmountArrayHelper }

function TInvoiceTaxAmountArrayHelper.AddTaxAmountIfTaxExists(
_TaxPercent: double; _TaxableAmount, _TaxAmount: Currency): Boolean;
var
i : Integer;
begin
Result := false;
for i := 0 to Length(self)-1 do
if self[i].TaxPercent = _TaxPercent then
begin
self[i].TaxableAmount := self[i].TaxableAmount + _TaxableAmount;
self[i].TaxAmount := self[i].TaxAmount + _TaxAmount;
Result := true;
break;
end;
end;

procedure TInvoiceTaxAmountArrayHelper.SetCapacity(_Capacity: Integer);
begin
SetLength(self,_Capacity);
end;

{$ENDIF}

end.

17 changes: 9 additions & 8 deletions intf.XRechnung.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
License XRechnung-for-Delphi
Copyright (C) 2021 Landrix Software GmbH & Co. KG
Expand Down Expand Up @@ -316,7 +316,7 @@ class function TXRechnungInvoiceAdapter.LoadDocumentUBL(_Invoice: TInvoice;
// begin
// AddChild('cbc:RegistrationName').Text := _Invoice.AccountingCustomerParty.RegistrationName;
// AddChild('cbc:CompanyID').Text := _Invoice.AccountingCustomerParty.CompanyID;
// //TODO <cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
// //TODO <cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
// end;
// with AddChild('cac:Contact') do
// begin
Expand Down Expand Up @@ -885,7 +885,7 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUBL(_Invoice: TInvoice;
begin
AddChild('cbc:RegistrationName').Text := _Invoice.AccountingCustomerParty.RegistrationName;
AddChild('cbc:CompanyID').Text := _Invoice.AccountingCustomerParty.CompanyID;
//TODO <cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
//TODO <cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
end;
with AddChild('cac:Contact') do
begin
Expand Down Expand Up @@ -1213,8 +1213,8 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUNCEFACT(_Invoice: TInvoice
if _Invoice.AccountingSupplierParty.IdentifierSellerBuyer <> '' then
AddChild('ram:ID').Text := _Invoice.AccountingSupplierParty.IdentifierSellerBuyer;
AddChild('ram:Name').Text := _Invoice.AccountingSupplierParty.RegistrationName;
//TODO <ram:Description>123/456/7890, HRA-Eintrag in []</ram:Description>
//<cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
//TODO <ram:Description>123/456/7890, HRA-Eintrag in []</ram:Description>
//<cbc:CompanyLegalForm>123/456/7890, HRA-Eintrag in []</cbc:CompanyLegalForm>
with AddChild('ram:SpecifiedLegalOrganization') do
begin
AddChild('ram:ID').Text := _Invoice.AccountingSupplierParty.CompanyID;
Expand Down Expand Up @@ -1366,7 +1366,8 @@ class procedure TXRechnungInvoiceAdapter.SaveDocumentUNCEFACT(_Invoice: TInvoice
begin
AddChild('ram:BICID').Text := _Invoice.PayeeFinancialInstitutionBranch;
//TODO <ram:Name>Name der Bank</ram:Name>
end; end;
end;
end;
for taxSubtotal in _Invoice.TaxAmountSubtotals do
with AddChild('ram:ApplicableTradeTax') do
begin
Expand Down Expand Up @@ -1548,7 +1549,7 @@ class function TXRechnungXMLHelper.PrepareDocumentForXPathQuerys(_Xml: IXMLDocum
begin
sNSN := StringReplace(hList.item[i].nodeName, 'xmlns:', '', []);
if sNSN = 'xml' then
begin // wenn es als xmlns:xml hinzugef�gt wird bekommt man die meldung das der Namespacename xml nicht verwendet werden darf...
begin // wenn es als xmlns:xml hinzugefuegt wird bekommt man die meldung das der Namespacename xml nicht verwendet werden darf...
sNSN := 'xmlns:MyXml';
sNSUri := hList.item[i].nodeValue;
end
Expand All @@ -1559,7 +1560,7 @@ class function TXRechnungXMLHelper.PrepareDocumentForXPathQuerys(_Xml: IXMLDocum
sNSUri := hList.item[i].nodeValue;
end
else
begin // alle anderen Namespace auch f�r XPath bekannt machen
begin // alle anderen Namespace auch fuer XPath bekannt machen
sNSN := hList.item[i].nodeName;
sNSUri := hList.item[i].nodeValue;
end;
Expand Down

0 comments on commit 66a2cda

Please sign in to comment.