Commit 97ec8829 authored by eicom's avatar eicom

- added parameters to determine the buyer/seller ID

parent 37a6790b
......@@ -85,7 +85,9 @@ namespace eval im_ubl {
if {"" != $xml} {
db_dml invoice_written "
update im_costs set ubl_exported_p = 't'
update im_costs set
ubl_exported_p = 't',
read_only_p = 't'
where cost_id = :invoice_id
"
}
......@@ -126,12 +128,18 @@ namespace eval im_ubl {
# ---------------------------------------------------------------
# Get information about the financial document ("invoice")
# ---------------------------------------------------------------
set buyer_id_sql [parameter::get_from_package_key -package_key "intranet-ubl" -parameter "BuyerIdSqlExpression" -default "cust.company_id"]
set seller_id_sql [parameter::get_from_package_key -package_key "intranet-ubl" -parameter "SellerIdSqlExpression" -default "prov.company_id"]
if {![db_0or1row project_info "
select c.*,
i.*,
paymeth.category_description as payment_method_desc,
$buyer_id_sql as buyer_id,
$seller_id_sql as seller_id,
cust.company_name as customer_name,
cust.main_office_id as customer_main_office_id,
i.invoice_office_id as invoice_office_id,
......@@ -311,11 +319,11 @@ namespace eval im_ubl {
$main_node appendXML "<ID>$cost_name</ID>"
$main_node appendXML "<cbc:IssueDate>$issue_date_pretty</cbc:IssueDate>"
$main_node appendXML "<TaxPointDate>$issue_date_pretty</TaxPointDate>"
$main_node appendXML "
<cac:OrderReference>
<cac:BuyersID>$customer_id</cac:BuyersID>
<cac:SellersID>$provider_id</cac:SellersID>
<cac:BuyersID>$buyer_id</cac:BuyersID>
<cac:SellersID>$seller_id</cac:SellersID>
<cbc:IssueDate>$issue_date_pretty</cbc:IssueDate>
</cac:OrderReference>"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment