My Products
Help
lema
CONTRIBUTOR ***

Create customer invoice faild that the type of work can't be empty

by lema

When I try to create customer invoice by API, I get 'type of work' cannot be empty error, I want to know where can create new 'type of work' on Visma NET UI. where can add the 'type of work' to customer invoice(I didn't found the UI to create new type of work). thanks

10 REPLIES 10
lema
CONTRIBUTOR ***

by lema

Can someone help me with this question?

Yıldırım
VISMA

by Yıldırım

Hi, please try creating the same invoice in the Financials UI so that the system will highlight you the error for the specific area. Also make sure the Inventory used in the customerInvoiceLine has its Type defined in the Inventory card. 

lema
CONTRIBUTOR ***

by lema

When I try to create invoice in the Financials UI, but throw Error as below, can't continue, can you let me know where I can add the "type of work"? 

lema_2-1692151755970.png

 

 

I test to set the "typeOfWork" as "Rut",  I get error 'RUTROTWorkTypeID' is not found." as below

lema_1-1692151648228.png

 

 

Yıldırım
VISMA

by Yıldırım

Hi, "typeOfWork" is marked as obsolete, therefore it doesn't have any impact in the payload. 
Visma.net Integrations Documentation.jpg

 

In the first place, you should be able to create an Invoice with the same values in the Financials ERP UI, otherwise you can not create it via the API. 

 

So the error you receive in the UI should be resolved first. When do you receive that error exactly ? 
Please send the steps & printscreen of the Invoice. 

Thanks. 

lema
CONTRIBUTOR ***

by lema

I use the Financials ERP UI create a customer invoice success with the same values, and use API get the invoice that I created, there the field "typeOfWork" value was empty, but I use the API create customer invoice required field "typeOfWork". They are not consistent. 

lema_0-1692243053271.pnglema_1-1692243168457.png

 

Yıldırım
VISMA

by Yıldırım

Have you checked Inventory card and its details such as Type, ROTRUT etc. ? 

items.png

lema
CONTRIBUTOR ***

by lema

I didn't find the type of work as below:

lema_0-1692324470557.png

 

Yıldırım
VISMA

by Yıldırım

1) Please check Item Type and make sure it set in the "General Settings" tab of the item. 

2) Have you tried with a different inventory in the payload ? 

3) Send your json to us. 

Thanks. 

lema
CONTRIBUTOR ***

by lema

I set the DomesticServicesDeductible property value to false so that not need the type of work, but I get another error  

 "message""VismaId: 1f0790c7-eb2b-47be-a880-e7457062134b. Error creating document. Operation parameter: value 0 - 0 is not valid for this type of request.", Do you know which property incorrect?
below is my json:
{
  "PaymentMethodId": {
    "Value""01"
  },
  "CreditTermsId"null,
  "CurrencyId": {
    "Value""SEK"
  },
  "CustomerRefNumber"null,
  "CashDiscountDate": {
    "Value""2022-01-20T00:00:00"
  },
  "DocumentDueDate": {
    "Value""2022-01-20T00:00:00"
  },
  "ExternalReference"null,
  "CustomerProject": {
    "Value""00148"
  },
  "ExchangeRate": {
    
  },
  "DomesticServicesDeductibleDocument": {
    "Value"false
  },
  "RotRutDetails": {
    "DistributedAutomaticaly": {
      "Value"true
    },
    "Type": {
      "Value""Rut"
    },
    "Appartment"null,
    "Estate"null,
    "OrganizationNbr"null,
    "Distribution"null
  },
  "PaymentReference"null,
  "Contact"null,
  "Project": {
    "Value""00148"
  },
  "TaxDetailLines": [],
  "InvoiceLines": [
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false
      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork": {},
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate"null,
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation": {
        "Value""Insert"
      },
      "InventoryNumber": {
        "Value"null
      },
      "LineNumber"null,
      "Description": {
        "Value""200 - Brf lien, storskogsvägen 8 takavvattning"
      },
      "Quantity": {
        "Value"0.0
      },
      "UnitPriceInCurrency": {
        "Value"0.0
      },
      "ManualAmountInCurrency": {
        "Value"0.0
      },
      "AccountNumber": {
        "Value""9232"
      },
      "VatCodeId"null,
      "Uom": {
        "Value"null
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
       {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""1"
        }
      ],
      "Salesperson"null,
      "DeferralSchedule"null,
      "DeferralCode": {
        "Value""One"
      },
      "TermStartDate"null,
      "TermEndDate"null,
      "Note"null,
      "BranchNumber"null
    },
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false
      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork"null,
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate"null,
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation": {
        "Value""Insert"
      },
      "InventoryNumber": {
        "Value"null
      },
      "LineNumber"null,
      "Description": {
        "Value""Timmar"
      },
      "Quantity": {
        "Value"5.0
      },
      "UnitPriceInCurrency": {
        "Value"555.0
      },
      "ManualAmountInCurrency": {
        "Value"3191.25
      },
      "AccountNumber": {
        "Value""9232"
      },
      "VatCodeId"null,
      "Uom": {
        "Value"null
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
        {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""1"
        }
      ],
      "Salesperson"null,
      "DeferralSchedule"null,
      "DeferralCode": {
        "Value""One"
      },
      "TermStartDate"null,
      "TermEndDate"null,
      "Note"null,
      "BranchNumber"null
    },
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false
      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork"null,
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate"null,
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation": {
        "Value""Insert"
      },
      "InventoryNumber": {
        "Value"null
      },
      "LineNumber"null,
      "Description": {
        "Value""Hinder - båten fick vi betalt för"
      },
      "Quantity": {
        "Value"4.0
      },
      "UnitPriceInCurrency": {
        "Value"550.0
      },
      "ManualAmountInCurrency": {
        "Value"2200.0
      },
      "AccountNumber": {
        "Value""9232"
      },
      "VatCodeId"null,
      "Uom": {
        "Value"null
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
       {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""1"
        }
      ],
      "Salesperson"null,
      "DeferralSchedule"null,
      "DeferralCode": {
        "Value""One"
      },
      "TermStartDate"null,
      "TermEndDate"null,
      "Note"null,
      "BranchNumber"null
    },
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false
      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork"null,
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate"null,
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation": {
        "Value""Insert"
      },
      "InventoryNumber": {
        "Value""1265172"
      },
      "LineNumber"null,
      "Description": {
        "Value""1  GALV AD KNÄRÖR 10"
      },
      "Quantity": {
        "Value"10.0
      },
      "UnitPriceInCurrency": {
        "Value"100.0
      },
      "ManualAmountInCurrency": {
        "Value"990.0
      },
      "AccountNumber": {
        "Value""9232"
      },
      "VatCodeId"null,
      "Uom": {
        "Value"null
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
       {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""1"
        }
      ],
      "Salesperson"null,
      "DeferralSchedule"null,
      "DeferralCode": {
        "Value""One"
      },
      "TermStartDate"null,
      "TermEndDate"null,
      "Note"null,
      "BranchNumber"null
    },
    {
      "DiscountCode"null,
      "DomesticServicesDeductible": {
        "Value"false

      },
      "ItemType": {
        "Value""Service"
      },
      "TypeOfWork"null,
      "TaskId": {
        "Value""779847"
      },
      "CreatedDate"null,
      "StartDate": {
        "Value""2021-10-07T00:00:00"
      },
      "EndDate": {
        "Value""2022-05-11T00:00:00"
      },
      "Operation": {
        "Value""Insert"
      },
      "InventoryNumber": {
        "Value""1436054"
      },
      "LineNumber"null,
      "Description": {
        "Value""20 BLINDFL PN6 EN1092/05A S235"
      },
      "Quantity": {
        "Value"100.0
      },
      "UnitPriceInCurrency": {
        "Value"20.0
      },
      "ManualAmountInCurrency": {
        "Value"1960.0
      },
      "AccountNumber": {
        "Value""9232"
      },
      "VatCodeId"null,
      "Uom": {
        "Value"null
      },
      "DiscountPercent": {
        "Value"0.0
      },
      "DiscountAmountInCurrency": {
        "Value"0.0
      },
      "ManualDiscount": {
        "Value"true
      },
      "Subaccount": [
        {
          "SegmentId"1,
          "SegmentValue""00"
        },
        {
          "SegmentId"2,
          "SegmentValue""1"
        }
      ],
      "Salesperson"null,
      "DeferralSchedule"null,
      "DeferralCode": {
        "Value""One"
      },
      "TermStartDate"null,
      "TermEndDate"null,
      "Note"null,
      "BranchNumber"null
    }
  ],
  "SendToAutoInvoice": {
    "Value"true
  },
  "CustomerVatZoneId": {
    "Value""01"
  },
  "BillingAddress": {
    "Value": {
      "AddressLine1": {
        "Value""X"
      },
      "AddressLine2": {
        "Value""X"
      },
      "AddressLine3"null,
      "PostalCode": {
        "Value"null
      },
      "City": {
        "Value"null
      },
      "CountryId"null,
      "County": {
        "Value"null
      },
      "overrideAddress": {
        "Value"true
      }
    }
  },
  "InvoiceContact": {
    "Value": {
      "Name": {
        "Value""Brf Lien 5"
      },
      "Attention"null,
      "Email": {
        "Value"null
      },
      "Web"null,
      "Phone1": {
        "Value"null
      },
      "Phone2"null,
      "Fax"null,
      "OverrideContact": {
        "Value"true
      }
    }
  },
  "StartDate": {
    "Value""2021-10-07T00:00:00"
  },
  "EndDate": {
    "Value""2022-05-11T00:00:00"
  },
  "AccountingCostRef"null,
  "OriginatorDocRef"null,
  "ContractDocRef"null,
  "OverrideNumberSeries": {
    "Value"true
  },
  "ReferenceNumber"null,
  "CustomerNumber": {
    "Value""10141"
  },
  "DocumentDate": {
    "Value""2022-01-20T00:00:00"
  },
  "OrigInvoiceDate"null,
  "Hold": {
    "Value"false
  },
  "PostPeriod"null,
  "FinancialPeriod"null,
  "InvoiceText"null,
  "LocationId": {
    "Value""MAIN"
  },
  "SalesPersonID"null,
  "Salesperson"null,
  "Note"null,
  "BranchNumber"null,
  "CashAccount"null,
  "DontPrint": {
    "Value"false
  },
  "DontEmail": {
    "Value"false
  }
}
Yıldırım
VISMA

by Yıldırım

You should exclude the fields, those unintended to be used & with Null values from your payload. 

Also, please correct your operation field as below. 

 "operation": "Insert",