I believe I reproduced what you're describing (although maybe a bit differently).
I created and order with a single line, quantity 10. The order looked like this:
{
"data": {
"useCompany": {
"order": {
"items": [
{
"orderNo": 1489,
"orderDate": 20240319,
"joindown_OrderLine_via_Order": {
"items": [
{
"orderNo": 1489,
"lineNo": 1,
"productNo": "101",
"quantity": 10,
"finished": 0,
"finishDateAsDate": "0001-01-01",
"finishAtAsTime": "00:00"
}
]
}
}
]
}
}
}
}
Next, I ran the mutation you shown, trying to finish 10. The result I got was:
{
"data": {
"useCompany": {
"mutationResult": {
"affectedRows": 1,
"items": [
{
"finished": 0,
"finishDateAsDate": "0001-01-01",
"finishAtAsTime": "00:00"
}
]
}
}
}
}
This means nothing was finished. If I read the order again, I get the same values as previously:
"items": [
{
"orderNo": 1489,
"lineNo": 1,
"productNo": "101",
"quantity": 10,
"finished": 0,
"finishDate": 0,
"finishDateAsDate": "0001-01-01",
"finishAtAsTime": "00:00"
}
If I run the finish processing
mutation finish_order($cid : Int!,
$ono : Int!,
$pno : String)
{
useCompany(no : $cid)
{
order_processings
{
finish(
filter: {orderNo:{_eq : $ono}},
args : {
finishType : 2,
group : {
key : $pno, quantity : 10.0
}
}
)
{
succeeded
items
{
handledOrderLine
{
lineNo
finishedNow
}
}
}
}
}
}
it is reported that 10 items were finished:
{
"data": {
"useCompany": {
"order_processings": {
"finish": {
"succeeded": true,
"items": [
{
"handledOrderLine": [
{
"lineNo": 1,
"finishedNow": 10
}
]
}
]
}
}
}
}
}
But when I read the order, it looks like the quantity is unchanged, and nothing is finished:
"items": [
{
"orderNo": 1489,
"lineNo": 1,
"productNo": "101",
"quantity": 10,
"finished": 0,
"finishDate": 0,
"finishDateAsDate": "0001-01-01",
"finishAtAsTime": "00:00"
}
This is not a GraphQL issue. But we need some input from someone that knows better (than me) the business logic here.
... View more