diff --git a/db/routines/vn/procedures/invoiceIn_booking.sql b/db/routines/vn/procedures/invoiceIn_booking.sql index 36189afcc..3d1ca402a 100644 --- a/db/routines/vn/procedures/invoiceIn_booking.sql +++ b/db/routines/vn/procedures/invoiceIn_booking.sql @@ -43,7 +43,7 @@ BEGIN ii.cplusTaxBreakFk, ii.cplusSubjectOpFk, ii.siiTypeInvoiceInFk, - ii.cplusRectificationTypeFk, + ic.cplusRectificationTypeFk, ii.booked, IFNULL(a.isUeeMember, c.isUeeMember) isUeeMember, (c.id = cc.id) isSameCountry, @@ -66,6 +66,7 @@ BEGIN e.name expenseName FROM invoiceIn ii JOIN supplier s ON s.id = ii.supplierFk + LEFT JOIN invoiceInCorrection ic ON ic.correctingFk = ii.id LEFT JOIN province p ON p.id = s.provinceFk LEFT JOIN autonomy a ON a.id = p.autonomyFk JOIN country c ON c.id = s.countryFk