Invoice line net amount (ibt-131) = Item net price (ibt-146) X Invoiced quantity (ibt-129) ÷ Item price base quantity (ibt-149) + Invoice line charge amount (ibt-141) – Invoice line allowance amount (ibt-136).
/ubl:Invoice[cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'JP' ]/cac:InvoiceLine
(exists(cac:Price/cbc:BaseQuantity) and ((exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()]) and exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()]) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount div cac:Price/cbc:BaseQuantity) + cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cbc:Amount - cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cbc:Amount )) or (not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()])) and exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()]) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount div cac:Price/cbc:BaseQuantity) + cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cbc:Amount)) or (exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()]) and not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()])) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount div cac:Price/cbc:BaseQuantity) - cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cbc:Amount)) or (not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()])) and not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()])) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount div cac:Price/cbc:BaseQuantity))))) or (not(exists(cac:Price/cbc:BaseQuantity)) and ((exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()]) and exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()]) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * cac:Price/cbc:PriceAmount + cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cbc:Amount - cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cbc:Amount )) or (not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()])) and exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()]) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount + cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cbc:Amount))) or (exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()]) and not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()])) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount - cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cbc:Amount))) or (not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=false()])) and not(exists(cac:AllowanceCharge[cbc:ChargeIndicator=true()])) and (cbc:LineExtensionAmount = cbc:InvoicedQuantity * (cac:Price/cbc:PriceAmount)))))