Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate PO: allow units delivered/rec to be set to 0 #1042

Open
Luke1982 opened this issue Apr 20, 2021 · 13 comments
Open

Duplicate PO: allow units delivered/rec to be set to 0 #1042

Luke1982 opened this issue Apr 20, 2021 · 13 comments
Assignees

Comments

@Luke1982
Copy link
Contributor

Luke1982 commented Apr 20, 2021

$PO_associated_prod = getAssociatedProducts($currentModule, $focus);

In my opinion this should be default, but for the sake of backwards compatibility we can do it through a GV. I think we should set the units delivered/received to zero when duplicating a PO. You typically do that to re-place a previous order at a supplier so the units can never be received at that point. @joebordes could you advise on how you would like this to be done?

@Luke1982 Luke1982 self-assigned this Apr 20, 2021
@joebordes
Copy link
Contributor

What I would like to see would be:

  • global variable Inventory_PODuplicate_SetUnits0: 0|1 (boolean), default 0 (= not active)
  • when the variable is set and we are duplicating:
    • we set the Quantity to 0
    • show, in parenthesis, next to the quantity input and in a smaller letter the original quantity

How does that sound?

@Luke1982
Copy link
Contributor Author

The only thing I would change is the GV name. It reads like it applies to the qty of the line, I think it would be better to use something like 'delrec' in the name. Other than that, great!

@joebordes
Copy link
Contributor

How about Inventory_PODuplicate_SetQty0 as the column header is set to Qty?

image

@Luke1982
Copy link
Contributor Author

To be clear: I'm not talking about the Qty, I'm talking about the units delivered/received that you can switch on through the masterdetail businessmap.

@joebordes
Copy link
Contributor

I don't know what that is. Can you upload a screenshot?

@Luke1982
Copy link
Contributor Author

afbeelding
I mean this field

@Luke1982
Copy link
Contributor Author

@joebordes Do you have some time to take a look here?

@joebordes
Copy link
Contributor

I wasn't going to look into this, but...

b755093
3d5bfe8

I added two directives to the map

        <defaultvalue>0</defaultvalue>
        <duplicatevalue>0</duplicatevalue>

let me know how it goes

@Luke1982
Copy link
Contributor Author

Luke1982 commented Jun 2, 2021

Wow, that's cool. But are you manipulating the quantity field, or the units delivered/received?

@joebordes
Copy link
Contributor

the default/duplicate values are defined in the map for the fields you expose

@Luke1982
Copy link
Contributor Author

I'm sorry, I don't understand what you mean

@joebordes
Copy link
Contributor

<map>
  <originmodule>PurchaseOrder</originmodule>
  <targetmodule>InventoryDetails</targetmodule>
  <linkfields>
  <originfield>lineitem_id</originfield>
  <targetfield>lineitem_id</targetfield>
  </linkfields>
  <sortfield>sequence_no</sortfield>
  <detailview>
    <fields>
      <field>
        <fieldtype>corebos</fieldtype>
        <fieldname>units_delivered_received</fieldname>
        <editable>1</editable>
        <mandatory>1</mandatory>
        <hidden>0</hidden>
      </field>
      <field>
        <fieldtype>corebos</fieldtype>
        <fieldname>cf_795</fieldname>
        <editable>1</editable>
        <mandatory>1</mandatory>
        <hidden>0</hidden>

<defaultvalue>0</defaultvalue>
<duplicatevalue>0</duplicatevalue>

      </field>
      <field>
        <fieldtype>corebos</fieldtype>
        <fieldname>cost_price</fieldname>
        <editable>1</editable>
        <mandatory>1</mandatory>
        <hidden>0</hidden>
      </field>
   </fields>
  </detailview>
</map>

@Luke1982
Copy link
Contributor Author

Luke1982 commented Mar 2, 2022

Ah yes, got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants