diff --git a/ferag.go b/ferag.go index a4ce7be..75563fe 100644 --- a/ferag.go +++ b/ferag.go @@ -84,8 +84,10 @@ func (fs *FeragString) PrintOut() string { // AddProductReference adds a Product Reference instance to the list // of product references of the FeragString func (fs *FeragString) AddProductReference(pr *ProductReference) error { - fs.ProductReferencesNr++ - pr.SetProductReferenceNumber(fs.ProductReferencesNr) + if pr.productReferenceNumber == 0 { + fs.ProductReferencesNr++ + pr.SetProductReferenceNumber(fs.ProductReferencesNr) + } if pr.productReferenceNumber == 1 && pr.productUsageType == 0 { pr.SetProductUsageType(1) } diff --git a/product_reference.go b/product_reference.go index 8e53de2..ddd8d0f 100644 --- a/product_reference.go +++ b/product_reference.go @@ -119,13 +119,17 @@ func (pr *ProductReference) SetProductName(productName string) { } func (pr *ProductReference) ProductReferenceNumber() string { - return fmt.Sprintf("+41%02d", pr.productReferenceNumber) + return fmt.Sprintf("+99141%03d", pr.productReferenceNumber) } func (pr *ProductReference) SetProductReferenceNumber(productReferenceNumber int) { pr.productReferenceNumber = productReferenceNumber } +func (pr *ProductReference) GetProductReferenceNumber() int { + return pr.productReferenceNumber +} + func NewProductReference() *ProductReference { pr := ProductReference{ FeragMessage: FeragMessage{"2450", "!"},