diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/administration.hpp | 12 | ||||
| -rw-r--r-- | include/file_templates.hpp | 109 |
2 files changed, 94 insertions, 27 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index fe3d7b2..95d4622 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -109,18 +109,15 @@ typedef struct float amount; bool amount_is_percentage; char description[MAX_LEN_LONG_DESC]; - float net_per_item; + float net_per_item; // Net per item before discount. float discount; bool discount_is_percentage; float allowance; // Total discount. - float net; + float net; // Total net, with discount. char currency[MAX_LEN_CURRENCY]; // 3 letter code char tax_bracket_id[MAX_LEN_ID]; // T/[id] float tax; float total; - - // TODO uninplemented - char tax_section[MAX_LEN_TAX_SECTION]; } billing_item; /** @@ -257,11 +254,6 @@ typedef struct invoice_status status; bool is_outgoing; // Outgoing or incomming invoice. payment_information payment_means; - - bool is_intra_community; // TODO uninplemented - time_t payment_on_account_date; // TODO uninplemented - char tax_representative[MAX_LEN_LONG_DESC]; // TODO uninplemented - char corrected_sequential_number[MAX_LEN_ID]; // TODO uninplemented // Used for forms, not stored on disk. Filled when retrieved. contact supplier; diff --git a/include/file_templates.hpp b/include/file_templates.hpp index cb89050..af2f373 100644 --- a/include/file_templates.hpp +++ b/include/file_templates.hpp @@ -64,23 +64,37 @@ const char* peppol_invoice_tax_subtotal_template = " </cac:TaxSubtotal>\n"; const char* peppol_invoice_line_template = -" <cac:InvoiceLine>\n" -" <cbc:ID>{{LINE_ID}}</cbc:ID>\n" -" <cbc:InvoicedQuantity unitCode=\"{{UNIT_CODE}}\">{{QUANTITY}}</cbc:InvoicedQuantity>\n" -" <cbc:LineExtensionAmount currencyID=\"{{CURRENCY}}\">{{LINE_AMOUNT}}</cbc:LineExtensionAmount>\n" -" <cac:Item>\n" -" <cbc:Name>{{ITEM_NAME}}</cbc:Name>\n" -" <cac:ClassifiedTaxCategory>\n" -" <cbc:ID>{{LINE_TAX_CATEGORY}}</cbc:ID>\n" -" <cbc:Percent>{{LINE_TAX_PERCENT}}</cbc:Percent>\n" -" <cac:TaxScheme>\n" -" <cbc:ID>VAT</cbc:ID>\n" -" </cac:TaxScheme>\n" -" </cac:ClassifiedTaxCategory>\n" -" </cac:Item>\n" -" <cac:Price>\n" -" <cbc:PriceAmount currencyID=\"{{CURRENCY}}\">{{UNIT_PRICE}}</cbc:PriceAmount>\n" -" </cac:Price>\n" +" <cac:InvoiceLine>\n" +" <cbc:ID>{{LINE_ID}}</cbc:ID>\n" +" <cbc:InvoicedQuantity unitCode=\"{{UNIT_CODE}}\">{{QUANTITY}}</cbc:InvoicedQuantity>\n" +" <cbc:LineExtensionAmount currencyID=\"{{CURRENCY}}\">{{LINE_AMOUNT}}</cbc:LineExtensionAmount>\n" + +" <cac:OrderLineReference>\n" +" <cbc:LineID>{{TAX_BRACKET_ID}}</cbc:LineID>\n" +" </cac:OrderLineReference>\n" + +" <cac:AllowanceCharge>\n" +" <cbc:ChargeIndicator>false</cbc:ChargeIndicator>\n" +" <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason>\n" +" {{ALLOWANCE_IS_PERCENTAGE}}\n" +" <cbc:Amount currencyID=\"{{CURRENCY}}\">{{DISCOUNT_TOTAL}}</cbc:Amount>\n" +" <cbc:BaseAmount currencyID=\"{{CURRENCY}}\">{{DISCOUNT_BASE_AMOUNT}}</cbc:BaseAmount>\n" +" </cac:AllowanceCharge>\n" + +" <cac:Item>\n" +" <cbc:Name>{{ITEM_NAME}}</cbc:Name>\n" +" <cac:ClassifiedTaxCategory>\n" +" <cbc:ID>{{LINE_TAX_CATEGORY}}</cbc:ID>\n" +" <cbc:Percent>{{LINE_TAX_PERCENT}}</cbc:Percent>\n" +" <cac:TaxScheme>\n" +" <cbc:ID>VAT</cbc:ID>\n" +" </cac:TaxScheme>\n" +" </cac:ClassifiedTaxCategory>\n" +" </cac:Item>\n" + +" <cac:Price>\n" +" <cbc:PriceAmount currencyID=\"{{CURRENCY}}\">{{UNIT_PRICE}}</cbc:PriceAmount>\n" +" </cac:Price>\n" " </cac:InvoiceLine>\n"; const char *peppol_invoice_template = @@ -94,12 +108,25 @@ const char *peppol_invoice_template = "\n" " <cbc:ID>{{INVOICE_ID}}</cbc:ID>\n" " <cbc:IssueDate>{{ISSUE_DATE}}</cbc:IssueDate>\n" +" <cbc:DueDate>{{DUE_DATE}}</cbc:DueDate>\n" " <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n" " <cbc:DocumentCurrencyCode>{{CURRENCY}}</cbc:DocumentCurrencyCode>\n" "\n" +" <cac:AdditionalDocumentReference>\n" +" <cbc:ID>{{INVOICE_DOCUMENT}}</cbc:ID>\n" +" </cac:AdditionalDocumentReference>\n" +"\n" +" <cac:ProjectReference>\n" +" <cbc:ID>{{PROJECT_ID}}</cbc:ID>\n" +" </cac:ProjectReference>\n" +" <cbc:AccountingCost>{{COST_CENTER_CODE}}</cbc:AccountingCost>\n" +"\n" " <cac:AccountingSupplierParty>\n" " <cac:Party>\n" " <cbc:EndpointID schemeID=\"{{SUPPLIER_ENDPOINT_SCHEME}}\">{{SUPPLIER_ENDPOINT_ID}}</cbc:EndpointID>\n" +" <cac:PartyIdentification>\n" +" <cbc:ID schemeID=\"ZZZ\">{{SUPPLIER_ID}}</cbc:ID>\n" +" </cac:PartyIdentification>\n" " <cac:PartyName>\n" " <cbc:Name>{{SUPPLIER_NAME}}</cbc:Name>\n" " </cac:PartyName>\n" @@ -119,12 +146,27 @@ const char *peppol_invoice_template = " <cbc:ID>VAT</cbc:ID>\n" " </cac:TaxScheme>\n" " </cac:PartyTaxScheme>\n" +"\n" +" <cac:PartyLegalEntity>\n" +" <cbc:RegistrationName>{{SUPPLIER_LEGAL_NAME}}</cbc:RegistrationName>\n" +" <cbc:CompanyID schemeID=\"ZZZ\">{{SUPPLIER_BUSINESS_ID}}</cbc:CompanyID>\n" +" </cac:PartyLegalEntity>\n" +"\n" +" <cac:Contact>\n" +" <cbc:Name>{{SUPPLIER_NAME}}</cbc:Name>\n" +" <cbc:Telephone>{{SUPPLIER_PHONE_NUMBER}}</cbc:Telephone>\n" +" <cbc:ElectronicMail>{{SUPPLIER_EMAIL}}</cbc:ElectronicMail>\n" +" </cac:Contact>\n" +"\n" " </cac:Party>\n" " </cac:AccountingSupplierParty>\n" "\n" " <cac:AccountingCustomerParty>\n" " <cac:Party>\n" " <cbc:EndpointID schemeID=\"{{CUSTOMER_ENDPOINT_SCHEME}}\">{{CUSTOMER_ENDPOINT_ID}}</cbc:EndpointID>\n" +" <cac:PartyIdentification>\n" +" <cbc:ID schemeID=\"ZZZ\">{{CUSTOMER_ID}}</cbc:ID>\n" +" </cac:PartyIdentification>\n" " <cac:PartyName>\n" " <cbc:Name>{{CUSTOMER_NAME}}</cbc:Name>\n" " </cac:PartyName>\n" @@ -144,9 +186,42 @@ const char *peppol_invoice_template = " <cbc:ID>VAT</cbc:ID>\n" " </cac:TaxScheme>\n" " </cac:PartyTaxScheme>\n" +"\n" +" <cac:PartyLegalEntity>\n" +" <cbc:RegistrationName>{{CUSTOMER_LEGAL_NAME}}</cbc:RegistrationName>\n" +" <cbc:CompanyID schemeID=\"ZZZ\">{{CUSTOMER_BUSINESS_ID}}</cbc:CompanyID>\n" +" </cac:PartyLegalEntity>\n" +"\n" +" <cac:Contact>\n" +" <cbc:Name>{{CUSTOMER_NAME}}</cbc:Name>\n" +" <cbc:Telephone>{{CUSTOMER_PHONE_NUMBER}}</cbc:Telephone>\n" +" <cbc:ElectronicMail>{{CUSTOMER_EMAIL}}</cbc:ElectronicMail>\n" +" </cac:Contact>\n" +"\n" " </cac:Party>\n" " </cac:AccountingCustomerParty>\n" "\n" +"<cac:Delivery>\n" +" <cbc:ActualDeliveryDate>{{DELIVERY_DATE}}</cbc:ActualDeliveryDate>\n" +" <cac:DeliveryLocation>\n" +" <cac:Address>\n" +" <cbc:StreetName>{{DELIVERY_STREET}}</cbc:StreetName>\n" +" <cbc:AdditionalStreetName>{{DELIVERY_STREET2}}</cbc:AdditionalStreetName>\n" +" <cbc:CityName>{{DELIVERY_CITY}}</cbc:CityName>\n" +" <cbc:PostalZone>{{DELIVERY_POSTAL}}</cbc:PostalZone>\n" +" <cbc:CountrySubentity>{{DELIVERY_REGION}}</cbc:CountrySubentity>\n" +" <cac:Country>\n" +" <cbc:IdentificationCode>{{DELIVERY_COUNTRY}}</cbc:IdentificationCode>\n" +" </cac:Country>\n" +" </cac:Address>\n" +" </cac:DeliveryLocation>\n" +" <cac:DeliveryParty>\n" +" <cac:PartyName>\n" +" <cbc:Name>{{DELIVERY_NAME}}</cbc:Name>\n" +" </cac:PartyName>\n" +" </cac:DeliveryParty>\n" +"</cac:Delivery>\n" +"\n" " <cac:PaymentMeans>\n" " <cbc:PaymentMeansCode>{{PAYMENT_TYPE}}</cbc:PaymentMeansCode>\n" " <cbc:PaymentID>{{INVOICE_ID}}</cbc:PaymentID>\n" |
