发票屏幕中的收货地址

时间:2018-12-04 18:39:28

标签: acumatica

我需要在“发票”屏幕上的“发货”屏幕上显示送货地址,因为我们在“发票”屏幕上没有送货地址,因此我在.aspx页的标题部分中创建了一个视图(bql)和表格视图发票屏幕。问题是,页面加载时未显示该地址,但是当我在地址行1字段上检查元素时,该地址已被填充。谁能帮助我,这可能是什么问题。请看下面的代码。

public PXSelect<SOAddress, Where<SOAddress.addressID, Equal<Current<SOInvoice.shipAddressID>>>> ShipToAddress;

<px:PXFormView runat="server" ID="PXFormView2" AllowCollapse="false" Caption="Ship To" RenderStyle="Fieldset" DataSourceID="ds" DataMember="ShipToAddress">
            <Template>
                <px:PXTextEdit runat="server" Enabled="false" DataField="AddressLine1" ID="edAddressLine1" />
            </Template>
        </px:PXFormView>

1 个答案:

答案 0 :(得分:0)

SOInvoice当前对象无法在“发票”屏幕中可靠地加载。

这可能是由于SOInvoice是ARInvoice的子代。

ARInvoice Current对象将可靠地加载,因此我们可以在DataView中使用它而不是SOInvoice Current:

/**
 * Simple Tensorflow C API test.
 */

#include <c_api.h>
#include <stdio.h>
#include <stdlib.h>


char *read_file(char *filename, size_t *len) {
    char *buf = NULL;
    FILE *fp = fopen(filename, "r");
    if (fp != NULL) {
        if (fseek(fp, 0L, SEEK_END) != 0) {
            return NULL;
        }

        *len = ftell(fp);
        if (*len == -1) {
            return NULL;
        }

        buf = malloc(sizeof(char) * (*len + 1));
        if (buf == NULL) {
            return NULL;
        }

        if (fseek(fp, 0L, SEEK_SET) != 0) {
            return NULL;
        }

        size_t n_read = fread(buf, sizeof(char), *len, fp);
        if (ferror(fp) != 0) {
            return NULL;
        }
        if (n_read != *len) {
            return NULL;
        }

        buf[*len] = '\0';
    }
    fclose(fp);


    return buf;
}

static void deallocate_buffer(void *data, size_t size) {
    free(data);
}

int main(int argc, char *argv[]) {
    size_t buf_len;
    char *buf;

    if (argc != 2) {
        fprintf(stderr, "Usage: test graphname.pb\n");
        return 1;
    }

    buf = read_file(argv[1], &buf_len);
    if (buf == NULL) {
        fprintf(stderr, "ERROR: Could not open file %s\n", argv[1]);
        return 1;
    }

    TF_Buffer *buffer = TF_NewBuffer();
    buffer->data = buf;
    buffer->length = buf_len;
    buffer->data_deallocator = deallocate_buffer;

    TF_Graph *graph = TF_NewGraph();
    TF_Status *status = TF_NewStatus();
    TF_ImportGraphDefOptions* opts = TF_NewImportGraphDefOptions();

    TF_GraphImportGraphDef(graph, buffer, opts, status);

    fprintf(stderr, "%s\n", TF_Message(status));

    if (TF_GetCode(status) == TF_OK) {
        fprintf(stderr, "Load successful!\n");
    } else {
        fprintf(stderr, "Failed to load graph def\n");
    }

    TF_DeleteImportGraphDefOptions(opts);
    TF_DeleteBuffer(buffer);
    TF_DeleteStatus(status);
    TF_DeleteGraph(graph);

    return 0;
}